[rt-users] RT and Nagios?
Norton, Ian
i.norton at lancaster.ac.uk
Thu Apr 7 08:46:17 EDT 2005
Hi Tom,
I did this about two years ago for our own requirements,
but it wasn't and still isn't very pretty :)
The approach that I took was as follows:
Don't use the nagios email notification
Write a perl module to read the nagios status information
Write a perl module to query RT (Which you can probably do using the
RT API)
I only notify of the outage and not of the return to service.
We don't want flapping hosts to spam the ticket
We want our operations desk to investigate potential problems, check
graphs etc.
Use Nagios's comment field to store the ticket numbers for this host
Use Nagios's host notification field to log if RT knows about the
problem
I have a note of my script algorithm :
If nagios has been restarted in the last 30 mins, exit until things
stabilise
We did this because we were getting a flood of tickets after each
restart.
I think it's something to do with hard and soft states, but I can't
remember now!
Get a list of hosts that are up but have notification disabled.
Is the ticket related to this host still open?
No - enable notifications for this host
Get a list of hosts that are down and notifications are enabled.
For each host
Is there a ticket open for this host?
No - Track down the parent host that starts the outage
Disable notifications for hosts from parent downwards
Mail RT with the details
Search RT to get the ticket number and log it as a nagios
comment
on the host.
I'm using the host IP address to search RT and the email that goes to RT
has
a complete list of the hosts with IP address for searching.
The code I have is based around our own network management system and
doesn't
rely entirely on nagios to build the host hierarchy, but I'm sure it
could be done.
If I was re-implementing the whole thing now, I'd probably use custom
fields to store the
IP addresses in the ticket and change the ticket injection to be direct
via the RT API
rather than doing things by email. Our eventual intention is to do this
via SOAP from
a central stats and status server that knows about all the nagios
instances and hosts on
each system, but that's probably some way off yet!
Hope this helps you a little.
Regards, Ian.
-----Original Message-----
From: rt-users-bounces at lists.bestpractical.com
[mailto:rt-users-bounces at lists.bestpractical.com] On Behalf Of Thomas
Earl
Sent: 07 April 2005 12:48
To: Request Tracker
Subject: [rt-users] RT and Nagios?
Greetings to all,
Has anyone intergrated RT with Nagios? Doesn't seem like alot of
intergration, but one thing that I'm trying to figure out is Nagios send
out email for an alarm, but it will send on an DOWN and a UP. If I want
those to be under the same ticket, how do I do that?
Thanks,
Tom
_______________________________________________
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users
RT Administrator and Developer training is coming to your town soon!
(Boston, San Francisco, Austin, Sydney) Contact
training at bestpractical.com for details.
Be sure to check out the RT Wiki at http://wiki.bestpractical.com
More information about the rt-users
mailing list