Acknowledge emails

Thibault Genessay tgenessay at aliadis.fr
Fri Jan 13 16:06:07 CET 2006


Hello

Jason Gauthier wrote:

>   I've been using nagios for quite a while.  I've customized some of my
>notifications to fit better on our pagers.  Somehow, somewhere, sometime
>acknowledgement emails stopped sending the acknowledgemnt comment with
>it.    I cannot figure out which place it is I need to put this back in.
>(Maybe this was a change during a nagios upgrade even).  I'm just not
>certain.  
>  
>
I think I know what you are talking about. I have written my own 
notification script that is called the following way:
[...]/mailer.py [...] -a $NOTIFICATIONTYPE$  -s $SERVICESTATE$ [...]

I had discovered (I was using 2.0b2 in the first place) that sometimes 
my script received no value for its -a argument so I had written 
somewhere in the script the following quick fix:

    # Nagios has a feature/bug that makes it send mails without the 
PROBLEM or RECOVERY action
    # flag. Hence the -a option comes with no argument, which 
contradicts the check done below.
    if parameters['-a'] is not None and len(parameters['-a'])==0 and 
parameters['-s'] is not None and len(parameters['-s']):
        if parameters['-s'][0] in ('CRITICAL','WARNING','DOWN'):
            parameters['-a'].append('PROBLEM')
            logfile.write('Guessing the -a PROBLEM argument \n')
        elif parameters['-s'][0] in ('OK','UP'):
            parameters['-a'].append('RECOVERY')
            logfile.write('Guessing the -a RECOVERY argument \n')

I have never reviewed this code since I have upgraded to beta3 then 
beta4 but it has always worked so far. I guess we should report this to 
nagios-devel one day :)

-- 
Thibault GENESSAY
ALIADIS
www.aliadis.fr
Tel.  0870 723 724
Fax   04 72 13 90 40 



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
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