Home

Plugins in C
Last update : Jun 9 2007

Description :

Three scripts have been rewriten in C : check_snmp_int, check_snmp_process, check_snmp_storage

New features in the C plugins :
- Cache management : the SNMP queries for index search, which are often the biggest ones, can now be cached on disk. Speed gain from this can be up to 10 times on big switches using snmp_int.
- Support for other languages (for now only french po file has been done)

Perl and C plugins have exactly the same options (except -K added in the C plugins), so you can use the same help pages.

download version 0.6.0

How to install :

Requirements to compile : net-snmp-devel

As a non-priviledge user, run ./configure scripts with following arguments :

--prefix=<DIR> [ default : /usr/local/nagios/ ] : Intallation directory. The plugins will go in <DIR>/libexec and the language files in <DIR>/share/locale/...
--with-basetmpdir=<DIR> [default=/tmp] : Where the plugins will put temporary files if needed. Not all the plugins will store temporary files.
--with-cachedir=<DIR> [default=[basetmpdir]/cache] Where the plugins will put cache files with snmp index

Then run :
make

Then, as root :
make install

To create the basetmpdir and cachedir if they don't exist, you can run :
make install-tmp
or create the two directories by hand with nagios user as owner or 777 mode.

That's all !

Details on the caching option

With the new C plugins, you can cache SNMP index queries.

Each time you run a script, it gets all the index table of what you are looking for (interface, storage, etc...).

This can be really big requests for example if you have a core LAN switch with 80 interfaces. As the interface index don't change very often, I added a caching of these queries so the only thing the script does to select an interface is read the cache file on disk.
Also, if you have more than one service on this host, every script (checking the same type of data) will be able to read this file.

All you have to do is put the '-K' option, with the default time validity of the cache file in minutes. The default time to live is 15 minutes, meaning that the index will be read every 15 minutes only.

If you have several services doing the same types of checks on the same host, the index will still be read once only within these 15 minutes.

This project is hosted on : http://sourceforge.net/projects/nagios-snmp Nagios and the Nagios logo are registered trademarks of Ethan Galstad.