[rt-users] RT::Extension::Nagios
Hi all, I'm trying to get RT::Extension::Nagios to work but I'm stuck and I can't totally understand why as there's nothing in the logs. My RT_SiteConfig.pm looks like this in the relevant bits: Set( @Plugins, qw(RT::Authen::ExternalAuth RT::Extension::LDAPImport RT::Extension::Nagios)); Set($NagiosSearchAllQueues, 0); # true Set($NagiosMergeTickets, 1); # merged to the newest ticket. As far as I understand this should be enough. Now, the regexp that is matched against the subject is (PROBLEM|RECOVERY|ACKNOWLEDGEMENT)\s+(Service|Host) Alert: ([^/]+)/?(.*)\s+is\s+(\w+) and as far as I can understand the match is made only over the subject line (i.e. PROBLEM of a given host/service is matched with RECOVERY or ACKNOWLEDGEMENT of the same host/service). I've tried issuing two e-mails with subjects PROBLEM Service Alert: sambaserver/sambaserver_root is WARNING PROBLEM Service Alert: sambaserver/sambaserver_root is OK but no automatic closure/merge happened. As I said, there's no mention in the logs. How can I understand what's going on? Thanks, Giuseppe -- Giuseppe Sollazzo Senior Systems Analyst Computing Services Information Services St. George's, University Of London Cranmer Terrace London SW17 0RE Email: gsoll...@sgul.ac.uk Direct Dial: +44 20 8725 5160 Fax: +44 20 8725 3583 2011 Training: http://bestpractical.com/services/training.html
Re: [rt-users] RT::Extension::Nagios
On Mon, Jun 20, 2011 at 03:31:07PM +0100, Giuseppe Sollazzo wrote: Hi all, I'm trying to get RT::Extension::Nagios to work but I'm stuck and I can't totally understand why as there's nothing in the logs. My RT_SiteConfig.pm looks like this in the relevant bits: Set( @Plugins, qw(RT::Authen::ExternalAuth RT::Extension::LDAPImport RT::Extension::Nagios)); Set($NagiosSearchAllQueues, 0); # true Set($NagiosMergeTickets, 1); # merged to the newest ticket. As far as I understand this should be enough. Now, the regexp that is matched against the subject is (PROBLEM|RECOVERY|ACKNOWLEDGEMENT)\s+(Service|Host) Alert: ([^/]+)/?(.*)\s+is\s+(\w+) and as far as I can understand the match is made only over the subject line (i.e. PROBLEM of a given host/service is matched with RECOVERY or ACKNOWLEDGEMENT of the same host/service). I've tried issuing two e-mails with subjects PROBLEM Service Alert: sambaserver/sambaserver_root is WARNING PROBLEM Service Alert: sambaserver/sambaserver_root is OK but no automatic closure/merge happened. As I said, there's no mention in the logs. How can I understand what's going on? Did you run make initdb? Do you have the On Create Update Nagios Tickets scrip? That scrip will log if it matches in the subject. -kevin pgpZBGUSqT6MQ.pgp Description: PGP signature 2011 Training: http://bestpractical.com/services/training.html
Re: [rt-users] RT::Extension::Nagios
Did you run make initdb? Do you have the On Create Update Nagios Tickets scrip? That scrip will log if it matches in the subject. Hi Kevin, thanks - I haven't. I can't find such info in the readme/wiki. Is there any example anywhere else? So basically, 1) There's no update nagios option in the scrip, or such scrip at all, so I suppose this is because I didn't run the make initdb 2) make initdb in which makefile? (I installed the extension via cpan, if that makes any difference). Thanks, Giuseppe Attached Message Part Description: PGP signature 2011 Training: http://bestpractical.com/services/training.html 2011 Training: http://bestpractical.com/services/training.html
Re: [rt-users] RT::Extension::Nagios
On Mon, Jun 20, 2011 at 03:53:23PM +0100, Giuseppe Sollazzo wrote: Did you run make initdb? Do you have the On Create Update Nagios Tickets scrip? That scrip will log if it matches in the subject. Hi Kevin, thanks - I haven't. I can't find such info in the readme/wiki. Is there any example anywhere else? Step 4 of the README included in the extension covers this. http://cpansearch.perl.org/src/SUNNAVY/RT-Extension-Nagios-0.06/README -kevin So basically, 1) There's no update nagios option in the scrip, or such scrip at all, so I suppose this is because I didn't run the make initdb 2) make initdb in which makefile? (I installed the extension via cpan, if that makes any difference). Thanks, Giuseppe pgpm3f2u0mIHM.pgp Description: PGP signature 2011 Training: http://bestpractical.com/services/training.html
Re: [rt-users] RT::Extension::Nagios
Ok - so I assume there's no way of having this to work when installed via cpan? G On 20/06/11 16:11, Kevin Falcone wrote: On Mon, Jun 20, 2011 at 03:53:23PM +0100, Giuseppe Sollazzo wrote: Did you run make initdb? Do you have the On Create Update Nagios Tickets scrip? That scrip will log if it matches in the subject. Hi Kevin, thanks - I haven't. I can't find such info in the readme/wiki. Is there any example anywhere else? Step 4 of the README included in the extension covers this. http://cpansearch.perl.org/src/SUNNAVY/RT-Extension-Nagios-0.06/README -kevin So basically, 1) There's no update nagios option in the scrip, or such scrip at all, so I suppose this is because I didn't run the make initdb 2) make initdb in which makefile? (I installed the extension via cpan, if that makes any difference). Thanks, Giuseppe 2011 Training: http://bestpractical.com/services/training.html -- Giuseppe Sollazzo Senior Systems Analyst Computing Services Information Services St. George's, University Of London Cranmer Terrace London SW17 0RE Email: gsoll...@sgul.ac.uk Direct Dial: +44 20 8725 5160 Fax: +44 20 8725 3583 2011 Training: http://bestpractical.com/services/training.html
[rt-users] RT::Extension::Nagios
Hi folks, I'm trying to get RT::Extension::Nagios to work properly with my RT installation. I'm running RT-3.8.8 on Centos 5.5 and all other functions are working as expected. To setup this extension, I've created a new queue named Nagios and have notifications from Nagios sent to that queue's email address. Tickets are created, but are not merged or auto-closed on RECOVERY notification. I have added the following to my RT_SiteConfig.pm: Set($NagiosMergeTickets , 1); Set(@Plugins, qw(RT::Extension::MobileUI), qw(RT::Extension::Gravatar), qw(RT::Extension::Nagios)); Am I missing something simple? Does anyone else have this plugin working? Thanks! Josh - - - - Joshua Fiske '03, '04 Manager of User Services / Security Engineer Clarkson University, Office of Information Technology (315) 268-6722 -- Fax: (315) 268-6570
Re: [rt-users] RT::Extension::Nagios
On Wed, Dec 01, 2010 at 02:31:20PM +, Joshua A. Fiske - jfiske wrote: Hi folks, I'm trying to get RT::Extension::Nagios to work properly with my RT installation. I'm running RT-3.8.8 on Centos 5.5 and all other functions are working as expected. To setup this extension, I've created a new queue named Nagios and have notifications from Nagios sent to that queue's email address. Tickets are created, but are not merged or auto-closed on RECOVERY notification. I have added the following to my RT_SiteConfig.pm: Set($NagiosMergeTickets , 1); Set(@Plugins, qw(RT::Extension::MobileUI), qw(RT::Extension::Gravatar), qw(RT::Extension::Nagios)); Am I missing something simple? Does anyone else have this plugin working? Ensure that the scrip that this extension sets up (ie. that you ran make initdb) Check perldoc lib/RT/Extension/Nagios.pm and ensure that your ticket subjects match the regular expression that the module is using And what do your logs say? -kevin pgpCzcGZ2CZZ0.pgp Description: PGP signature
Re: [rt-users] RT and Nagios
I really do not understand why you would need nagios for this? We have very much similar kpis which we monitor with a simple perl script utilising the RT api. Our script run every hour , update the tickets with a warning comment if the warning threshold is reached (Admin Ccs receive an email on comment),and again a critical type comment is submitted if the critical threshold reached. We also have a custom field that gets updated on warnings/critical levels, tickets with these level are highlighted in different color in the web interface , and on critical a manager maybe cc'ed. All from within RT , no need for external dependencies such as Nagios. Regards; Roy Roderick A. Anderson wrote: Hossein Rafighi wrote: Hi, We have modified rt-crontool to create Nagios alerts. This woks with nrpe and unlike SendNgiosAlert doesn't require any additional modules installation. If you have running Nagios server it can easily pull relevant stuff from RT. Nagios will send a warning email if: Tickets are new for more than 24hours Tickets are open for more than 5days It will generate a critical email if: Tickets are new for more than 48hours Tickets are open for more than 7days. If the status of a ticket is stalled, then our script will ignore it. It is our policy to change the ticket status to stalled if a ticket is required to remain open for more than one week. Since we are a 24x7x360 lab, we decided to include weekends and holidays in the script. If you're interested let me know and I can send/post scripts and required steps. Again, this script is modified version of rt-crontool. I for one am interested. Not that I have a need right now but it is always interesting to see how people solve these kinds of needs. Rod Discover RT's hidden secrets with RT Essentials from O'Reilly Media. Buy a copy at http://rtbook.bestpractical.com
Re: [rt-users] RT and Nagios
On 4/29/2010 5:16 AM, Raed El-Hames wrote: I really do not understand why you would need nagios for this? I highly doubt they installed Nagios *just* for this. Discover RT's hidden secrets with RT Essentials from O'Reilly Media. Buy a copy at http://rtbook.bestpractical.com
Re: [rt-users] RT and Nagios
There is always more than one way to skin the We monitor all our devices by Nagios and naturally made sense to add RT to it. Not all the solutions are good for all RT users. Cheers, Hossein Raed El-Hames wrote: I really do not understand why you would need nagios for this? We have very much similar kpis which we monitor with a simple perl script utilising the RT api. Our script run every hour , update the tickets with a warning comment if the warning threshold is reached (Admin Ccs receive an email on comment),and again a critical type comment is submitted if the critical threshold reached. We also have a custom field that gets updated on warnings/critical levels, tickets with these level are highlighted in different color in the web interface , and on critical a manager maybe cc'ed. All from within RT , no need for external dependencies such as Nagios. Regards; Roy Roderick A. Anderson wrote: Hossein Rafighi wrote: Hi, We have modified rt-crontool to create Nagios alerts. This woks with nrpe and unlike SendNgiosAlert doesn't require any additional modules installation. If you have running Nagios server it can easily pull relevant stuff from RT. Nagios will send a warning email if: Tickets are new for more than 24hours Tickets are open for more than 5days It will generate a critical email if: Tickets are new for more than 48hours Tickets are open for more than 7days. If the status of a ticket is stalled, then our script will ignore it. It is our policy to change the ticket status to stalled if a ticket is required to remain open for more than one week. Since we are a 24x7x360 lab, we decided to include weekends and holidays in the script. If you're interested let me know and I can send/post scripts and required steps. Again, this script is modified version of rt-crontool. I for one am interested. Not that I have a need right now but it is always interesting to see how people solve these kinds of needs. Rod Discover RT's hidden secrets with RT Essentials from O'Reilly Media. Buy a copy at http://rtbook.bestpractical.com -- _ _ _ _ _ _ _ Hossein Rafighi |_ _|| _ \ |_ _|| | | || \_/ || __|TRIUMF, 4004 Wesbrook Mall | | | |_| ) | | | | | || || |__ Vancouver BC, Canada, V6T 2A3 | | | _ / | | | \_/ || \_/ || __|Voice: (604) 222-1047 | | | | \ \ _| |_ | || | | || | Fax: (604) 222-1074 |_| |_| \_\|_| \___/ |_| |_||_| Website: http://www.triumf.ca Discover RT's hidden secrets with RT Essentials from O'Reilly Media. Buy a copy at http://rtbook.bestpractical.com
Re: [rt-users] RT and Nagios
We're in the process of rolling out network and machine monitoring here using Nagios, so I'd be very interested in this, please send the info my way when you've the opportunity. Thanks. On 4/28/10 2:34 PM, Hossein Rafighi hossein.rafi...@triumf.ca wrote: Hi, We have modified rt-crontool to create Nagios alerts. This woks with nrpe and unlike SendNgiosAlert doesn't require any additional modules installation. If you have running Nagios server it can easily pull relevant stuff from RT. Nagios will send a warning email if: Tickets are new for more than 24hours Tickets are open for more than 5days It will generate a critical email if: Tickets are new for more than 48hours Tickets are open for more than 7days. If the status of a ticket is stalled, then our script will ignore it. It is our policy to change the ticket status to stalled if a ticket is required to remain open for more than one week. Since we are a 24x7x360 lab, we decided to include weekends and holidays in the script. If you're interested let me know and I can send/post scripts and required steps. Again, this script is modified version of rt-crontool. Sample email: * Nagios 2.8 * Notification Type: PROBLEM Service: Q-CCN Host: helpdesk Address: 172.127.2.12 State: WARNING Date/Time: Tue Apr 27 14:55:37 PDT 2010 Additional Info: 0 new tickets: 0 24h, 0 48h: 1 open: 1 120h, 0 168h Cheers, Hossein Rafighi -- Gary L. Greene, Jr. IT Operations Minerva Networks, Inc. Cell: (650) 704-6633 Phone: (408) 240-1239 Discover RT's hidden secrets with RT Essentials from O'Reilly Media. Buy a copy at http://rtbook.bestpractical.com
Re: [rt-users] RT and Nagios
Few people off the list had made the same request and I sent them the relevant info. With apologizes for spamming those of you who are not interested, I am attaching the requested files to this message. Cheers, Hossein Gary Greene wrote: We're in the process of rolling out network and machine monitoring here using Nagios, so I'd be very interested in this, please send the info my way when you've the opportunity. Thanks. On 4/28/10 2:34 PM, Hossein Rafighi hossein.rafi...@triumf.ca wrote: Hi, We have modified rt-crontool to create Nagios alerts. This woks with nrpe and unlike SendNgiosAlert doesn't require any additional modules installation. If you have running Nagios server it can easily pull relevant stuff from RT. Nagios will send a warning email if: Tickets are new for more than 24hours Tickets are open for more than 5days It will generate a critical email if: Tickets are new for more than 48hours Tickets are open for more than 7days. If the status of a ticket is stalled, then our script will ignore it. It is our policy to change the ticket status to stalled if a ticket is required to remain open for more than one week. Since we are a 24x7x360 lab, we decided to include weekends and holidays in the script. If you're interested let me know and I can send/post scripts and required steps. Again, this script is modified version of rt-crontool. Sample email: * Nagios 2.8 * Notification Type: PROBLEM Service: Q-CCN Host: helpdesk Address: 172.127.2.12 State: WARNING Date/Time: Tue Apr 27 14:55:37 PDT 2010 Additional Info: 0 new tickets: 0 24h, 0 48h: 1 open: 1 120h, 0 168h Cheers, Hossein Rafighi -- _ _ _ _ _ _ _ Hossein Rafighi |_ _|| _ \ |_ _|| | | || \_/ || __|TRIUMF, 4004 Wesbrook Mall | | | |_| ) | | | | | || || |__ Vancouver BC, Canada, V6T 2A3 | | | _ / | | | \_/ || \_/ || __|Voice: (604) 222-1047 | | | | \ \ _| |_ | || | | || | Fax: (604) 222-1074 |_| |_| \_\|_| \___/ |_| |_||_| Website: http://www.triumf.ca *** * * * Information in this file is provided as is. Please try it on a test server first to make sure it works for you. * * * *** It is assumed youre using Linux for both Nagios and RT servers. There are two requirements when integrating RT with Nagios: 1: Running Nagios server, and Nagios client on the computer hosting RT. On the computer hosting RT you must add nrpe to the bottom of: /etc/sudoers: #visudo --and add the following lines-- # Do not require a tty for user nrpe Defaults:nrpe !requiretty # Allow user nrpe to execute rt-checkticket with any arguments nrpe ALL=(ALL) NOPASSWD: /path-to/your-nagios/rt-checkticket SAVE AND EXIT SUDOERS. 2: rt-checkticket script. Download rt-checkticket and put it in /path-to/your-nagios directory on the computer hosting RT. Create rt-checkticket.cfg file and add the following to it. One line per queue name: command[rt-checkQUEUE1]=/usr/bin/sudo /path-to/your-nagios/rt-checkticket -q 'QUEUE1' command[rt-checkQUEUE2]=/usr/bin/sudo /path-to/your-nagios/rt-checkticket -q 'QUEUE2' SAVE AND EXIT RT-CHECKTICKET Test to see if your RT is reporting any data: #su -s /bin/sh -c /usr/bin/sudo /path-to/your-nagios/rt-checkticket -q 'QUEUE1' nrpe It shouldnt give any error. It should display something like: 0 new tickets: 0 24h, 0 48h; 0 open: 0 120h, 0 168h (depending on your queue you may see different numbers for open/new tickets). If the script doesnt display new/open tickets, then you need to fix whatever the error message it gives. Depending on how your Nagios server is setup you may have to create RT.cfg file with info similar to the following: define servicegroup { servicegroup_name RT-tickets alias RT Tickets } define contactgroup { contactgroup_name QUEUE1 alias QUEUE1 Admins members queue1-admin1 } define service{ use RT-service service_description Q-QUEUE1 check_command check_nrpe!rt-checkQUEUE1 contact_groups QUEUE1-admins } Then, you need to create a Contact.cfg with the actual email address and contact information for each queue-admins you create. define contact { contact_namejdoe alias John Doe email j...@mydomain.com contactgroups QUEUE1-admins
[rt-users] RT and Nagios
Hi, We have modified rt-crontool to create Nagios alerts. This woks with nrpe and unlike SendNgiosAlert doesn't require any additional modules installation. If you have running Nagios server it can easily pull relevant stuff from RT. Nagios will send a warning email if: Tickets are new for more than 24hours Tickets are open for more than 5days It will generate a critical email if: Tickets are new for more than 48hours Tickets are open for more than 7days. If the status of a ticket is stalled, then our script will ignore it. It is our policy to change the ticket status to stalled if a ticket is required to remain open for more than one week. Since we are a 24x7x360 lab, we decided to include weekends and holidays in the script. If you're interested let me know and I can send/post scripts and required steps. Again, this script is modified version of rt-crontool. Sample email: * Nagios 2.8 * Notification Type: PROBLEM Service: Q-CCN Host: helpdesk Address: 172.127.2.12 State: WARNING Date/Time: Tue Apr 27 14:55:37 PDT 2010 Additional Info: 0 new tickets: 0 24h, 0 48h: 1 open: 1 120h, 0 168h Cheers, Hossein Rafighi -- _ _ _ _ _ _ _ Hossein Rafighi |_ _|| _ \ |_ _|| | | || \_/ || __|TRIUMF, 4004 Wesbrook Mall | | | |_| ) | | | | | || || |__ Vancouver BC, Canada, V6T 2A3 | | | _ / | | | \_/ || \_/ || __|Voice: (604) 222-1047 | | | | \ \ _| |_ | || | | || | Fax: (604) 222-1074 |_| |_| \_\|_| \___/ |_| |_||_| Website: http://www.triumf.ca Discover RT's hidden secrets with RT Essentials from O'Reilly Media. Buy a copy at http://rtbook.bestpractical.com
Re: [rt-users] RT and Nagios
Hossein Rafighi wrote: Hi, We have modified rt-crontool to create Nagios alerts. This woks with nrpe and unlike SendNgiosAlert doesn't require any additional modules installation. If you have running Nagios server it can easily pull relevant stuff from RT. Nagios will send a warning email if: Tickets are new for more than 24hours Tickets are open for more than 5days It will generate a critical email if: Tickets are new for more than 48hours Tickets are open for more than 7days. If the status of a ticket is stalled, then our script will ignore it. It is our policy to change the ticket status to stalled if a ticket is required to remain open for more than one week. Since we are a 24x7x360 lab, we decided to include weekends and holidays in the script. If you're interested let me know and I can send/post scripts and required steps. Again, this script is modified version of rt-crontool. I for one am interested. Not that I have a need right now but it is always interesting to see how people solve these kinds of needs. Rod -- Discover RT's hidden secrets with RT Essentials from O'Reilly Media. Buy a copy at http://rtbook.bestpractical.com
[rt-users] RT::Extension::Nagios and set TimeWorked Total of All Merged Tickets
Hello all, I'm using the RT::Extension::Nagios plugin and would like for statistics purposes for my IT director to have the total time worked calculated from all the previously created problem merged tickets when the recovery ticket is resolved. What I can see so far: a ticket is created from 'PROBLEM' mail subject and successive 'PROBLEM' tickets merge previous tickets into them until we receive a 'RECOVERY' ticket and that last (new) ticket ID is resolved. What I think I need is to get the ticket history of the resolved ticket ID and get the oldest transaction ID from that and get the date created then calculate the difference between the two dates using Date::Calc? To demonstrate I have at least tried (but time is limited by management) hence this mail. I see one can use the rt shell or RT::Client::REST to get the required history. rgabr...@orpheus:~/tmp$ rt show ticket/3/history # 24/24 (/total) 151090: Ticket created by robe...@anomaly.hugetelecom.co.za 151091: Outgoing email recorded by RT_System 151096: Ticket created by robe...@anomaly.hugetelecom.co.za 151097: Outgoing email recorded by RT_System 151098: Merged into ticket #3 by RT_System rgabr...@orpheus:~/tmp$ rt show ticket/3/history/id/151124 # 24/24 (id/151124/total) id: 151124 Ticket: 3 TimeTaken: 0 Type: Status Field: Status OldValue: new NewValue: resolved Data: Description: Status changed from 'new' to 'resolved' by RT_System Content: This transaction appears to have no content Creator: RT_System Created: 2010-02-24 07:46:43 Attachments: I suppose one could set TimeWorked from this. I've tried using SetTimeWorkedAutomatically as a queue scrip but now I see it is no good. I'm learning how RT does things and it's not as expected. I would like to know what is the most logical way of going about this? I've tried looking at /opt/rt3/share/html/Ticket/Elements/ShowHistory and adding some of that to /opt/rt3/local/plugins/RT-Extension-Nagios/lib/RT/Action/UpdateNagiosTickets.pm but I'm digging the hole deeper. I'm not going to investigate the Perl internals of RT quite right now. I could hack a dirty solution together using shell scripts etc. but I want something clean and elegant. Thanks. ___ http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users Community help: http://wiki.bestpractical.com Commercial support: sa...@bestpractical.com 2010 RT Training Sessions! San Francisco, CA, USA - Feb 22 23 Dublin, Ireland - Mar 15 16 Boston, MA, USA - April 5 6 Washington DC, USA - Oct 25 26 Discover RT's hidden secrets with RT Essentials from O'Reilly Media. Buy a copy at http://rtbook.bestpractical.com