Notification using notify-html-email.sh

Hugo van der Kooij hvdkooij at vanderkooij.org
Sun Jul 27 09:39:57 CEST 2008


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

Jonathan Williams wrote:

| [1217000677] Warning: Attempting to execute the command
| "/usr/local/nagios/libexec/notify-html-email.sh service" resulted in a
| return code of 127.  Make sure the script or binary you are trying to
| execute actually exists...

Sounds like you rely on thing in this scripts that only work with a
proper environment. That is not what killed your script. But I suggest
you fix it nevertheless.

Like:
# Generate unique MIME Content-ID base for multipart message
CONTENTIDBASE="`date +%s`@`hostname --fqdn`"

This will not work if your PATH is not set properly. I suggest you
define DATECMD first to point to the full path of date and then use
$DATECMD instead if date in your script.


And its seems your commandline ignores to add the required notification
type so this check will always make it fail:

# Check for proper usage
[ $1 ] || {
	echo -e "notify-html-email.sh $VERISON\n\nHTML 4.0 notification for
Nagios 2.x\n\nUsage: notify-html-email <notification_type>\n\nOptions:"
	echo -e " notification_type\n    Must be 'host' or 'service' indicating
the type of notification\n"
	echo -e "This script should be called by a Nagios e-mail notification
command\nfrom /usr/local/nagios/etc/misccommands.cfg"
	echo -e "It uses the NAGIOS_* environmental variables to generate and
send an HTML\nmessage to the recipient.  The format of the e-mail is
customizable by\nediting the script.\n"
	exit -1
}

So now you know why you always get the given return code.

Hugo.

- --
hvdkooij at vanderkooij.org               http://hugo.vanderkooij.org/
PGP/GPG? Use: http://hugo.vanderkooij.org/0x58F19981.asc

	A: Yes.
	>Q: Are you sure?
	>>A: Because it reverses the logical flow of conversation.
	>>>Q: Why is top posting frowned upon?

Bored? Click on http://spamornot.org/ and rate those images.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)

iD8DBQFIjCZLBvzDRVjxmYERAt6HAKCOatnBauB6VWweiuL+n2aHrrSmdgCguaRS
xt1aXDst0Zd6gwOLk3ojdh0=
=lsJI
-----END PGP SIGNATURE-----

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list