Skip to content

Commit

Permalink
feat: change nonReapeater and add maxRepetitions as configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
ajasnosz committed Mar 20, 2024
1 parent effa082 commit ca65cfe
Show file tree
Hide file tree
Showing 26 changed files with 113 additions and 26 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

### Changed
- add docker compose deployment
- change nonReapeater to 0 and add maxRepetitions as configurable

## [1.10.0]

Expand Down
2 changes: 2 additions & 0 deletions charts/splunk-connect-for-snmp/templates/worker/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@ Common labels
value: {{ .Values.worker.udpConnectionTimeout | default "3" | quote }}
- name: MAX_OID_TO_PROCESS
value: {{ .Values.poller.maxOidToProcess | default "70" | quote }}
- name: MAX_REPETITIONS
value: {{ .Values.poller.maxRepetitions | default "10" | quote }}
- name: PROFILES_RELOAD_DELAY
value: {{ .Values.worker.profilesReloadDelay | default "60" | quote }}
- name: MIB_SOURCES
Expand Down
6 changes: 5 additions & 1 deletion charts/splunk-connect-for-snmp/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -218,10 +218,14 @@ poller:
# https://github:com/splunk/splunk-connect-for-snmp/blob/main/splunk_connect_for_snmp/profiles/base.yaml
pollBaseProfiles: true

# Sometimes SNMP Agent cannot accept more than X OIDs per once, so if the error "TooBig" is visible in logs,
# Sometimes SNMP Agent cannot accept more than X OIDs per once for SNMP GetRequest, so if the error "TooBig" is visible in logs,
# decrease the number
maxOidToProcess: 70

# maxRepetitions is a number of varbinds requested in response for each of the MIB variables in the request
# If this number is too high it can cause issues with SNMP response especially for old SNMP devices.
maxRepetitions: 10

# list of kubernetes secrets name that will be used for polling
# https://splunk.github.io/splunk-connect-for-snmp/main/configuration/poller-configuration/#define-usernamesecrets
usernameSecrets: []
Expand Down
28 changes: 27 additions & 1 deletion docs/configuration/poller-configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Poller is a service which is responsible for querying
SNMP devices using the SNMP GET and WALK functionalities. Poller executes two main types of tasks:

- The Walk task executes SNMP walk. SNMP walk is an SNMP application that uses SNMP GETNEXT requests to
- The Walk task executes SNMP walk. SNMP walk is an SNMP application that uses SNMP GETBULK requests to
collect SNMP data from the network and infrastructure of SNMP-enabled devices, such as switches and routers. It is a time-consuming task,
which may overload the SNMP device when executed too often. It is used by the SC4SNMP to collect and push all OID values, which the provided ACL has access to.

Expand Down Expand Up @@ -37,6 +37,32 @@ The default value is `WARNING`.
### Define usernameSecrets
Secrets are required to run SNMPv3 polling. To add v3 authentication details, create the k8s Secret object: [SNMPv3 Configuration](snmpv3-configuration.md), and put its name in `poller.usernameSecrets`.

### Define maxRepetitions
The maxRepetitions is a parameter used in SNMP GetBulk call. It is responsible for controlling the
amount of variables in one request.
```yaml
poller:
maxRepetitions: 10
```
`maxRepetitions` variable is the amount of requested next oids in response for each of varbinds in one request sent.

For example:

The configured variables:
```yaml
poller:
maxRepetitions: 2
```
The requested varbinds in one getBulk call:
```
IP-MIB.ipNetToMediaNetAddress
```

[![PDU Request Example](../images/request_pdu_flow.png)](../images/request_pdu_flow.png)

After third ResponsePDU the returned oids are out of scope for requested table, so the call is stopped.
It can be spotted on diagram that response for `IP-MIB.ipNetToMediaNetAddress` includes 2 oids as `maxRepetition` was set to 3.

### Append OID index part to the metrics

