Nagios killing xmessage

Redder,Greg Greg.Redder at ColoState.EDU
Tue Nov 6 17:01:35 CET 2007


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: nagios-users-bounces at lists.sourceforge.net [mailto:nagios-users-bounces at lists.sourceforge.net] On Behalf Of Andreas Ericsson
Sent: Tuesday, November 06, 2007 2:31 AM
To: Redder,Greg
Cc: Duffy,Richard; Farnell,Jim; dick hill; Nagios-users at lists.sourceforge.net
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                   andreas.ericsson at op5.se
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
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

-------------------------------------------------------------------------
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
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