Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

share|improve this question

1 Answer 1

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.

share|improve this answer
    
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 '13 at 9:04

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.