all notifications failing

Thomas Guyot-Sionnest dermoth at aei.ca
Sat Apr 17 05:37:59 CEST 2010


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

On 16/04/10 09:49 AM, Scott, Ewan wrote:
> Hi
> 
>  [...]
> 
> # su - nagios
> 
> $ /usr/bin/printf "%b" "***** Nagios *****\nNotification " |
> /usr/bin/mail -s "** $NOTIFICATIONTYPE$ Service Alert: 
> $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" ewscott at scotborders.gov.uk
> 
> mail: Cannot open temporary file: Permission denied
> 
> Cannot open temporary file

Use strace to find out what fails. strace will print all syscalls used
by the traced program and wou will see which one (including parameters)
failed.


Don't forget to trace the mail program, not printf. i.e.:

> $/usr/bin/printf "%b" "***** Nagios *****\nNotification " | strace
> /usr/bin/mail -s "** $NOTIFICATIONTYPE$ Service Alert:
> $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **"
ewscott at scotborders.gov.uk 2>/tmp/mail_trace.log


Here I added "strace" before "/usr/bin/mail" and redirected stderr to
"/tmp/mail_trace.log". Then you can look at "/tmp/mail_trace.log" for
something like a failed open() call or for ENOPERM. The argument to the
failed call should indicate which file failed.


- --
Thomas
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFLyS0X6dZ+Kt5BchYRAgeuAJ46zQNJ+mdWLj94agD1qihi/pvZ1QCdGvlj
gUs8215gRrSW21kl3wDq9CY=
=o+AZ
-----END PGP SIGNATURE-----

------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
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