You can monitor lots of different data points about a Linux system using SNMP, if you pick the correct MIB numbers (e.g. like . on http://www.debianhelp.co.uk/linuxoids.htm).

Where is the code for each MIB test stored on a Linux machine?

Is it possible to add your own custom tests? (e.g. when a custom MIB is queried, run a python script and return the response)?


The location is probably dependent on your distribution; on Debian they live under /usr/share/snmp/mibs. In addition to Antoine's answer on simple exec plugins for net-snmpd, you can also write more complicated plugins for net-snmpd that integrate more seamlessly; I've also written my own Ruby SNMP agent which is designed to make it trivial to handle custom SNMP data (it's the whole reason for it's existence).

| improve this answer | |

I don't know where the MIB is stored on a Linux machine but you can add the result of scripts in the default MIB by using the following syntax :

exec railsversion "/bin/bash /etc/snmp/railsversion.sh"

It will show up in your MIB which you can test by using the following command.

snmpwalk -v 1 -c public localhost .

This is pretty well documented in the snmpd.conf file found in Debian and probably other distros.

I find this option very useful as it eliminates the need for a specific monitoring agent.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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