Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Changelog

## Unreleased

### Changed
- change redis service name workers call from redis-headless to redis-master
- migrate MongoDB subchart to 15.6.26

### Fixed


## [1.12.2]

### Changed
Expand Down
8 changes: 4 additions & 4 deletions charts/splunk-connect-for-snmp/Chart.lock
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
dependencies:
- name: mongodb
repository: https://charts.bitnami.com/bitnami
version: 13.18.5
version: 16.5.11
- name: redis
repository: https://charts.bitnami.com/bitnami
version: 20.2.2
- name: mibserver
repository: https://pysnmp.github.io/mibs/charts/
version: 1.15.15
digest: sha256:a72daee1041b9160c0faa5789f86f17e2e27e8a86f41dc2eb829a63331a5f51f
generated: "2025-01-27T14:53:57.90014427Z"
version: 1.15.19
digest: sha256:63eced767b2a3f13d819163a5d91bc7570e9ad7ade67673c5445a5cb4d6c18bd
generated: "2025-05-26T15:52:21.870704+02:00"
6 changes: 3 additions & 3 deletions charts/splunk-connect-for-snmp/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@ type: application
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)

version: 1.12.2
version: 1.12.3-beta.2
# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "1.12.2"
appVersion: "1.12.3-beta.2"
#
dependencies:
- name: mongodb
version: ~13.18.0
version: ~16.5.9
repository: https://charts.bitnami.com/bitnami
- name: redis
version: ~20.2.0
Expand Down
20 changes: 18 additions & 2 deletions charts/splunk-connect-for-snmp/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,28 @@
{{- end }}
{{- end }}

{{- define "splunk-connect-for-snmp.mongodbHost" -}}
{{- if .Values.mongodbHost }}
{{- .Values.mongodbHost | quote }}
{{- else }}
{{- printf "%s-mongodb.%s.svc.cluster.local" .Release.Name .Release.Namespace }}
{{- end }}
{{- end }}

{{- define "splunk-connect-for-snmp.celery_url" -}}
{{- printf "redis://%s-redis-headless:6379/0" .Release.Name }}
{{- if and ( eq .Values.redis.architecture "replication" ) .Values.redis.sentinel.enabled }}
{{- printf "redis://%s-redis:6379/0" .Release.Name }}
{{- else }}
{{- printf "redis://%s-redis-master:6379/0" .Release.Name }}
{{- end }}
{{- end }}

{{- define "splunk-connect-for-snmp.redis_url" -}}
{{- printf "redis://%s-redis-headless:6379/1" .Release.Name }}
{{- if and ( eq .Values.redis.architecture "replication" ) .Values.redis.sentinel.enabled }}
{{- printf "redis://%s-redis:6379/1" .Release.Name }}
{{- else }}
{{- printf "redis://%s-redis-master:6379/1" .Release.Name }}
{{- end }}
{{- end }}

