prometheus-snmp-exporter
Prometheus SNMP Exporter
About this chart
Prometheus SNMP Exporter
An Prometheus exporter that exposes information gathered from SNMP.
This chart creates a SNMP Exporter deployment on a Kubernetes cluster using the Helm package manager.
Prerequisites
- Kubernetes 1.8+ with Beta APIs enabled
Usage
The chart is distributed as an OCI Artifact as well as via a traditional Helm Repository.
- OCI Artifact:
oci://ghcr.io/prometheus-community/charts/prometheus-snmp-exporter - Helm Repository:
https://prometheus-community.github.io/helm-chartswith chartprometheus-snmp-exporter
The installation instructions use the OCI registry. Refer to the [helm repo](helm repo) command documentation for information on installing charts via the traditional repository.
Install Chart
helm install [RELEASE_NAME] oci://ghcr.io/prometheus-community/charts/prometheus-snmp-exporter
See configuration below.
See helm install for command documentation.
Uninstall Chart
helm uninstall [RELEASE_NAME]
This removes all the Kubernetes components associated with the chart and deletes the release.
See helm uninstall for command documentation.
Upgrading Chart
helm upgrade [RELEASE_NAME] [CHART] --install
See helm upgrade for command documentation.
Upgrading an existing Release to a new major version
A major chart version change (like v1.2.3 -> v2.0.0) indicates that there is an incompatible breaking change needing manual actions.
To 1.0.0
This version allows multiple Targets to be specified when using ServiceMonitor. When you use ServiceMonitor, please rewrite below:
serviceMonitor:
enabled: true
params:
enabled: true
conf:
module:
- if_mib
target:
- 127.0.0.1
to this:
serviceMonitor:
enabled: true
params:
- module:
- if_mib
name: device1
target: 127.0.0.1
To 2.0.0
This version changes the serviceMonitor.namespace value from monitoring to the namespace the release is deployed to.
To 3.0.0
This version upgrades snmp-exporter version to 0.24.1, which introduces breaking change to configuration format. See Module and Auth Split Migration for more details.
To 4.0.0
This version contain major changes & The configmap-reload container was replaced by the prometheus-config-reloader.
To 5.0.0
This version changes the default image repository from using DockerHub to Quay.
To 6.0.0
This version changes the default health check path from /health to /
To 7.0.0
This version changes the sysUpTime metric by removing from the if_mib module and including it as part of the new system module, along with other useful system related metrics. Update your scrape definitions to include the system module if you need sysUpTime.
To 8.0.0
This version changes the additional metrics values to always be a string.
To 9.0.0
This version adds ability to enable config-reloader on demand, also to specify custom --watched-dir and ability to mount snmp-exporter pods extraVolumeMounts for consistency of mounted configs.
Configuration
See Customizing the Chart Before Installing. To see all configurable options with detailed comments, visit the chart's values.yaml, or run these configuration commands:
# Helm 2
$ helm inspect values oci://ghcr.io/prometheus-community/charts/prometheus-snmp-exporter
# Helm 3
$ helm show values oci://ghcr.io/prometheus-community/charts/prometheus-snmp-exporter
See prometheus/snmp_exporter/README.md for further information.
Prometheus Configuration
The snmp exporter needs to be passed the address as a parameter, this can be done with relabelling.
Example config:
scrape_configs:
- job_name: 'snmp'
static_configs:
- targets:
- 192.168.1.2 # SNMP device.
metrics_path: /snmp
params:
module: [if_mib]
relabel_configs:
- source_labels: [__address__]
target_label: __param_target
- source_labels: [__param_target]
target_label: instance
- target_label: __address__
replacement: my-service-name:9116 # The SNMP exporter's Service name and port.
Example configuration via a ServiceMonitor
serviceMonitor:
enabled: true
relabelings:
- sourceLabels: [__param_target]
targetLabel: instance
params:
- module:
- fortigate_snmp
name: device1
target: 192.168.1.2 # SNMP device
Deploy prometheus-snmp-exporter with OpenTenant
Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has prometheus-snmp-exporter on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.
- Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
- Place the chartprometheus-snmp-exporter is pinned at v9.21.1 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
- ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below opentenant validate opentenant.yaml terraform init && terraform apply