I'm trying to configure snmpd on my CentOS hosts to monitor the free disk usage in percent.
If I set snmpd.conf to
disk /
disk /var
, the values can be queries with
1.3.6.1.4.1.2021.9.1.1.1 for "/" and
1.3.6.1.4.1.2021.9.1.1.2 for "/var".
I have several servers which don't have a separate "/var" partition. So the disk layout isn't standardized. I figured out, that the disk statement order in snmpd.conf dictates the dskIndex number of the snmp query result. So if I would flip "/" and "/var", "/" would have dskIndex 2.
In my monitoring system, I would have to configure each OID for each server separately because they might be different. So the idea is to have placeholders for non-existing filesystems.
Is it possible to either have placeholders to artificially count the dskIndex up or to somehow influence the dskIndex manually in snmpd.conf?
Thanks in advance
I don't know how to change dskIndex manually but snmpd use the order define in the snmpd.conf file , so it's predictable.
If you look for an other solution read above :
snmpd provide information about the disk index , if you poll the oid : 1.3.6.1.2.1.25.2.3.1.3 the system will return list of disk available , example:
the last digit is the index , so you can request size of the / partition like this :
I don't know which monitoring system you use but read this script check_snmp_storage.pl, the perl script retrieve the index table with SNMP and request only the good OID. It work for nagios maybe you can adapt it for an other system.