Alert suggestion: RSS

Jeff McCombs jeffm at nicusa.com
Mon Mar 7 23:58:23 CET 2005


Peeps,

OK, so I've been hacking on this just to see, thinking that an RSS feed
might be pretty useful..

And what I've come up with isn't pretty, to say the least. It's slow.. But
for those of you who want to hack on this, maybe improve it, go for it...

This little _PHP_ app parses the nagios.log file, and reports on all
services that are _not_ in a status of UP or OK. I'm sure there's a perl
module out there that can do it, but for some reason, I can't write perl to
save my life. :)

Tack on ?oktoo=true to the URL, and it'll report on all services (not
recommended, we have over 800 services, which means we have over 800 RSS
items, and that's a horrible thing to do to your reader!)

Edit the config.php file and set the following:
    
    $nagios['status_file']
        This needs to be the full path to the status.log file Nagios spits
out (e.g. /usr/local/nagios/var/status.log)
    
    $nagios['myurl']
        This is the full http:// address to the nagios web interface.
        e.g. http://nagios.mydomain.com/nagios/

    $nagios['statcgi']
        This is the full http:// address to the nagios status.cgi script
        e.g. http://nagios.mydomain.com/nagios/cgi-bin/status.cgi

    $nagios['extinfo]
        This is the full http:// address to the nagios extinfo.cgi script
        e.g. http://nagios.mydomain.com/nagios/cgi-bin/extinfo.cgi

Just drop this into the Nagios cgi-bin/ directory. Note this is a giant,
ugly HACK that I put together, no warranties express or implied, blah blah
blah, may break systems, cause floods and other major disasters, blah blah..
No support, you know the drill.

    Hack it up as needed. It ought to give someone a start at least... Oh,
and I wrote this to work with 1.2, not 2.x, since I don't have a 2.x status
file to work with. Sorry, no support for DB's, though it could be done (and
would probably be faster).

    -Jeff




> From: <brianmas at highstream.net>
> Date: Mon,  7 Mar 2005 14:32:31 -0500
> To: <nagios-users at lists.sourceforge.net>
> Subject: Re: [Nagios-users] Alert suggestion: RSS
> 
> Quoting Marcel Smeets <mpgsmeets at gmail.com>:
> 
>> Mmm, the second time someone tells it is simple to make a notification
>> script for this. Well how??
> 
> I already have something working, sorta, after just working on it a little bit
> here and there today. I'll let the world know when I have something I think is
> decent enough to use beyond my own machines.
> 
> b
> 
>> 
>> 
>> On Mon, 7 Mar 2005 15:57:37 +0000, Mike Simkins <mike.simkins at gmail.com>
>> wrote:
>>> I have seen something like this for files, should be a simple job to
>>> write one, I would personally find it useful..
>>> 
>>> On Mon,  7 Mar 2005 10:07:49 -0500, brianmas at highstream.net
>>> <brianmas at highstream.net> wrote:
>>>> Quoting Andreas Ericsson <ae at op5.se>:
>>>> 
>>>>> brianmas at highstream.net wrote:
>>>>>> I looked around and I didn't see it mentioned anywhere but RSS as a
>>>>> reporting
>>>>>> mechanism might be sorta useful. When I am on my laptop at home I
>> often
>>>>> don't
>>>>>> have a browser window with nagios open or a mail client open but I'll
>> have
>>>>> an
>>>>>> RSS client going. Maybe I am the only one and it'll never get used
>> though
>>>>> ...
>>>>>> just an idea. I'd "write a patch" if I thought I could, btw.
>>>>>> 
>>>>> 
>>>>> You don't have to write a patch. Just a notification script. It should
>>>>> be fairly simple, really.
>>>> 
>>>> oh really? I honestly didn't look into notification stuff, the plugin API
>> is
>>>> simple as hell though, I'll have a go at this when I have some free time
>> this
>>>> week.
>>>> 
>>>> thanks for the info.
>>>> brian
>>>> 
>>>> 
>>>> -------------------------------------------------------
>>>> SF email is sponsored by - The IT Product Guide
>>>> Read honest & candid reviews on hundreds of IT Products from real users.
>>>> Discover which products truly live up to the hype. Start reading now.
>>>> http://ads.osdn.com/?ad_id=6595&alloc_id=14396&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 email is sponsored by - The IT Product Guide
>>> Read honest & candid reviews on hundreds of IT Products from real users.
>>> Discover which products truly live up to the hype. Start reading now.
>>> http://ads.osdn.com/?ad_id=6595&alloc_id=14396&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 email is sponsored by - The IT Product Guide
>> Read honest & candid reviews on hundreds of IT Products from real users.
>> Discover which products truly live up to the hype. Start reading now.
>> http://ads.osdn.com/?ad_id=6595&alloc_id=14396&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 email is sponsored by - The IT Product Guide
> Read honest & candid reviews on hundreds of IT Products from real users.
> Discover which products truly live up to the hype. Start reading now.
> http://ads.osdn.com/?ad_id=6595&alloc_id=14396&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
> 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: nag-rss.tgz
Type: application/octet-stream
Size: 3119 bytes
Desc: not available
URL: <https://www.monitoring-lists.org/archive/users/attachments/20050307/ece3d394/attachment.obj>


More information about the Users mailing list