Faq-url
From NagiosSNMP
FIRST, look at the web page associated with every script.
Running the scripts
The scripts outputs "Can't locate Net/SNMP.pm in @INC....."
You don't have Net::SNMP installed, see below
How do I install Net::SNMP perl module
There are 2 ways of doing this
- By CPAN (best)
on command line, as root :
[your_host]# perl -MCPAN -e shell cpan shell -- CPAN exploration and modules installation (v1.76) ReadLine support enabled cpan> install Net::SNMP
If it's the first time you run CPAN, it will probably ask you some (simple) questions.
CPAN will also ask you to satisfy some dependencies (Crypt::DES, Digest::MD5, etc..).
- "By hand"
Get the folowings modules (tar.gz format) on www.cpan.org
- Crypt::DES - Digest::MD5 - Digest::SHA1 - Digest::HMAC - Net::SNMP
for each one (you must install Net::SNMP at the end) : tar zxf <module>.tar.gz cd <module> perl Makefile.pl make test make install
What are the supported platforms to run the scripts on ?
Most Linux, maybe some unixes and maybe Cygwin. Actually anything you can run perl on. If you can install the latest Net::SNMP module, then the perl version should be OK.
How do I get help on the options ?
Just run <script> -h on the command line.
Return code of X is out of bounds
Have a look at : http://www.nagios.org/faqs/viewfaq.php?faq_id=17
In case of return code 127, try putting perl in the command line definition :
define command{ command_name check_disk command_line /usr/bin/perl $USER1$/check_snmp_storage.pl -C $ARG1$ [........] }
Are these plugins compatible with Nagios 2.X / 3.X ?
Yes.
ERROR: XXXXXX : Expected OBJECT IDENTIFIER in dotted notation.
Upgrade your Net::SNMP module version (5 is good, 4 maybe OK, 3 gives this error) This happens with Debian Woody (Net::SNMP version 3.6). I have special patches if you can't upgrade : contact me.
"No Output" using Nagios 2
It's a "bug" of embeded perl. It has been corrected in latest Nagios releases.
You can :
- Add a patch if your nagios release is old. Here is a patch made by Gavin Carr for the p1.pl file to correct this (it should be in nagios CVS shortly). http://nagios.manubulon.com/p1-print.pl.patch
- Upgrade Nagios.
- add "/usr/bin/perl" before the script command so Nagios won't use embeded perl.
Getting : "ERROR: Size table :Message size exceeded buffer maxMsgSize"
Your snmp table is too big.
Some of my scripts (check_snmp_storage and check_snmp_process) now have an option (-o) to set this directly on command line (thx to Makina Corpus for the patch).
In other scripts, try adding :
$session->max_msg_size(5000);
No usable data on file (X rows)
Scripts like check_snmp_int need to store data when they get a SNMP counter so they can outpout readable data like bandwidth, cpu, etc....
For example, to output a bandwidth with an octet counter, check_snmp_int will store data every time it is run. It will also read the previous data, and try to get data old enough to make a correct average. By default, it needs data which was produced 5 minutes ago.
So, when you first run the script - or if you run it a long time ago -, it won't be able to get data old enough and will report an error (UNKNOWN status) saying the is "no usable data on file (X rows)". If you leave the 5 minutes default delta value, the script will need data wich is : - At least 4 minutes and 30 seconds old (5 min - 10%) - At most 15 minutes old (3 * 5 min)
You can change this 5 minutes value using the '-d <sec>' option. The script will then look for data which is at least <sec>-10% old and at most 3*<sec>.
This option will only tell to make an average on <sec> seconds, you can run the service every minute with Nagios, it will always get the newest value which is at least <sec>-10% old. The only thing you must check is that your service will at least run every 15 minutes, or the script will always output "unknown" as the value will be too old for him.
Perfdata produce errors when parsed
Scripts like check_snmp_int place the labels in the perfdata between quote when there are one or more spaces inside as specified in the plugin devlopment guideline as well as a separator spaces between each pair label/value.
It can happen that your perfdata are not integrated correctly by your parser because Nagios removes the quote in the perfdata that they return to the parser.
At this time the parser cannot differentiate the pairs label/value any more.
To correct this problem just check quite simply that the quotes do not make part of illegal macro output characters.
Illegal Macro Output Characters : `~$^&"|<>' BAD
Illegal Macro Output Characters : `~$^&"|<> GOOD !
Misc
Are these scripts secure ?
Not at all ! You must secure the Nagios server. Nobody else than the nagios user should be allowed to even think about running these scripts.
How can I get help ? Is there a mailling list ? a forum ?
Go to the sourceforge project page for all this : nagios-snmp