{{/*
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{{- $configMapName := printf "%s-config" (include "splunk-connect-for-snmp.name" .) }}
{{- $existingRelease := (lookup "v1" "ConfigMap" .Release.Namespace $configMapName) }}
{{- if $existingRelease }}
{{- $chartLabel := index $existingRelease.metadata.labels "helm.sh/chart" }}
{{- $namePrefix := printf "%s-" (include "splunk-connect-for-snmp.name" .) }}
{{- $prevVersion := trimPrefix $namePrefix $chartLabel }}
apiVersion: batch/v1
kind: Job
metadata:
name: mongo-fcv-upgrade-to-7
annotations:
"helm.sh/hook": pre-upgrade
"helm.sh/hook-delete-policy": hook-succeeded,before-hook-creation
spec:
backoffLimit: 1
template:
spec:
containers:
- name: mongo-fcv-check
image: {{ .Values.mongodb.image.repository }}:{{ .Values.mongodb.image.tag }}
command:
- /bin/bash
- -c
- |
set -e

PREV_VERSION="{{ $prevVersion }}"
TARGET_VERSION="{{ .Chart.AppVersion }}"

echo "Previous app version: $PREV_VERSION"
echo "Target app version: $TARGET_VERSION"

if [ "$(printf '%s\n' "$PREV_VERSION" "1.12.3" | sort -V | head -n1)" != "1.12.3" ]; then
echo "ERROR: Cannot upgrade directly from app version $PREV_VERSION to $TARGET_VERSION."
echo "Please upgrade to the intermediate version 1.12.3 first."
echo "You can do it with a command:"
echo "microk8s helm3 upgrade --install snmp -f values.yaml splunk-connect-for-snmp/splunk-connect-for-snmp --namespace=sc4snmp --create-namespace --version 1.12.3" >&2
exit 1
fi

echo "Checking current mongo FCV"
FCV=$(mongosh --host {{ include "splunk-connect-for-snmp.mongodbHost" . | quote }} --quiet --eval 'db.adminCommand({ getParameter: 1, featureCompatibilityVersion: 1 }).featureCompatibilityVersion.version')
echo "Current Mongo Feature Compatibility Version: $FCV"

if [[ "$FCV" < "7.0" ]]; then
echo "FCV < 7.0, setting to 7.0"
mongosh --host {{ include "splunk-connect-for-snmp.mongodbHost" . | quote }} --eval 'db.adminCommand({ setFeatureCompatibilityVersion: "7.0", confirm: true })'
else
echo "FCV >= 7.0, nothing to be changed"
fi
restartPolicy: Never
{{- end }}
4 changes: 2 additions & 2 deletions charts/splunk-connect-for-snmp/templates/ui/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,11 @@ Return full image for thr UI back end.
{{- end }}

{{- define "splunk-connect-for-snmp-ui.celery_url" -}}
{{- printf "redis://%s-redis-headless:6379/2" .Release.Name }}
{{- printf "redis://%s-redis-master:6379/2" .Release.Name }}
{{- end }}

{{- define "splunk-connect-for-snmp-ui.redis_url" -}}
{{- printf "redis://%s-redis-headless:6379/3" .Release.Name }}
{{- printf "redis://%s-redis-master:6379/3" .Release.Name }}
{{- end }}

{{- define "splunk-connect-for-snmp-ui.hostMountPath" -}}
Expand Down
2 changes: 1 addition & 1 deletion charts/splunk-connect-for-snmp/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@ mongodb:
type: Recreate
initdbScripts:
setFeatureCompatibilityVersion.js: |
db.adminCommand({ setFeatureCompatibilityVersion: "5.0" });
db.adminCommand({ setFeatureCompatibilityVersion: "6.0" });

## @section Global parameters
## Global Docker image parameters
Expand Down
6 changes: 3 additions & 3 deletions docker_compose/.env
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Deployment configuration
SC4SNMP_IMAGE=ghcr.io/splunk/splunk-connect-for-snmp/container
SC4SNMP_TAG="1.12.2"
SC4SNMP_TAG="1.12.3-beta.2"
SCHEDULER_CONFIG_FILE_ABSOLUTE_PATH=
TRAPS_CONFIG_FILE_ABSOLUTE_PATH=
INVENTORY_FILE_ABSOLUTE_PATH=
COREFILE_ABS_PATH=
SC4SNMP_VERSION="1.12.2"
SC4SNMP_VERSION="1.12.3-beta.2"

# Network configuration
COREDNS_ADDRESS=172.28.0.255
Expand All @@ -24,7 +24,7 @@ MIBSERVER_TAG=latest
REDIS_IMAGE=docker.io/bitnami/redis
REDIS_TAG=7.2.1-debian-11-r0
MONGO_IMAGE=docker.io/bitnami/mongodb
MONGO_TAG=6.0.9-debian-11-r5
MONGO_TAG=8.0.9-debian-12-r2

# Splunk instance configuration
SPLUNK_HEC_HOST=
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.
8 changes: 4 additions & 4 deletions docs/improved-polling.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,20 @@ Your feedback during this phase is crucial in refining and optimizing and can be
To get started, the zip file with helm chart must be downloaded. It can be found on [feat/improve-polling-time](https://github.com/splunk/splunk-connect-for-snmp/pull/976/checks) branch.

On the left-hand side click `create-charts-zip`:
![Workflows](../images/improved-polling-tmp/actions-view.png)
![Workflows](./images/improved-polling-tmp/actions-view.png)

<hr style="border:2px solid">

At the bottom of the page in the `Artifacts` section there will be
`charts` package. Download it and unzip it in your environment.

![Workflows](../images/improved-polling-tmp/charts-zip-view.png)
![Workflows](./images/improved-polling-tmp/charts-zip-view.png)

In `values.yaml` set the following image settings:

```yaml
image:
repository: ghcr.io/splunk/splunk-connect-for-snmp/improved-polling-time
repository: ghcr.io/splunk/splunk-connect-for-snmp/improved-polling
tag: "latest"
```

Expand All @@ -36,7 +36,7 @@ microk8s helm3 upgrade --install snmp -f values.yaml splunk-connect-for-snmp/spl

In order to use this beta release, `splunk-connect-for-snmp/splunk-connect-for-snmp` needs to be changed to the path of the `charts/splunk-connect-for-snmp` directory.

To learn how the new improved polling works, refer to the documentation [Poller Configuration - Define maxRepetitions](https://github.com/splunk/splunk-connect-for-snmp/blob/feat/improve-polling-time/docs/configuration/poller-configuration.md#define-maxrepetitions)
To learn how the new improved polling works, refer to the documentation [Poller Configuration - Define maxRepetitions](./microk8s/configuration/poller-configuration.md#define-maxrepetitions)
for instructions.

Your involvement in testing new polling support is pivotal, and we look forward to hearing about your experiences.
29 changes: 29 additions & 0 deletions docs/microk8s/configuration/poller-configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,35 @@ When IPv6 is enabled and device is dual stack, the hostname resolution will try
The log level for poller can be set by changing the value for the key `logLevel`. The allowed values are: `DEBUG`, `INFO`, `WARNING`, `ERROR`, `CRITICAL` or `FATAL`.
The default value is `INFO`.

### Define maxRepetitions
!!! info
Released only in improved polling package.

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 2.

### 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`.

Expand Down
4 changes: 2 additions & 2 deletions docs/microk8s/configuration/step-by-step-poll.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,8 @@ microk8s kubectl logs -f snmp-splunk-connect-for-snmp-inventory-g4bs7 -n sc4snm
See the following example output:

```yaml
Successfully connected to redis://snmp-redis-headless:6379/0
Successfully connected to redis://snmp-redis-headless:6379/1
Successfully connected to redis://snmp-redis-master:6379/0
Successfully connected to redis://snmp-redis-master:6379/1
Successfully connected to mongodb://snmp-mongodb:27017
Successfully connected to http://snmp-mibserver/index.csv
{"message": "Loading inventory from /app/inventory/inventory.csv", "time": "2022-09-05T14:30:30.605420", "level": "INFO"}
Expand Down
2 changes: 1 addition & 1 deletion docs/microk8s/sc4snmp-installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ Here is an example of the correct setup:

```
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
snmp-redis-headless ClusterIP None <none> 6379/TCP 33h
snmp-redis-master ClusterIP None <none> 6379/TCP 33h
snmp-mongodb ClusterIP 10.152.183.147 <none> 27017/TCP 33h
snmp-mibserver ClusterIP 10.152.183.253 <none> 80/TCP 33h
snmp-redis-master ClusterIP 10.152.183.135 <none> 6379/TCP 33h
Expand Down
3 changes: 3 additions & 0 deletions docs/microk8s/upgrade.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

See the following to update SC4SNMP.

!!! warning
Upgrading SC4SNMP from version `1.12.2` to `1.12.3` includes MongoDB upgrade. In case of any issues refer to [this instruction](../troubleshooting/general-issues.md#upgrading-from-sc4snmp-1122-to-1123).

## Upgrade to the latest version
To upgrade SC4SNMP to the latest version, simply run the following command:

Expand Down
58 changes: 58 additions & 0 deletions docs/troubleshooting/general-issues.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
## General issues

### Upgrading SC4SNMP from 1.12.2 to 1.12.3

When upgrading SC4SNMP from version `1.12.2` to `1.12.3`, the subchart version of MongoDB will be updated from `13.18.5` to `15.6.26`. This upgrade requires an increase in the MongoDB `Feature Compatibility Version (FCV)` from `5.0` to `6.0`.

To facilitate this change, a new pre-upgrade job has been introduced in SC4SNMP: `mongo-fcv-upgrade-to-6`. This job automatically updates the Feature Compatibility Version on MongoDB before the installation of MongoDB version `15.6.26`.

#### Pre-Upgrade Job: `mongo-fcv-upgrade-to-6`

- The `mongo-fcv-upgrade-to-6` job is designed to ensure compatibility by running the FCV update prior to upgrading MongoDB.

#### Handling Job Failures

If the `mongo-fcv-upgrade-to-6` job fails for any reason, there are two recovery options:

1. **Reinstall SC4SNMP**:

[Reinstall SC4SNMP](../../microk8s/sc4snmp-installation#restart-splunk-connect-for-snmp) with **Persistent Volume Claim (PVC) deletion**.

2. **Manually Update MongoDB**:

[Update MongoDB's Feature Compatibility Version](https://www.mongodb.com/docs/manual/release-notes/6.0-upgrade-standalone/#upgrade-procedure) manually by executing the following command:
```bash
microk8s exec -it pod/<mongodb-pod-id> -n sc4snmp mongosh
db.adminCommand( { setFeatureCompatibilityVersion: "6.0" })
```

Replace `<mongodb-pod-id>` with the actual Pod ID of your MongoDB instance.


### Upgrading SC4SNMP from 1.12.3 to 1.13.0

When upgrading SC4SNMP from version `1.12.3` to `1.13.0`, the subchart version of MongoDB will be updated from `15.6.26` to `16.5.9`. This upgrade requires an increase in the MongoDB `Feature Compatibility Version (FCV)` from `6.0` to `7.0`.

To facilitate this change, a new pre-upgrade job has been introduced in SC4SNMP: `mongo-fcv-upgrade-to-7`. This job automatically updates the Feature Compatibility Version on MongoDB before the installation of MongoDB version `16.5.9`.

#### Pre-Upgrade Job: `mongo-fcv-upgrade-to-7`

- The `mongo-fcv-upgrade-to-7` job is designed to ensure compatibility by running the FCV update prior to upgrading MongoDB.

#### Handling Job Failures

If the `mongo-fcv-upgrade-to-7` job fails for any reason, there are two recovery options:

1. **Reinstall SC4SNMP**:

[Reinstall SC4SNMP](../../microk8s/sc4snmp-installation#restart-splunk-connect-for-snmp) with **Persistent Volume Claim (PVC) deletion**.

2. **Manually Update MongoDB**:

[Update MongoDB's Feature Compatibility Version](https://www.mongodb.com/docs/manual/release-notes/6.0-upgrade-standalone/#upgrade-procedure) manually by executing the following command:
```bash
microk8s exec -it pod/<mongodb-pod-id> -n sc4snmp mongosh
db.adminCommand( { setFeatureCompatibilityVersion: "7.0", confirm: true })
```

Replace `<mongodb-pod-id>` with the actual Pod ID of your MongoDB instance.
2 changes: 1 addition & 1 deletion docs/troubleshooting/traps-issues.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ microk8s kubectl -n sc4snmp get services
This command should output similar data:
```
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
snmp-redis-headless ClusterIP None <none> 6379/TCP 113s
snmp-redis-master ClusterIP None <none> 6379/TCP 113s
snmp-mibserver ClusterIP 10.152.183.163 <none> 80/TCP 113s
snmp-mongodb ClusterIP 10.152.183.118 <none> 27017/TCP 113s
snmp-redis-master ClusterIP 10.152.183.61 <none> 6379/TCP 113s
Expand Down
1 change: 1 addition & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ nav:
- Accessing and configuring logs: "troubleshooting/configuring-logs.md"
- Docker commands: "troubleshooting/docker-commands.md"
- Kubernetes commands: "troubleshooting/k8s-commands.md"
- General issues: "troubleshooting/general-issues.md"
- Polling issues: "troubleshooting/polling-issues.md"
- Traps issues: "troubleshooting/traps-issues.md"

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "splunk-connect-for-snmp"
version = "1.12.2"
version = "1.12.3-beta.2"
description = ""
authors = ["omrozowicz-splunk <[email protected]>"]
license = "Apache-2.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ spec:
- name: CONFIG_PATH
value: /app/config/config.yaml
- name: REDIS_URL
value: redis://release-name-redis-headless:6379/1
value: redis://release-name-redis-master:6379/1
- name: INVENTORY_PATH
value: /app/inventory/inventory.csv
- name: CELERY_BROKER_URL
value: redis://release-name-redis-headless:6379/0
value: redis://release-name-redis-master:6379/0
- name: MONGO_URI
value: mongodb://release-name-mongodb:27017
- name: MIB_SOURCES
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ spec:
- name: CONFIG_PATH
value: /app/config/config.yaml
- name: REDIS_URL
value: redis://release-name-redis-headless:6379/1
value: redis://release-name-redis-master:6379/1
- name: CELERY_BROKER_URL
value: redis://release-name-redis-headless:6379/0
value: redis://release-name-redis-master:6379/0
- name: MONGO_URI
value: mongodb://release-name-mongodb:27017
- name: MIB_SOURCES
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ spec:
- name: CONFIG_PATH
value: /app/config/config.yaml
- name: CELERY_BROKER_URL
value: redis://release-name-redis-headless:6379/0
value: redis://release-name-redis-master:6379/0
- name: MONGO_URI
value: mongodb://release-name-mongodb:27017
- name: MIB_SOURCES
Expand Down
Loading