Service check did not exit properly from nagios plugin in perl

i’m setting up v6 on a few internet-facing servers. i’ve googled a bit and found dual-stack ipv4+ipv6 monitoring with nagios. i’ve started using the wrapper script check_v46 referred there and it works nicely. but i’ve run into a problem – execution of plugin gave me:

Status Information:	(Service check did not exit properly)

after enabling verbose logging [ debug_level=-1 and debug_file=/var/lib/nagios3/nagios.debug ] i’ve got:

[1406016950.094013] [2048.1] [pid=19525] **** BEGIN MACRO PROCESSING ***********
[1406016950.094021] [2048.1] [pid=19525] Processing: '/usr/local/nagios/check_v46 /usr/lib/nagios/plugins/check_http -H '$ARG1$' -w '$ARG2$' -c '$ARG3$''
[1406016950.094041] [2048.1] [pid=19525]   Done.  Final output: '/usr/local/nagios/check_v46 /usr/lib/nagios/plugins/check_http -H 'my.host.com' -w '10' -c '100000''
[1406016950.094048] [2048.1] [pid=19525] **** END MACRO PROCESSING *************
[1406016950.094054] [064.1] [pid=19525] Making callbacks (type 13)...
[1406016950.094109] [016.1] [pid=19525] Check result output will be written to '/var/lib/nagios3/spool/checkresults/checkAR8UWL' (fd=7)
[1406016950.094236] [016.1] [pid=19525] ** Using Embedded Perl interpreter to run service check...
[1406016950.124038] [016.0] [pid=19525] Embedded Perl failed to compile /usr/local/nagios/check_v46, compile error **ePN failed to compile /usr/local/nagios/check_v46: "Variable "%opts" will not stay shared at (eval 1) line 315," at /usr/lib/nagios3/p1.pl line 250.
 - skipping plugin
[1406016950.124304] [001.0] [pid=19525] handle_timed_event() end
[1406016950.124320] [008.1] [pid=19525] ** Event Check Loop

ok – that’s something to google for. i’ve found this.

at this stage i don’t feel like diving into the perl code – so i’ve just changed my check definition from:

define command{
        command_name    check_httpv46
        command_line    /usr/local/nagios/check_v46 /usr/lib/nagios/plugins/check_http -H $ARG1$ -w $ARG2$ -c $ARG3$
}

to:

define command{
        command_name    check_httpv46
        command_line    /usr/bin/perl /usr/local/nagios/check_v46 /usr/lib/nagios/plugins/check_http -H $ARG1$ -w $ARG2$ -c $ARG3$
}

Leave a Reply

Your email address will not be published. Required fields are marked *

(Spamcheck Enabled)