Problem getting notificiations to execute

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I wrote this perl script that handles notifications for me and takes the
output and hostname and other things as variables; but for some reason the
strings are getting all broken up (ie, some thing like “OK -
Packet:loss:=:0%,:RTA:=:0.17:ms” is being broken up at every space). I’ll
paste below relevant parts of config.

== misccommands.cfg ==

‘notify-by-automated’ command definition

define command {
command_name notify-by-automated
command_line /usr/local/nagios/bin/machineadmins -H $HOSTNAME$ -N
$NOTIFICATIONTYPE$ -S $SERVICESTATE$ -A $HOSTADDRESS$ -O “$OUTPUT$” -D
"$DATETIME$" -s “$SERVICEDESC$”
}

‘host-notify-by-automated’ command definition

define command {
command_name host-notify-by-automated
command_line /usr/local/nagios/bin/machineadmins -H $HOSTNAME$ -N
$NOTIFICATIONTYPE$ -S $HOSTSTATE$ -A $HOSTADDRESS$ -O “$OUTPUT$” -D
"$DATETIME$" -h
}

== join(":", @ARGV) inside perl script ==

  • -H:billmax2.int.pa.net:-N:PROBLEM:-S:CRITICAL:-A:billmax2.int.pa.net:-O:‘CRITICAL:-:Plugin:timed:out:after:10:seconds’:-D:‘Thu:Jun:6:16:26:49:EDT:2002’:-s:‘PING’
  • -H:billmax2.int.pa.net:-N:RECOVERY:-S:OK:-A:billmax2.int.pa.net:-O:PING:OK:-:Packet:loss:=:0%,:RTA:=:0.17:ms:-D:Thu:Jun:6:16:29:48:EDT:2002:-s:PING

== usage() from perl script ==
== machineadmins 0.1.0 ==
usage:
machineadmins -H -N <notification_type> -S
-A -O -D <date_time> (-s |-h)


Douglas E. Warner dwarner@ctinetworks.com Network Engineer
CTI/PAdotNET http://www.pa.net +1 717 975 9000
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE8/8hyJV36su0A0xIRAjO5AKDygPg9IkJmmHsq4++OzIlAYqzjMwCfV/f8
Ut8LatXNZZ8ow5q8tLk24L8=
=rhU5
-----END PGP SIGNATURE-----

I wrote this perl script that handles notifications for me and takes the
output and hostname and other things as variables; but for some reason the
strings are getting all broken up (ie, some thing like “OK -
Packet:loss:=:0%,:RTA:=:0.17:ms” is being broken up at every space). I’ll
paste below relevant parts of config.

It looks like something is eating the quotes in the command_line
section, otherwise -O:CRITICAL:-:Plugin:timed:out:after:10:seconds’'
would be -O:‘CRITICAL - Plugin timed out after 10 seconds’. Since you
are joining @ARGV on “:”, it looks like the shell (or whatever it is)
that is populating argv is Doing The Wrong Thing.

Forgive me if this is obvious to everyone but me, but what is the
command for which the “define command { }” config files are relevant,
and how is it being invoked?

(darren)

Doubt isn’t the opposite of faith; it is an element of faith.
– Paul Tillich, German theologian.

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Forgive me if this is obvious to everyone but me, but what is the
command for which the “define command { }” config files are relevant,
and how is it being invoked?

(darren)

Incredibly sorry; this was posted to the wrong mail list. Bad KMail. BAD.

  • -Doug

Douglas E. Warner dwarner@ctinetworks.com Network Engineer
CTI/PAdotNET http://www.pa.net +1 717 975 9000
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE9A1vgJV36su0A0xIRArz+AKCiSeDP8MQkSVq5BoK8rvUiXmxrDgCfRkx9
eEHhkvii4evFgkqDXgg7QA8=
=VC4L
-----END PGP SIGNATURE-----