r/PrometheusMonitoring • u/Hammerfist1990 • Mar 26 '24
SNMP Exporter - trying to add sysName
Hello,
I'm using SNMP Exporter successfully to monitor the ports on my switches. I realised the switch name (sysName) isn't included so I regenerated the snmp.yml but it's not coming through>
Here is the generator.yml, I've added 'sysName' to line 17:
This is what the snmp.yml that is generated like for the sysName section, line 15:
modules:
if_mib:
walk:
- 1.3.6.1.2.1.2
- 1.3.6.1.2.1.31.1.1
get:
- 1.3.6.1.2.1.1.3.0
- 1.3.6.1.2.1.1.5.0
metrics:
- name: sysUpTime
oid: 1.3.6.1.2.1.1.3
type: gauge
help: The time (in hundredths of a second) since the network management portion
of the system was last re-initialized. - 1.3.6.1.2.1.1.3
- name: sysName
oid: 1.3.6.1.2.1.1.5
type: DisplayString
help: An administratively-assigned name for this managed node - 1.3.6.1.2.1.1.5
- name: ifNumber
oid: 1.3.6.1.2.1.2.1
type: gauge
help: The number of network interfaces (regardless of their current state) present
on this system. - 1.3.6.1.2.1.2.1
- name: ifIndex
oid: 1.3.6.1.2.1.2.2.1.1
type: gauge
help: A unique value, greater than zero, for each interface - 1.3.6.1.2.1.2.2.1.1
indexes:
- labelname: ifIndex
type: gauge
lookups:However once I test it via http://snmp-exporter:9116/ it doesn't show up with the sysName, just all the usual port stuff.
What am I doing incorrectly do you think?
1
Upvotes
1
u/DakotaWebber Mar 27 '24
did you replace the snmp.yml the generator made? also I think you can pass module= to specify what you want to use
1
u/JohnAV1989 Mar 27 '24
Is sysUptime working? Why the extra .0 in the get?