anyone done this before?

Arno Lehmann al at its-lehmann.de
Wed Jun 15 20:12:17 CEST 2005


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





More information about the Users mailing list