[Pkg-nagios-devel] Bug#598573: sa-check_spamd not working when called from nagios with embedded perl interpreter

Raphael Hertzog hertzog at debian.org
Thu Sep 30 08:06:36 UTC 2010


Package: spamassassin
Version: 3.3.1-1
Severity: important

Hi,

I'm trying to use sa-check_spamd on a nagios3 setup on squeeze. I have
this:

define command {
        command_name check_spamd
        command_line /usr/bin/sa-check_spamd -H '$HOSTADDRESS$'
}

define service {
        use                             generic-service
        service_description             Spamassassin daemon
        host_name                       localhost
        check_command                   check_spamd
}

And on the command line it works fine:
rhertzog at epice:~$ sudo -u nagios /usr/bin/sa-check_spamd -H '127.0.0.1'
SPAMD OK: 0.009 second ping repsonse time
rhertzog at epice:~$ echo $?
0
rhertzog at epice:~$ sudo su -s /bin/sh - nagios -c "/usr/bin/sa-check_spamd -H '127.0.0.1'"
SPAMD OK: 0.010 second ping repsonse time

But Nagios is unable to run the check, I always get:
(Service check did not exit properly)

Running nagios in debug mode I got this in the log:
[1285833235.239007] [016.1] [pid=11970] HOST: localhost, SERVICE: Spamassassin daemon, CHECKTYPE: Active, OPTIONS: 1, SCHEDULED: Yes, RESCHEDULE: Yes, EXITED OK: No, RETURN CODE: 3, OUTPUT: **ePN failed to compile /usr/bin/sa-check_spamd: "Variable "$VERSION" will not stay shar ed at (eval 1) line 293," at /usr/lib/nagios3/p1.pl line 161.\n

ePM hints at a problem related with nagios's embedded perl interpreter:
http://nagios.sourceforge.net/docs/3_0/embeddedperl.html

The documentation indicates that a script can indicate that it's not suited
for use with nagios' embedded perl by adding a line in the first 10 lines:
# nagios: -epn

I did this and it started working.

Please add this line as work-around in squeeze and report the problem
upstream. They might want to make the script embedded-perl friendly (or add the
same line if it's too difficult).

Cheers,
-- 
Raphaël Hertzog ◈ Debian Developer ◈ [Flattr=20693]

Follow my Debian News ▶ http://RaphaelHertzog.com (English)
                      ▶ http://RaphaelHertzog.fr (Français)





More information about the Pkg-nagios-devel mailing list