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

You can monitor lots of different data points about a Linux system using SNMP, if you pick the correct MIB numbers (e.g. like .1.3.6.1.4.1.2021.9.1.2.1 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)?

share|improve this question

2 Answers 2

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).

share|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 .1.3.6.1.4.1.2021.8

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.

share|improve this answer

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.