Hi All,
snmp exporter (version=0.9.0)
Promethus: version 2.2.1
Ubuntu: 16:04 LTS
go version go1.6.2 linux/amd64
What is the correct way to monitor network devices with different community strings?
I'm trying to use different jobs to monitor network traffic on routers with different community strings. Configs are belows. The snmp job using the office_gateway module is working as expected,
however the second job, cores using the cores module returns the following error:
At present, this is all I need to monitor so snmp.yml has been created manually.
# snmp.yml
office_gateway:
version: 2
auth:
community: some-community
walk:
- 1.3.6.1.2.1.1.3 # sysUpTime
- 1.3.6.1.2.1.31.1 # ifHCInOctets
- 1.3.6.1.2.1.2.2.1.10 # ifInOctets
- 1.3.6.1.2.1.2.2.1.16
- 1.3.6.1.2.1.31.1.1.1
- name: ifHCInOctets
oid: 1.3.6.1.2.1.31.1.1.1.6
type: counter
indexes:
- labelname: interface
type: gauge
lookups:
- labels: [interface]
oid: 1.3.6.1.2.1.2.2.1.2
labelname: DisplayString
- labels: [interface]
oid: 1.3.6.1.2.1.31.1.1.1.18
labelname: alias
type: DisplayString
cores:
version: 2
auth:
community: a-different-community
walk:
- 1.3.6.1.2.1.1.3 # sysUpTime
- 1.3.6.1.2.1.31.1 # ifHCInOctets
- 1.3.6.1.2.1.2.2.1.10 # ifInOctets
- 1.3.6.1.2.1.2.2.1.16
- 1.3.6.1.2.1.31.1.1.1
metrics:
- name: ifHCInOctets
oid: 1.3.6.1.2.1.31.1.1.1.6
type: counter
indexes:
- labelname: interface
type: gauge
lookups:
- labels: [interface]
oid: 1.3.6.1.2.1.2.2.1.2
labelname: DisplayString
- labels: [interface]
oid: 1.3.6.1.2.1.31.1.1.1.18
labelname: alias
type: DisplayString
#prometheus.yml
- job_name: 'snmp'
scrape_interval: "10s"
metrics_path: /snmp
params:
module: [office_gateway]
static_configs:
- targets: ['192.168.100.254']
relabel_configs:
- source_labels: [__address__]
target_label: __param_target
- source_labels: [__param_target]
target_label: instance
- target_label: __address__
replacement: 192.168.0.245:9116
- job_name: 'cores'
scrape_interval: "10s"
metrics_path: /cores
params:
module: [cores]
static_configs:
- targets: ['192.168.0.61']
relabel_configs:
- source_labels: [__address__]
target_label: __param_target
- source_labels: [__param_target]
target_label: instance
- target_label: __address__
replacement: 192.168.0.245:9116