2

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

1 Answer 1

0

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:

$ snmpwalk -v 2c -c public 127.0.0.1 1.3.6.1.2.1.25.2.3.1.3
iso.3.6.1.2.1.25.2.3.1.3.1 = STRING: "Physical memory"
iso.3.6.1.2.1.25.2.3.1.3.3 = STRING: "Virtual memory"
iso.3.6.1.2.1.25.2.3.1.3.6 = STRING: "Memory buffers"
iso.3.6.1.2.1.25.2.3.1.3.7 = STRING: "Cached memory"
iso.3.6.1.2.1.25.2.3.1.3.8 = STRING: "Shared memory"
iso.3.6.1.2.1.25.2.3.1.3.10 = STRING: "Swap space"
iso.3.6.1.2.1.25.2.3.1.3.31 = STRING: "/"
iso.3.6.1.2.1.25.2.3.1.3.32 = STRING: "/sys/fs/fuse/connections"
iso.3.6.1.2.1.25.2.3.1.3.33 = STRING: "/dev"
iso.3.6.1.2.1.25.2.3.1.3.35 = STRING: "/media/KINGSTON"

the last digit is the index , so you can request size of the / partition like this :

snmpwalk -v 2c -c public 127.0.0.1 1.3.6.1.2.1.25.2.3.1.5.31
iso.3.6.1.2.1.25.2.3.1.5.31 = INTEGER: 37458759

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.

1
  • I'm using Whatsup v16. I know the index number is predictable, but to not have to configure a monitor per partition and server, I need to be able to define it manually.
    – zero_r
    Aug 12, 2013 at 9:04

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .