Nagios and OTRS integration


#1

Hi,
Has anybody integrated Nagios and OTRS, the ticketing system? What I am driving at is the Nagios notification or mail should automatically create a ticket in OTRS.

Thanks,
Deepak


#2

I have installed this:
otrs.org/media/nagios_conference_2008_en.pdf

And more info:
lists.otrs.org/pipermail/dev/200 … 00890.html

Anyhow it is only “half working” at the moment. OTRS creates new ticket from nagios, and also updates ticket, but it will not close the ticket or send ticket number to to Nagios as notification.

I have created SSH pipes correctly, but still problems - any good ideas where to search the resolution?


#3

So far I managed as follows:

OTRS opens ticket from Nagios alarm, and if more alarms comes from same service, it will add those to existing ticket. OTRS almost sends Acknowledgement to Nagios (Ticket number) - only problem is that server name fails: Nagios will sends hostname as “[host]^M” and “[service]^M” and therefore the ackonowledgement will be sent to “[host]%0D”.

I know, that these ^M and %0D are “newline” and coming from otrs_ticket_handler.pl

my $message = “Type: $Opts{‘N’}\n”.
“Service: $Opts{‘S’}\n”.
“Host: $Opts{‘H’}\n”.
“Address: $Opts{‘a’}\n”.
“State: $Opts{‘s’}\n\n”.
“Output: $Opts{‘o’}”;

I think, that I have configured something wrong. OTRS gets information from e-mails content (therefore I have to use “State” and “Host” that OTRS will reckognize the variables) and not those X-OTRS -headers as it should. Where might be problem?


#4

Really can’t help you, but it looks like an intersting thread on which to keep attention, thanks for sharing the info while you gather it. :slight_smile:


#5

Updating the situtation.

I found one mistake from my Systemmonitoring -settings. I had to change my Nagios::Acknowledge settings to

Nagios::Acknowledge::FreeField::Host: TicketFreeText2
Nagios::Acknowledge::FreeField::Service: TicketFreeText4

Then I created an alert and Nagios sent email to OTRS:

Nov 18 15:10:03 ubuntutest OTRS-PMAccount-10[8730]: [Notice][Kernel::System::PostMaster::Filter::SystemMonitoring::Run] SystemMonitoring Mail: SystemMonitoring: Could not find host address and/or state in mail => Ignoring
Nov 18 15:10:03 ubuntutest OTRS-PMAccount-10[8730]: [Notice][Kernel::System::PostMaster::NewTicket::Run] Take UserLogin (nagios) from customer source backend based on ([email protected]).
Nov 18 15:10:03 ubuntutest OTRS-PMAccount-10[8730]: [Notice][Kernel::System::PostMaster::NewTicket::Run] Take UserCustomerID (Company) from customer source backend based on ([email protected]).
Nov 18 15:10:03 ubuntutest OTRS-PMAccount-10[8730]: [Notice][Kernel::System::ticket::TicketCreate] New Ticket [2009111810000072/Nagios-alert: S] created (TicketID=68,Queue=Customer,Priority=3 normal,State=new)
Nov 18 15:10:03 ubuntutest OTRS-PMAccount-10[8730]: [Notice][Kernel::System::ticket::Article::SendAgentNotification] Sent agent ‘NewTicket’ notification to '[email protected]](mailto:'[email protected]).

Now OTRS sends Acknowledgement to Nagios:
192.168.xx.xx - otrsnagios [18/Nov/2009:15:12:57 +0200] “GET /nagios/cgi-bin/cmd.cgi?cmd_typ=34&cmd_mod=2&host=Server1&service=RootPartition&sticky_ack=on&send_notification=on&persistent=on&com_data=2009111810000072&btnSubmit=Commit HTTP/1.1” 200 1306 “-” “libwww-perl/5.820”

So far working. Still wondering that “[Kernel::System::PostMaster::Filter::SystemMonitoring::Run] SystemMonitoring Mail: SystemMonitoring: Could not find host address and/or state in mail => Ignoring” - why it does not reckognize the X-OTRS data? The ticket is created as “customer sent email” not as “system notification” as it should. X-OTRS should be correct:

X-OTRS-Queue: Customer
X-OTRS-TicketKey2: Host
X-OTRS-TicketKey3: Service-Status
X-OTRS-TicketKey4: Service
X-OTRS-TicketValue2: Server1
X-OTRS-TicketValue3: CRITICAL
X-OTRS-TicketValue4: RootPartition

Another problem is when Nagios is trying to update the ticket. I have created the SSH pair, and it seems to work. I can see on OTRS auth.log:
Nov 18 15:13:12 ubuntutest sshd[8839]: Accepted publickey for otrs from 192.168.xx.xx port 47457 ssh2

but I have no idea what it is trying to do there? At least it does not make any changes on tickets… How I can trace what command it is trying to execute (and so I can trace the problem)

Judanssi

PS. Sorry, but English is not my native language
PPS. Another sorry - I am not programmer and thats why my problem tracing is like shooting the shotgun and hoping that I will hit the target :wink:


#6

The only idea i have is to check at the same time on the nagios server’s log :slight_smile:


#7

I have checked both servers logs (auth.log and syslog), but those are clean.


#8

Another update:

I tried to solve that SSH issue. I sent manually same kind of command via SSH as Nagios should do. I got error message back:

Global symbol “@nagios_queues” requires explicit package name at /opt/otrs/bin/NagiosGenericAgent.pl line 112.
Execution of /opt/otrs/bin/NagiosGenericAgent.pl aborted due to compilation errors

Anyhow @nagios_queues is already defined on line 33:
my @nagios_queues = ‘testqueue’];

and I have used same queue also in SSH command -C testqueue, but it always returns the same error.


#9

I have done the Nagios+OTRS integration
But I am facing following problems

No support is available from Nagios Community or OTRS community
There is no any standard process documents available for integration.
Tickets gets created very late
Some of the ticket missing
OTRS creating ticket for every notification like recovery, alert, warnings
False alert also raising ticket….

Can you share me if you have any standard process documents


#10

Hi Dansmith

Can you please let me know steps to enable OTRS Nagios integration for auto generate ticket from Nagios Alert

Thanks