Greetings,
I need help with creating generator.yml. My snmpwalk output is something like this:
INPUT: snmpwalk -v2c -c COMMUNITY IP.OF.SERVER 1.3.6.1.4.1.8072.1.3.2.3.1.2.18.99.111.117.114.105.101.114.105.109.97.112.100.97.101.109.111.110.115
OUTPUT: iso.3.6.1.4.1.8072.1.3.2.3.1.2.18.99.111.117.114.105.101.114.105.109.97.112.100.97.101.109.111.110.115 = STRING: "87"
generator.yml:
linux_CA:
walk:
- 1.3.6.1.4.1.8072.1.3.2.3.1.2.21.112.111.115.116.102.105.120.77.97.105.108.81.117.101.117.101.67.111.117.110.116
- 1.3.6.1.4.1.8072.1.3.2.3.1.2.18.99.111.117.114.105.101.114.105.109.97.112.100.97.101.109.111.110.115
version: 2
max_repetitions: 25
retries: 3
timeout: 10s
auth:
community: COMMUNITY
snmp.yml:
linux_CA:
get:
- 1.3.6.1.4.1.8072.1.3.2.3.1.2.18.99.111.117.114.105.101.114.105.109.97.112.100.97.101.109.111.110.115
- 1.3.6.1.4.1.8072.1.3.2.3.1.2.21.112.111.115.116.102.105.120.77.97.105.108.81.117.101.117.101.67.111.117.110.116
metrics:
- name: nsExtendOutputFull
oid: 1.3.6.1.4.1.8072.1.3.2.3.1.2
type: DisplayString
help: The full output from the command, as a single string - 1.3.6.1.4.1.8072.1.3.2.3.1.2
indexes:
- labelname: nsExtendToken
type: DisplayString
version: 2
max_repetitions: 25
retries: 3
timeout: 10s
auth:
community: COMMUNITY
So, in Prometheus when i expose metrics i get:
# HELP nsExtendOutputFull The full output from the command, as a single string - 1.3.6.1.4.1.8072.1.3.2.3.1.2
# TYPE nsExtendOutputFull gauge
nsExtendOutputFull{nsExtendOutputFull="139",nsExtendToken="postfixMailQueueCount"} 1
nsExtendOutputFull{nsExtendOutputFull="85",nsExtendToken="courierimapdaemons"} 1
# HELP snmp_scrape_duration_seconds Total SNMP time scrape took (walk and processing).
# TYPE snmp_scrape_duration_seconds gauge
snmp_scrape_duration_seconds 0.050516882
# HELP snmp_scrape_pdus_returned PDUs returned from walk.
# TYPE snmp_scrape_pdus_returned gauge
snmp_scrape_pdus_returned 2
# HELP snmp_scrape_walk_duration_seconds Time SNMP walk/bulkwalk took.
# TYPE snmp_scrape_walk_duration_seconds gauge
snmp_scrape_walk_duration_seconds 0.050449183
I apologize in advance if this is a beginner mistake but i got confused when constructing generator.yml file. The problem is in:
nsExtendOutputFull{nsExtendOutputFull="139",nsExtendToken="postfixMailQueueCount"} 1
I would like to get something like this:
nsExtendOutputFull{...} 139
So, value should be 139 and not 1. Thank you for your help!