anyone done this before?

Harlan Richard C HarlanRichardC at JohnDeere.com
Thu Jun 16 16:08:41 CEST 2005


We have cron a script that does this, though we made a few changes for
our setup. We make lots of updates to our web sites that can cause
Nagios to give false alerts. So when we que up an update the update
process automatically turns off alerting on the Host/Service then once
the update has been verify and show to work the process automatically
turn on the alerting again. Because of this our script to alert on
disable notification would alert during an update. To fix this we added
a process to make sure the script will fail again on the second pass on
the same service before it alerts. It works great for us.    

-----Original Message-----
From: nagios-users-admin at lists.sourceforge.net
[mailto:nagios-users-admin at lists.sourceforge.net] On Behalf Of Arno
Lehmann
Sent: Wednesday, June 15, 2005 1:12 PM
To: Bob Eckhardt
Cc: nagios-users at lists.sourceforge.net
Subject: Re: [Nagios-users] anyone done this before?

Hello,

Bob Eckhardt wrote:

> I want to write a script that runs in cron and checks whatever file 
> nagios looks at to know what boxes are put in passive check mode or 
> notifications turned off, and have it email me once a day.
> 
> We have this problem where things get turned off and not back on, 
> imagine that.

tststs...

> With the email I can see what was left in the wrong check state and 
> re-enable it.
> 
> Is there a file I can parse, if so is there a specific thing/field I 
> can look at.

Ok, this is from Nagios 1.2...

You've got a state retention file you set up in the main configuration
file. This is a text file, one line per information item.

In xdata/xrddefault.c about line 200 you see how the data is read, and
you find that, for example, notifications_enabled is the 12th field for
a service. Counting "SERVICE: name" as one field, and assuming I counted
correctly.

Looks like an easy enough job for grep, sed, awk, perl, bash or whatever
script language you prefer.

Arno

> Make sense?
> 
> 
> Bob
> 
> 
> 
> 
> -------------------------------------------------------
> SF.Net email is sponsored by: Discover Easy Linux Migration Strategies

> from IBM. Find simple to follow Roadmaps, straightforward articles, 
> informative Webcasts and more! Get everything you need to get up to 
> speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&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

-- 
IT-Service Lehmann                    al at its-lehmann.de
Arno Lehmann                  http://www.its-lehmann.de


-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&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




-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_idt77&alloc_id492&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