persistent storage for checks Monitoring::Plugin

Florian Lohoff f at
Thu Jan 23 11:59:51 CET 2014

is there a way for persistent storage in the checks?

I wrote myself an interface check plugin which gets an
interface name as input and looks through the ifName/ifDescr
table to find its oid.

Now i am caching the result that do not need to do the walk
again on every invocation.

I do verify that the name still matches.

So if i dont have a cache file i do

	snmpwalk ifName ifDescr
	snmpget ifInOctets ifOutOctets ifName ifDescr
	write cachefile

The next invocation i do

	read cachefile
	snmpget ifInOctets ifOutOctets ifName IfDescr
	check if ifName ifDescr still matches
		if not do walk again

Currently i simply create a directory and i drop my cache files
somewhere in /var/lib/nagios3/run something but i think it'll be
a good idea to formalize the way to do persistent storage
via Monitoring::Plugin

Florian Lohoff                                                 f at
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 828 bytes
Desc: Digital signature
URL: <>

More information about the Devel mailing list