Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: change nonReapeater and add maxRepetitions as configurable #976

Draft
wants to merge 59 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
e88717a
chore: remove redundant code (#974)
ajasnosz Mar 8, 2024
461774a
feat: add docker compose deployment configuration (#973)
wojtekzyla Mar 14, 2024
2bcfedd
fix: update .releaserc (#979)
wojtekzyla Mar 14, 2024
682cf21
chore(release): 1.11.0-beta.1
srv-rr-github-token Mar 14, 2024
effa082
chore(deps): update dependency pytest to v8.1.1 (#959)
renovate[bot] Mar 20, 2024
9c10712
chore: update jinja2 and pycryptodomex (#981)
ajasnosz Mar 21, 2024
33cd16b
chore(deps): update oleksiyrudenko/gha-git-credentials action to v2.1…
renovate[bot] Mar 21, 2024
3816095
chore(deps): update splunk/addonfactory-github-workflows action to v1…
renovate[bot] Mar 21, 2024
7955a12
chore(deps): update pre-commit/action action to v3.0.1 (#955)
renovate[bot] Mar 21, 2024
f7ea224
chore(deps): update splunk/semantic-release-action action to v1.3.4 (…
renovate[bot] Mar 21, 2024
bda2bd4
chore(deps): update softprops/action-gh-release action to v2 (#977)
renovate[bot] Mar 21, 2024
a006dd9
chore(deps): update dependency ruamel.yaml to v0.18.6 (#954)
renovate[bot] Mar 21, 2024
86e3ebe
chore(deps): update dependency pymongo to v4.6.2 (#963)
renovate[bot] Mar 21, 2024
4d5f2ba
docs: add restart instruction (#983)
ajasnosz Mar 21, 2024
cd2ddee
chore(deps): update docker/login-action action to v3.1.0 (#984)
renovate[bot] Mar 22, 2024
5a944e4
fix: fix formatting of Debug Splunk Connect for SNMP documentation (#…
wojtekzyla Mar 27, 2024
04dd6fd
chore(release): 1.11.0-beta.2
srv-rr-github-token Mar 27, 2024
86460cc
docs: add template for ui file (#992)
ajasnosz Apr 12, 2024
6e4f634
Fix: improve errors message (#993)
ajasnosz Apr 12, 2024
ead94b3
fix: improve mkdocs.yml file formatting (#994)
wojtekzyla Apr 12, 2024
d76b88f
chore(release): 1.11.0-beta.3
srv-rr-github-token Apr 12, 2024
194290c
chore(deps): update dependency pymongo to v4.6.3 (#989)
renovate[bot] Apr 16, 2024
0f85f17
chore(deps): update peaceiris/actions-gh-pages action to v4 (#991)
renovate[bot] Apr 16, 2024
2d80cba
chore(deps): update dependency pytest-cov to v5 (#987)
renovate[bot] Apr 16, 2024
98e5438
chore: bump dnspython snd idna (#995)
ajasnosz Apr 16, 2024
c238f72
chore(deps): update dependency opentelemetry-api to v1.24.0 (#931)
renovate[bot] Apr 17, 2024
e14bb6f
chore(deps): update dependency mkdocs-material to v9.5.18 (#934)
renovate[bot] Apr 17, 2024
80d72c0
chore(deps): update dependency pydantic to v1.10.15 (#942)
renovate[bot] Apr 17, 2024
0516087
chore(deps): update dependency requests-ratelimiter to ^0.6.0 (#949)
renovate[bot] Apr 17, 2024
0578dd4
chore(deps): update dependency requests-cache to v1.2.0 (#960)
renovate[bot] Apr 17, 2024
f3421f4
chore(deps): update dependency mongoengine to ^0.28.0 (#969)
renovate[bot] Apr 17, 2024
8d3350f
chore(deps): update helm release redis to v19 (#986)
renovate[bot] Apr 17, 2024
dcca9aa
chore: fix operators and imports (#997)
ajasnosz Apr 18, 2024
91b5fbe
chore: fix semantic-release-replace-plugin (#1000)
ajasnosz Apr 19, 2024
3c9273b
fix: fix a bug with values.yaml not being loaded to the UI while migr…
wojtekzyla Apr 19, 2024
2eee8cf
chore: fix semantic plugin (#1002)
ajasnosz Apr 19, 2024
f1bf18a
chore(release): 1.11.0-beta.4
srv-rr-github-token Apr 19, 2024
c415d0e
fix: fix sonarqube issues with f-string and regex (#1001)
wojtekzyla Apr 22, 2024
1bb2b6a
chore(release): 1.11.0-beta.5
srv-rr-github-token Apr 22, 2024
642c539
fix: update microk8s to v1.30 (#1004)
ajasnosz Apr 25, 2024
1ce5abc
chore(release): 1.11.0-beta.6
srv-rr-github-token Apr 25, 2024
34affa8
chore: resolve shell issues (#1008)
ajasnosz Apr 25, 2024
1ffd1ae
chore: remove duplicated functions (#1009)
ajasnosz Apr 26, 2024
ddc425d
chore: rename variables to match naming convention (#1005)
wojtekzyla Apr 26, 2024
e577bc2
chore: jinja2 security update (#1013)
ajasnosz May 8, 2024
c91d59c
chore: change docker image user from root to UID=10001. Change owners…
wojtekzyla May 8, 2024
ea3fe7f
chore: remove unused fstrings (#1017)
ajasnosz May 13, 2024
200eff3
chore: fix duplications (#1020)
ajasnosz May 17, 2024
3cd6e9e
fix: fix wring log message in UI tests and change sleep time in UI te…
wojtekzyla May 23, 2024
ef08305
chore(release): 1.11.0-beta.7
srv-rr-github-token May 23, 2024
69d15e0
feat: add docker scaling (#1024)
ajasnosz May 27, 2024
1912f78
chore(release): 1.11.0-beta.8
srv-rr-github-token May 27, 2024
26d089a
feat: change nonReapeater and add maxRepetitions as configurable
ajasnosz Mar 8, 2024
8d510e6
chore: add CI action to upload chart.zip under a PR
wojtekzyla Jun 12, 2024
b70254c
fix: fix ci-charts-artifact.yaml
wojtekzyla Jun 12, 2024
0aff22e
Feat: improve polling time merge 1 (#1132)
ajasnosz Nov 26, 2024
ed2eddf
# Conflicts:
ajasnosz Nov 26, 2024
bbd16a1
Merge branch 'develop' into feat/improve-polling-time
ajasnosz Nov 26, 2024
3de5ed6
chore: merge
ajasnosz Nov 26, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions .github/workflows/ci-charts-artifact.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: create-charts-zip
on:
pull_request:
branches:
- "main"
- "develop"
- "next"

jobs:
build:
name: Build
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
strategy:
matrix:
python-version:
- 3.9
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Zip charts directory and upload it
run: |
zip -r charts.zip charts
VERSION=$(echo $GITHUB_REF | cut -d / -f 3)
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create artifact
uses: actions/upload-artifact@v4
with:
name: ${{ env.ARTIFACT_NAME }}
path: charts.zip
env:
ARTIFACT_NAME: charts
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 @@ -224,10 +224,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/microk8s/configuration/poller-configuration/#define-usernamesecrets
usernameSecrets: []
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.
28 changes: 27 additions & 1 deletion docs/microk8s/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 @@ -41,6 +41,32 @@ The default value is `INFO`.
### 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
10 changes: 0 additions & 10 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 @@ -68,6 +68,8 @@ spec:
value: "70"
- name: PYSNMP_DEBUG
value: ""
- 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 @@ -68,6 +68,8 @@ spec:
value: "70"
- name: PYSNMP_DEBUG
value: ""
- 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 @@ -68,6 +68,8 @@ spec:
value: "70"
- name: PYSNMP_DEBUG
value: ""
- 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 @@ -67,6 +67,8 @@ spec:
value: "70"
- name: PYSNMP_DEBUG
value: ""
- 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 @@ -67,6 +67,8 @@ spec:
value: "70"
- name: PYSNMP_DEBUG
value: ""
- 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 @@ -67,6 +67,8 @@ spec:
value: "70"
- name: PYSNMP_DEBUG
value: ""
- 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 @@ -67,6 +67,8 @@ spec:
value: "70"
- name: PYSNMP_DEBUG
value: ""
- 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 @@ -67,6 +67,8 @@ spec:
value: "70"
- name: PYSNMP_DEBUG
value: ""
- 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 @@ -67,6 +67,8 @@ spec:
value: "70"
- name: PYSNMP_DEBUG
value: ""
- 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 @@ -68,6 +68,8 @@ spec:
value: "70"
- name: PYSNMP_DEBUG
value: ""
- 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 @@ -68,6 +68,8 @@ spec:
value: "70"
- name: PYSNMP_DEBUG
value: ""
- 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 @@ -68,6 +68,8 @@ spec:
value: "70"
- name: PYSNMP_DEBUG
value: ""
- 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 @@ -68,6 +68,8 @@ spec:
value: "70"
- name: PYSNMP_DEBUG
value: ""
- 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 @@ -68,6 +68,8 @@ spec:
value: "70"
- name: PYSNMP_DEBUG
value: ""
- 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 @@ -68,6 +68,8 @@ spec:
value: "70"
- name: PYSNMP_DEBUG
value: ""
- 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 @@ -68,6 +68,8 @@ spec:
value: "70"
- name: PYSNMP_DEBUG
value: ""
- 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 @@ -68,6 +68,8 @@ spec:
value: "70"
- name: PYSNMP_DEBUG
value: ""
- 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 @@ -68,6 +68,8 @@ spec:
value: "70"
- name: PYSNMP_DEBUG
value: ""
- 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 @@ -68,6 +68,8 @@ spec:
value: "70"
- name: PYSNMP_DEBUG
value: ""
- name: MAX_REPETITIONS
value: "10"
- name: PROFILES_RELOAD_DELAY
value: "60"
- name: MIB_SOURCES
Expand Down
5 changes: 3 additions & 2 deletions splunk_connect_for_snmp/snmp/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
UDP_CONNECTION_TIMEOUT = int(os.getenv("UDP_CONNECTION_TIMEOUT", 3))
MAX_OID_TO_PROCESS = int(os.getenv("MAX_OID_TO_PROCESS", 70))
PYSNMP_DEBUG = os.getenv("PYSNMP_DEBUG", "")
MAX_REPETITIONS = int(os.getenv("MAX_REPETITIONS", 10))

DEFAULT_STANDARD_MIBS = [
"HOST-RESOURCES-MIB",
Expand Down Expand Up @@ -430,8 +431,8 @@ def run_bulk_request(
auth_data,
transport,
context_data,
1,
10,
0,
MAX_REPETITIONS,
*varbinds_bulk,
lexicographicMode=False,
ignoreNonIncreasingOid=is_increasing_oids_ignored(ir.address, ir.port),
Expand Down
Loading