Not every SNMP metric object is structured with its index as a one of the field values. We can append the index part of OID with:
Expand Down
Binary file added docs/images/request_pdu_flow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 1 addition & 22 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ spec:
value: "3"
- name: MAX_OID_TO_PROCESS
value: "70"
- name: MAX_REPETITIONS
value: "10"
- name: PROFILES_RELOAD_DELAY
value: "60"
- name: MIB_SOURCES
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ spec:
value: "3"
- name: MAX_OID_TO_PROCESS
value: "70"
- name: MAX_REPETITIONS
value: "10"
- name: PROFILES_RELOAD_DELAY
value: "60"
- name: MIB_SOURCES
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ spec:
value: "3"
- name: MAX_OID_TO_PROCESS
value: "70"
- name: MAX_REPETITIONS
value: "10"
- name: PROFILES_RELOAD_DELAY
value: "60"
- name: MIB_SOURCES
Expand Down Expand Up @@ -105,6 +107,12 @@ spec:
value: "4"
- name: PREFETCH_COUNT
value: "30"
- name: RESOLVE_TRAP_ADDRESS
value: "false"
- name: MAX_DNS_CACHE_SIZE_TRAPS
value: "500"
- name: TTL_DNS_CACHE_TRAPS
value: "1800"
volumeMounts:
- name: config
mountPath: "/app/config"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ spec:
value: "3"
- name: MAX_OID_TO_PROCESS
value: "70"
- name: MAX_REPETITIONS
value: "10"
- name: PROFILES_RELOAD_DELAY
value: "60"
- name: MIB_SOURCES
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ spec:
value: "3"
- name: MAX_OID_TO_PROCESS
value: "70"
- name: MAX_REPETITIONS
value: "10"
- name: PROFILES_RELOAD_DELAY
value: "60"
- name: MIB_SOURCES
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ spec:
value: "3"
- name: MAX_OID_TO_PROCESS
value: "70"
- name: MAX_REPETITIONS
value: "10"
- name: PROFILES_RELOAD_DELAY
value: "60"
- name: MIB_SOURCES
Expand Down Expand Up @@ -104,6 +106,12 @@ spec:
value: "4"
- name: PREFETCH_COUNT
value: "30"
- name: RESOLVE_TRAP_ADDRESS
value: "false"
- name: MAX_DNS_CACHE_SIZE_TRAPS
value: "500"
- name: TTL_DNS_CACHE_TRAPS
value: "1800"
volumeMounts:
- name: config
mountPath: "/app/config"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ spec:
value: "3"
- name: MAX_OID_TO_PROCESS
value: "70"
- name: MAX_REPETITIONS
value: "10"
- name: PROFILES_RELOAD_DELAY
value: "60"
- name: MIB_SOURCES
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ spec:
value: "3"
- name: MAX_OID_TO_PROCESS
value: "70"
- name: MAX_REPETITIONS
value: "10"
- name: PROFILES_RELOAD_DELAY
value: "60"
- name: MIB_SOURCES
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ spec:
value: "3"
- name: MAX_OID_TO_PROCESS
value: "70"
- name: MAX_REPETITIONS
value: "10"
- name: PROFILES_RELOAD_DELAY
value: "60"
- name: MIB_SOURCES
Expand Down Expand Up @@ -104,6 +106,12 @@ spec:
value: "4"
- name: PREFETCH_COUNT
value: "30"
- name: RESOLVE_TRAP_ADDRESS
value: "false"
- name: MAX_DNS_CACHE_SIZE_TRAPS
value: "500"
- name: TTL_DNS_CACHE_TRAPS
value: "1800"
volumeMounts:
- name: config
mountPath: "/app/config"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ spec:
value: "3"
- name: MAX_OID_TO_PROCESS
value: "70"
- name: MAX_REPETITIONS
value: "10"
- name: PROFILES_RELOAD_DELAY
value: "60"
- name: MIB_SOURCES
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ spec:
value: "3"
- name: MAX_OID_TO_PROCESS
value: "70"
- name: MAX_REPETITIONS
value: "10"
- name: PROFILES_RELOAD_DELAY
value: "60"
- name: MIB_SOURCES
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ spec:
value: "3"
- name: MAX_OID_TO_PROCESS
value: "70"
- name: MAX_REPETITIONS
value: "10"
- name: PROFILES_RELOAD_DELAY
value: "60"
- name: MIB_SOURCES
Expand Down Expand Up @@ -105,6 +107,12 @@ spec:
value: "4"
- name: PREFETCH_COUNT
value: "30"
- name: RESOLVE_TRAP_ADDRESS
value: "false"
- name: MAX_DNS_CACHE_SIZE_TRAPS
value: "500"
- name: TTL_DNS_CACHE_TRAPS
value: "1800"
volumeMounts:
- name: config
mountPath: "/app/config"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ spec:
value: "3"
- name: MAX_OID_TO_PROCESS
value: "70"
- name: MAX_REPETITIONS
value: "10"
- name: PROFILES_RELOAD_DELAY
value: "60"
- name: MIB_SOURCES
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ spec:
value: "3"
- name: MAX_OID_TO_PROCESS
value: "70"
- name: MAX_REPETITIONS
value: "10"
- name: PROFILES_RELOAD_DELAY
value: "60"
- name: MIB_SOURCES
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ spec:
value: "3"
- name: MAX_OID_TO_PROCESS
value: "70"
- name: MAX_REPETITIONS
value: "10"
- name: PROFILES_RELOAD_DELAY
value: "60"
- name: MIB_SOURCES
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ spec:
value: "3"
- name: MAX_OID_TO_PROCESS
value: "70"
- name: MAX_REPETITIONS
value: "10"
- name: PROFILES_RELOAD_DELAY
value: "60"
- name: MIB_SOURCES
Expand Down Expand Up @@ -105,6 +107,12 @@ spec:
value: "4"
- name: PREFETCH_COUNT
value: "30"
- name: RESOLVE_TRAP_ADDRESS
value: "false"
- name: MAX_DNS_CACHE_SIZE_TRAPS
value: "500"
- name: TTL_DNS_CACHE_TRAPS
value: "1800"
volumeMounts:
- name: config
mountPath: "/app/config"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ spec:
value: "3"
- name: MAX_OID_TO_PROCESS
value: "70"
- name: MAX_REPETITIONS
value: "10"
- name: PROFILES_RELOAD_DELAY
value: "60"
- name: MIB_SOURCES
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ spec:
value: "3"
- name: MAX_OID_TO_PROCESS
value: "70"
- name: MAX_REPETITIONS
value: "10"
- name: PROFILES_RELOAD_DELAY
value: "60"
- name: MIB_SOURCES
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ spec:
value: "3"
- name: MAX_OID_TO_PROCESS
value: "70"
- name: MAX_REPETITIONS
value: "10"
- name: PROFILES_RELOAD_DELAY
value: "60"
- name: MIB_SOURCES
Expand Down Expand Up @@ -105,6 +107,12 @@ spec:
value: "4"
- name: PREFETCH_COUNT
value: "30"
- name: RESOLVE_TRAP_ADDRESS
value: "false"
- name: MAX_DNS_CACHE_SIZE_TRAPS
value: "500"
- name: TTL_DNS_CACHE_TRAPS
value: "1800"
volumeMounts:
- name: config
mountPath: "/app/config"
Expand Down
Loading

0 comments on commit ca65cfe

Please sign in to comment.