Setting up Nagios to work with OTRS 3.0.4

Moderator: crythias

Locked
hardesty
Znuny newbie
Posts: 12
Joined: 12 Nov 2010, 00:16
Znuny Version: 2.4.7

Setting up Nagios to work with OTRS 3.0.4

Post by hardesty »

I have installed OTRS 3.0.4 on a Redhat's Fedora and I am trying to get it to work with Nagios. I want Nagios to be able to have OTRS create a ticket every time Nagios see an alert. I have not found any documentation on how to get this done. Can someone please tell me what all the steps are?

Thanks
qwer1987
Znuny newbie
Posts: 15
Joined: 25 Dec 2010, 03:11
Znuny Version: 2.4.7
Location: Europe/Kiev

Re: Setting up Nagios to work with OTRS 3.0.4

Post by qwer1987 »

I think the easiest obvious solution will be to have Nagios send mails to specified mailbox of your OTRS installation, and having OTRS Postmaster filters to route this mail to needed queue etc. Plus there is a solution to have Nagios to set mail X-OTRS-fields but I do not know how it's done.
OTRS 3.0.11 (RPM) + ITSM with PostgreSQL 8.1 on Centos 5.7 x86_64 on both production and testing machines.
jojo
Znuny guru
Posts: 15020
Joined: 26 Jan 2007, 14:50
Znuny Version: Git Master
Contact:

Re: Setting up Nagios to work with OTRS 3.0.4

Post by jojo »

Please install the System Monitoring Module and read http://otrs.org/media/nagios_conference_2008_en.pdf
"Production": OTRS™ 8, OTRS™ 7, STORM powered by OTRS
"Testing": ((OTRS Community Edition)) and git Master

Never change Defaults.pm! :: Blog
Professional Services:: http://www.otrs.com :: enjoy@otrs.com
hardesty
Znuny newbie
Posts: 12
Joined: 12 Nov 2010, 00:16
Znuny Version: 2.4.7

Re: Setting up Nagios to work with OTRS 3.0.4

Post by hardesty »

Thanks for the reply. I have seen and read the doc before. It was a little work translating it, but it was a good read. It seems to be written for someone who has both Nagios and OTRS on the same server since it Nagios runs scripts from the OTRS directory.

What needs to be done if they are NOT on the same server? I have configured Nagios to send an email to OTRS server to the user otrs. They seem to sort of disappear once the OTRS server gets them. What do I need to do in order to get OTRS to process the email?
jojo
Znuny guru
Posts: 15020
Joined: 26 Jan 2007, 14:50
Znuny Version: Git Master
Contact:

Re: Setting up Nagios to work with OTRS 3.0.4

Post by jojo »

only the check script and the Acknowledge on Lock in this document are written for same server setups.

Please have a look in the OTRS Logfile. It seems that perhaps your Nagios State is no "opening" state and the mail is dropped
"Production": OTRS™ 8, OTRS™ 7, STORM powered by OTRS
"Testing": ((OTRS Community Edition)) and git Master

Never change Defaults.pm! :: Blog
Professional Services:: http://www.otrs.com :: enjoy@otrs.com
hardesty
Znuny newbie
Posts: 12
Joined: 12 Nov 2010, 00:16
Znuny Version: 2.4.7

Re: Setting up Nagios to work with OTRS 3.0.4

Post by hardesty »

I will look at the log file. I did see these sort of messages in the log file when I was testing it:



