Andreas,

Thank you for the response.  Unfortunately backgrounding was the first thing I 
tried.  The pid is still owened by nagios and thus I thought that a nohup would 
work since the parent pid becomes 1.  No luck Nagios still seems to kill it.  I 
thought nohup would be the trick :-(

--Greg

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Andreas Ericsson
Sent: Tuesday, November 06, 2007 2:31 AM
To: Redder,Greg
Cc: Duffy,Richard; Farnell,Jim; dick hill; [email protected]
Subject: Re: [Nagios-users] Nagios killing xmessage

Redder,Greg wrote:
> We're running Nagios 2.9.  We have a command configured:
>
> define command {
>         command_name    host-notify-by-xmessage
>         command_line    /etc/nagios/scripts/host-notify-by-xmessage 
> "$HOSTSTATE$" "$HOSTNAME$" "$HOSTALIAS$" "$DATETIME$"
>         }
>
> The "host-notify-by-xmessage" is a shell script that pulls in a text file and 
> displays that text file along with the host and the problem via an xmessage 
> to an xdisplay.  This all works fine when run from the command line.  It even 
> works when invoked by nagios, but when nagios invokes it, it also kills the 
> process in about 30 seconds.  This wasn't a problem on Nagios 1.x.  We 
> recently upgraded to 2.9 and ran into this issue.  I've tried nohup'ing the 
> xmessage, but no luck - it seems like the nagios process kills it no matter 
> what!?   I've tried converting the script to perl and using 'system' or 
> 'exec' calls, but that didn't fix the problem either.
>
> Does anyone have a workaround for this or a suggestion on things to try, 
> please?
>

xmessage <args> &

Nagios must kill the notification commands if they run for too long, otherwise 
each notification will leak filedescriptors, and Nagios will, eventually, no 
longer be able to run any commands at all.

Don't create notification scripts that never exit (under normal circumstances). 
You'll just eat resources for nothing.

--
Andreas Ericsson                   [EMAIL PROTECTED]
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/ 
_______________________________________________
Nagios-users mailing list
[email protected]
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 SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Nagios-users mailing list
[email protected]
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

Reply via email to