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

J4 junk4 at klunky.co.uk
Wed Dec 9 14:49:12 CET 2009


Hi,

    I have just installed Nagios on a new system for testing purposes. 
I have downloaded a plugin and copied it into
/usr/local/nagios/libexec/check_squid.pl

The script is available from here: 
http://exchange.nagios.org/directory/Plugins/Websites%2C-Forms-and-Transactions/Squid-Web-Proxy/details
Or from tinyURL:  http://tinyurl.com/yzt8g2o

I have created a service:
define service{
        use                             remote-service         ; Name of
service template to use
        host_name                       fredprox
        service_description             SQUID
        check_command                   check_squid
        notifications_enabled           0
        }


I have created a command:
# 'check_squid' command definition
define command{
        command_name    check_squid
        command_line    $USER1$/check_squid.pl -u http://www.google.com
-p fredprox -l 8080 -e200
        }



If I run the script from the command line I have:
# ./check_squid.pl -u http://www.google.com -p fredprox -l 8080 -e200
OK - Status: 200 OK


However, using it from within Nagios causes the error:[1260361223]
EXTERNAL COMMAND: ENABLE_HOST_SVC_CHECKS;demeter
[1260361245] EXTERNAL COMMAND:
SCHEDULE_FORCED_SVC_CHECK;demeter;SQUID;1260361244
[1260361253] SERVICE ALERT: demeter;SQUID;CRITICAL;SOFT;1;(null)
[1260361287] EXTERNAL COMMAND: ENABLE_SVC_NOTIFICATIONS;demeter;SQUID
[1260361295] EXTERNAL COMMAND: ENABLE_SVC_NOTIFICATIONS;demeter;SQUID
[1260361309] EXTERNAL COMMAND: ENABLE_SVC_NOTIFICATIONS;demeter;SSH
[1260361313] SERVICE ALERT: demeter;SQUID;CRITICAL;SOFT;2;(null)
[1260361373] SERVICE ALERT: demeter;SQUID;CRITICAL;SOFT;3;(null)
[1260361433] SERVICE ALERT: demeter;SQUID;CRITICAL;HARD;4;(null)
[1260361433] SERVICE NOTIFICATION:
nagiosadmin;demeter;SQUID;CRITICAL;notify-service-by-email;(null)


I have set debugging to 128, but nagios.debug is empty.

I expect that I do not have a clear understanding (or any understanding)
of the plugins, and find the documentation bewildering, to be frank :(

Perhaps, it has something to do with the $USER1$ specification in the
command, but I could not find any documentation about this and what it
was used for.

Does anyone have any advise, or even the answers?

Best regards, J.




More information about the Help mailing list