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

Hi Tom,

I did this about two years ago for our own requirements,
but it wasn’t and still isn’t very pretty :slight_smile:

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@lists.bestpractical.com
[mailto:rt-users-bounces@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@bestpractical.com for details.

Be sure to check out the RT Wiki at http://wiki.bestpractical.com

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!

I have an inkling that this ought to tie back in through Todd’s Asset
Tracker – being able to see a history for an asset while I’m writing a
ticket is one of the things I most need. I want to see both the
tickets that have been tied to that asset, and the nagios history of
it. I haven’t loaded Todd’s package, yet; just looked at his demo; so
I’m not sure how close to that it gets yet.

Cheers,
– jra
Jay R. Ashworth jra@baylink.com
Designer Baylink RFC 2100
Ashworth & Associates The Things I Think '87 e24
St Petersburg FL USA http://baylink.pitas.com +1 727 647 1274

  If you can read this... thank a system administrator.  Or two.  --me

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!

I have an inkling that this ought to tie back in through Todd’s Asset
Tracker – being able to see a history for an asset while I’m writing a
ticket is one of the things I most need. I want to see both the
tickets that have been tied to that asset, and the nagios history of
it. I haven’t loaded Todd’s package, yet; just looked at his demo; so
I’m not sure how close to that it gets yet.

Asset history will need to be improved soon after AT goes 1.0. Unlike
most tickets, assets have a very long life and will thus have a long
history. I want the history display to default to most recent items
first, to be able to page X history transactions per page, and to
filter to only look at certain types of transactions.

-Todd

I have an inkling that this ought to tie back in through Todd’s Asset
Tracker – being able to see a history for an asset while I’m writing a
ticket is one of the things I most need. I want to see both the
tickets that have been tied to that asset, and the nagios history of
it. I haven’t loaded Todd’s package, yet; just looked at his demo; so
I’m not sure how close to that it gets yet.

Asset history will need to be improved soon after AT goes 1.0. Unlike
most tickets, assets have a very long life and will thus have a long
history. I want the history display to default to most recent items
first, to be able to page X history transactions per page, and to
filter to only look at certain types of transactions.

Yep; that’s the stuff.

For the sort of consulting work I’m using RT to support, that’s the
stuff that’s critical for us. I figured you were going that direction,
but I didn’t know how fast.

Cheers,
– jra
Jay R. Ashworth jra@baylink.com
Designer Baylink RFC 2100
Ashworth & Associates The Things I Think '87 e24
St Petersburg FL USA http://baylink.pitas.com +1 727 647 1274

  If you can read this... thank a system administrator.  Or two.  --me