Re: [Nagios-users] all notifications failing

2010-04-19 Thread Scott, Ewan
Problem was indeed with the /tmp directory permissions. Reset this back to 
drwxrwxrwt and mail notifications work again. 
Thanks to Patrick and Thomas for the pointers.
Regards
Ewan

-Original Message-
From: Thomas Guyot-Sionnest [mailto:derm...@aei.ca] 
Sent: 17 April 2010 04:38
To: Nagios Users List
Subject: Re: [Nagios-users] all notifications failing

-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$ ** ewsc...@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$ **
ewsc...@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#174; 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@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

**
This email and any files transmitted with it are privileged, confidential and 
subject to copyright. Any unauthorised use or disclosure of any part of this 
email is prohibited. If you are not the intended recipient please inform the 
sender immediately; you should then delete the email and remove any copies from 
your system.
The views or opinions expressed in this communication may not necessarily be 
those of Scottish Borders Council.
Please be advised that Scottish Borders Council's incoming and outgoing email 
is subject to regular monitoring and any email may require to be disclosed by 
the Council under the provisions of the Freedom of Information (Scotland) Act 
2002.

**


--
Download Intel#174; 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@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


[Nagios-users] all notifications failing

2010-04-16 Thread Scott, Ewan
Hi

All my notifications are failing - no emails are being generated. Can someone 
confirm that it is the nagios user which sends the emails and not root. If this 
is the case then I seem to have created a file permissions problem on the 
system somehow and the nagios user cannot send mail. (This used to work until I 
installed php5-cli and ran a notifications script I picked up on 
exchange.nagios.org).

Although it is not really a nagios issue if anyone knows what the temporary 
file is that it is trying to open - see below - please let me know. (The same 
issue occurs for other non-root users sending mail).

Thanks.
Ewan

# id
uid=0(root) gid=0(root) groups=0(root)
# /usr/bin/printf %b * Nagios *\nNotification  | /usr/bin/mail -s 
** $NOTIFICATIONTYPE$ Service Alert:  $HOSTALIAS$/$SERVICEDESC$ is 
$SERVICESTATE$ ** ewsc...@scotborders.gov.uk
# ### This has sent mail successfully.
#
# su - nagios
$ /usr/bin/printf %b * Nagios *\nNotification  | /usr/bin/mail -s 
** $NOTIFICATIONTYPE$ Service Alert:  $HOSTALIAS$/$SERVICEDESC$ is 
$SERVICESTATE$ ** ewsc...@scotborders.gov.uk
mail: Cannot open temporary file: Permission denied
Cannot open temporary file

System info:
# uname -a
Linux sbc-nagios-01 2.6.31-20-server #58-Ubuntu SMP Fri Mar 12 05:40:05 UTC 
2010 x86_64 GNU/Linux
# ### nagios 3.2.0
# dpkg --list | egrep mailutil
ii  libmailutils21:2.0+dfsg1-2  
GNU Mail abstraction library
ii  mailutils1:2.0+dfsg1-2  
GNU mailutils utilities for handling mail
#





Ewan Scott
Technical Officer
Servers and Storage
Business  Technology Solutions
Scottish Borders Council
Council Headquarters
Newtown St Boswells
Melrose
TD6 0SA

01835 824000 ext 5374

ewsc...@scotborders.gov.ukmailto:ewsc...@scotborders.gov.uk
http://www.scotborders.gov.uk blocked::http://www.scotborders.gov.ukĀ /


**
This email and any files transmitted with it are privileged, confidential and 
subject to copyright. Any unauthorised use or disclosure of any part of this 
email is prohibited. If you are not the intended recipient please inform the 
sender immediately; you should then delete the email and remove any copies from 
your system.
The views or opinions expressed in this communication may not necessarily be 
those of Scottish Borders Council.
Please be advised that Scottish Borders Council's incoming and outgoing email 
is subject to regular monitoring and any email may require to be disclosed by 
the Council under the provisions of the Freedom of Information (Scotland) Act 
2002.

**

--
Download Intel#174; 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@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

Re: [Nagios-users] all notifications failing

2010-04-16 Thread Morris, Patrick
Scott, Ewan wrote:

 Hi

  

 All my notifications are failing - no emails are being generated. Can 
 someone confirm that it is the *nagios* user which sends the emails 
 and not *root*. If this is the case then I seem to have created a file 
 permissions problem on the system somehow and the nagios user cannot 
 send mail. (This used to work until I installed *php5-cli* and ran a 
 *notifications* script I picked up on exchange.nagios.org). 

Mail will be sent as the user Nagios runs under.

  Although it is not really a nagios issue if anyone knows what the 
 temporary file is that it is trying to open - see below - please let 
 me know. (The same issue occurs for other non-root users sending mail).

  

 Thanks.

 Ewan

  

 # id

 uid=0(root) gid=0(root) groups=0(root)

 # /usr/bin/printf %b * Nagios *\nNotification  | 
 /usr/bin/mail -s ** $NOTIFICATIONTYPE$ Service Alert:  
 $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ ** ewsc...@scotborders.gov.uk

 # ### This has sent mail successfully.

 #

 # su - nagios

 $ /usr/bin/printf %b * Nagios *\nNotification  | 
 /usr/bin/mail -s ** $NOTIFICATIONTYPE$ Service Alert:  
 $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ ** ewsc...@scotborders.gov.uk

 mail: Cannot open temporary file: Permission denied

 Cannot open temporary file


Sounds like permissions on your temporary directory (most likely /tmp or 
/var/tmp) are screwed up, or you've got a full disk.

--
Download Intel#174; 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@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