[Nagiosplug-help] check_squid.pl cannot run in Nagios ; works from the CLI

J4 junk4 at klunky.co.uk
Thu Dec 10 10:12:19 CET 2009


Hi,

I added this to the commands.cfg

# 'check_squid' command definition
define command{
        command_name    check_squid
        command_line    $USER1$/check_squid.pl -u http://www.google.com
-p 10.206.2.131 -l 8080 -e200  2>&1
        }

...and restarted Nagios.

Status now o/ps something more interesting ; Thank-you once more Mark.
Can't locate utils.pm in @INC (@INC contains: /usr/lib/nagios/plugins
/etc/perl /usr/local/lib/perl/5.10.0 /usr/local/share/perl/5.10.0
/usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.10 /usr/share/perl/5.10
/usr/local/lib/site_perl .) at /usr/local/nagios/libexec/check_squid.pl
line 21.

The pm files are in the right place:
# ls -l /usr/local/nagios/libexec/*.pm
-rw-r--r-- 1 nagios nagios 2047 2009-12-09 12:06
/usr/local/nagios/libexec/libplugins.pm
-rwxr-xr-x 1 nagios nagios 2055 2009-12-09 11:37
/usr/local/nagios/libexec/utils.pm

I googled a little and note this is a common problem. I read many
threads about it but none that provided a solution that I could follow.

J.
Marc Powell wrote:
> On Dec 9, 2009, at 2:35 PM, JKL wrote:
>
>   
>>> I have the same result when run as Nagios.
>>>
>>> nagios at abc1234:/usr/local/nagios/libexec$ ./check_squid.pl -u
>>> http://www.google.com -p fredprox -l 8080 -e200
>>> OK - Status: 200 OK
>>>       
>
> Then I'm even more confident that you need to specify the FQDN or IP for fredprox in the command{} definition instead of just the hostname 'fredprox'.
>
>   
>>> Here it is with 2>&1
>>> nagios at abc1234:/usr/local/nagios/libexec$ ./check_squid.pl -u
>>> http://www.google.com -p 10.206.2.131 -l 8080 -e200  2>&1
>>> OK - Status: 200 OK
>>>       
>
> My intention was that you would add the ' 2>&1' to the command_line in the command definition. That will capture any output being sent to STDERR when nagios runs the plugin and you will see it in the logs and web interface.
>
> --
> Marc
>
>
> ------------------------------------------------------------------------------
> Return on Information:
> Google Enterprise Search pays you back
> Get the facts.
> http://p.sf.net/sfu/google-dev2dev
> _______________________________________________
> Nagiosplug-help mailing list
> Nagiosplug-help at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/nagiosplug-help
> ::: Please include plugins version (-v) and OS when reporting any issue. 
> ::: Messages without supporting info will risk being sent to /dev/null
>   





More information about the Help mailing list