Jan 24 13:43:50 support OTRS-otrs.PostMaster.pl-10[6669]: [Error]
[Kernel::System::CacheInternal::Set][Line:123]: Need Value!
Jan 24 13:43:50 support OTRS-otrs.PostMaster.pl-10[6669]: [Error]
[Kernel::System::Priority::PriorityLookup][Line:347]: No Priority for
3 normal found!
Jan 24 13:43:50 support OTRS-otrs.PostMaster.pl-10[6669]: [Error]
[Kernel::System::Ticket::TicketCreate][Line:436]: No PriorityID (invalid Priority Name?)!
Jan 24 13:43:50 support OTRS-otrs.PostMaster.pl-10[6669]: [Error][/opt/
otrs//bin/otrs.PostMaster.pl][Line:136]: Can't process mail, see log sub system! at /opt/otrs//bin/otrs.PostMaster.pl line 116.


So I ran it by hand and got this....

[root@support mail]# /opt/otrs//bin/otrs.PostMaster.pl < nagios
ERROR: OTRS-otrs.PostMaster.pl-10 Perl: 5.8.8 OS: linux Time: Mon Jan
24 13:47:07 2011

Message: Need Value!

Traceback (6677):
Module: Kernel::System::CacheInternal::Set (v1.9) Line: 123
Module: Kernel::System::Priority::PriorityLookup (v1.32) Line: 343
Module: Kernel::System::Ticket::TicketCreate (v1.485) Line: 425
Module: Kernel::System::PostMaster::NewTicket::Run (v1.76) Line: 147
Module: Kernel::System::PostMaster::Run (v1.85) Line: 351
Module: (eval) (v1.5) Line: 114
Module: /opt/otrs//bin/otrs.PostMaster.pl (v1.5) Line: 84

ERROR: OTRS-otrs.PostMaster.pl-10 Perl: 5.8.8 OS: linux Time: Mon Jan
24 13:47:07 2011

Message: No Priority for 3 normal found!

Traceback (6677):
Module: Kernel::System::Priority::PriorityLookup (v1.32) Line: 347
Module: Kernel::System::Ticket::TicketCreate (v1.485) Line: 425
Module: Kernel::System::PostMaster::NewTicket::Run (v1.76) Line: 147
Module: Kernel::System::PostMaster::Run (v1.85) Line: 351
Module: (eval) (v1.5) Line: 114
Module: /opt/otrs//bin/otrs.PostMaster.pl (v1.5) Line: 84

ERROR: OTRS-otrs.PostMaster.pl-10 Perl: 5.8.8 OS: linux Time: Mon Jan
24 13:47:07 2011

Message: No PriorityID (invalid Priority Name?)!

Traceback (6677):
Module: Kernel::System::Ticket::TicketCreate (v1.485) Line: 436
Module: Kernel::System::PostMaster::NewTicket::Run (v1.76) Line: 147
Module: Kernel::System::PostMaster::Run (v1.85) Line: 351
Module: (eval) (v1.5) Line: 114
Module: /opt/otrs//bin/otrs.PostMaster.pl (v1.5) Line: 84

ERROR: OTRS-otrs.PostMaster.pl-10 Perl: 5.8.8 OS: linux Time: Mon Jan
24 13:47:07 2011

Message: Can't process mail, see log sub system! at /opt/otrs//bin/ otrs.PostMaster.pl line 116.


Traceback (6677):
Module: /opt/otrs//bin/otrs.PostMaster.pl (v1.5) Line: 136

[root@support mail]#

Any idea what my FUBAR is?
jojo
Znuny guru
Posts: 15020
Joined: 26 Jan 2007, 14:50
Znuny Version: Git Master
Contact:

Re: Setting up Nagios to work with OTRS 3.0.4

Post by jojo »

Message: No PriorityID (invalid Priority Name?)!

You changed the priority names, so you have to change it also in Core::Postmaster
"Production": OTRS™ 8, OTRS™ 7, STORM powered by OTRS
"Testing": ((OTRS Community Edition)) and git Master

Never change Defaults.pm! :: Blog
Professional Services:: http://www.otrs.com :: enjoy@otrs.com
hardesty
Znuny newbie
Posts: 12
Joined: 12 Nov 2010, 00:16
Znuny Version: 2.4.7

Re: Setting up Nagios to work with OTRS 3.0.4

Post by hardesty »

Damn, if that did not fix my problem. Feel sort of stupid, but happy that the issue has been resolved.

Now if I can only figure out why it does not send out mail when I close the ticket or change its state....
Mothra
Znuny expert
Posts: 189
Joined: 26 Oct 2010, 15:04
Znuny Version: 3.2.11

Re: Setting up Nagios to work with OTRS 3.0.4

Post by Mothra »

hardesty wrote: Now if I can only figure out why it does not send out mail when I close the ticket or change its state....
If you're using the System Monitoring package, you shouldn't be closing the ticket in OTRS, the final ("UP" or "OK") message from Nagios should do this for you.
OTRS 3.2.11 on Centos 6.4 with MySQL 5.0. Agents and internal customers authenticate via Active Directory.
Locked