Hi Friends,
In this post I will talk about solving perl plugin related issue. Sometimes we are facing issue when we are creating plugin for nagios in perl language. Sometimes what happens we executing plugin on command prompt then it is working fine and giving properl result but when we are deploying that plugin in to production nagios environment then we are getting error in output.
If we are getting following error in nagios then
(Service Check did not exit properly)
Add following lines in to beginning of the your perl script.
########################################################
use strict;
require 5.6.0;
use lib qw( /usr/lib/nagios/plugins );
use utils qw(%ERRORS $TIMEOUT &print_revision &support &usage);
############################################################################
19 comments:
It worked. Thanks very much
Welcome :)
you can ask any linux or scripting related issues in comment as well as can mail me.
my id is given in my blog.
Hi Shankar,
Can you explain why this should work?
I'm developing a plugin now, but can't get it to work.
For debugging the plugin I use capture_plugin.pl (downloaded from http://www.waggy.at/nagios/capture_plugin.htm). As long as I use capture_plugin.pl everything works just fine. If I let nagios invoke my plugin directly (without using capture_plugin.pl) I get the message (Service check did not exit properly).
Forgot to say, the fix you posted doesn't work for me.
let me know path of plugin directory
if possible send your plugin to me
Hi Shankar,
My plugin is located in /etc/nagios3/plugins (on a Debian 6 package installed environment).
have you adapted the it as per solution as below?
use lib qw( /usr/lib/nagios/plugins );
Yes, I did.
Forgot to mention that I commented the line "use utils qw(%ERRORS $TIMEOUT &print_revision &support &usage);" since it spawned this error:
Can't locate utils.pm in @INC (@INC contains: /etc/nagios3/plugins /etc/perl /usr/local/lib/perl/5.10.1 /usr/local/share/perl/5.10.1 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.10 /usr/share/perl/5.10 /usr/local/lib/site_perl .) at /etc/nagios3/plugins/check_urls.pl line 7.
Kindly send me plugin I will check and let you know. where is the problem.
I can't seem to find any way to message you. How would you suggest I send the plugin?
sankar.h.patel@gmail.com is my email id you can find it in my blog as well
Hey Shankar i need help and sent you a email.
hello i have a problem i am setting nagios memcached plugin but it gives me service check did not check properly error i dont what i have to do plzz update me asap.
In that case please use the given solution and if not works for you send me plugin and your config files
my plugins are stored in /usr/lib/nagios/plugins
i sent you a email.Please help me ASAP.
Replied please check your mail
Again I sent you a mail.Please check
Only i want is check_memcached nagios plugin i want to monitor memcache by nagios.Please check the mail.
It worked. Thanks very much
Post a Comment