OTRS Trouble Ticket Integration
Subscribe

From OpenNMS

(Redirected from OTRS Integration)
Jump to: navigation, search

Contents

Introduction

Integration together OpenNMS and OTRS allows one to create and manage OTRS tickets from OpenNMS alarms.

When integration is enabled, 3 new buttons get displayed on the "alarm details" pages ("Create ticket", "Update ticket", "Close ticket"), and the alarm 'state is synchronized with the corresponding ticket 'state in OTRS (ie: ticket can be closed either from OTRS or openNMS, its state will be reflected on the other side). Also, buttons are activated/deactivated accordingly.

Alarm without corresponding ticket

Alarm2ticket NoTicketYet.png

Alarm with an opened ticket

Alarm2ticket ticketStateIsOpen.png

Alarm with an closed ticket

Alarm2ticket ticketStateIsClosed.png

OTRS OpenNMS package information

Read this carefully. OTRS changed between version 2.3 and 2.4. You will need to choose the correct OTRS OpenNMS package for your OTRS installation.

  • Version 1.0.0 has been tested with OTRS versions up to 2.3. It does not work with OTRS 2.4. Version 1.0.0 is only available from the OpenNMS SourceForge page.
  • Version 1.1.0 has been tested with OTRS version 2.4. Version 1.1.0 is available from the OpenNMS SourceForge page _and_ the OTRS master repository
  • Version 1.2.0 has been tested with OTRS version 2.4. Version 1.2.0 is available from the OpenNMS SourceForge page. It has not yet been published in the OTRS master repository.

Version 1.2.0 or the OTRS OpenNMS package is recommended for OTRS version 2.4 or later.

Prerequisite information

  • A change in version 0.712 of SOAP::Lite means that it will not work with mod_perl which is used by OTRS. Version 0.714 fixes this issue and should be installed through CPAN if your distribution does not have it pre-packaged.
  • To get the current OpenNMS-1.2.0 package to work with version 3.0.x of OTRS, the .sopm file of the OpenNMS-1.2.0 source package needs to be amended with this addition and the package built.
     .
     .
    <Framework>2.2.x</Framework>
>   <Framework>3.0.x</Framework>
    <IntroInstallPre Lang="en" Title="Ticket interface for OpenNMS">
     .
     .

You can check out the source into a local git repo with:

git clone git://opennms.git.sourceforge.net/gitroot/opennms/otrs-opennms

and build following instructions at http://doc.otrs.org/developer/3.0/en/html/how-to-publish.html

Install the OpenNMS package in OTRS

  1. Ensure you have the correct prerequisite Perl modules installed on your OTRS host.
    • Version 1.0.0 and 1.1.0 of the OpenNMS package for OTRS require SOAP::Lite, and SOAP::DateTime Perl modules.
    • Version 1.2.0 of the package requires SOAP::Lite and Date::Manip (it no longer requires SOAP::DateTime).
  2. To get the installation package for this module either:
    • Visit the OpenNMS SourceForge page: http://sourceforge.net/projects/opennms/files/ and download a copy of the package to your OTRS server, or
    • Go straight to step 3 below and install directly from the OTRS master repository (only works for version 1.1.0). You will need internet access from your OTRS host for this.
  3. Add the package to otrs
    • At the webUI for OTRS, go to Admin->Package Manager.
    • Add the OpenNMS package, either the copy that you previously downloaded or direct from the OTRS master repository.
  4. Add the SOAP user to OTRS
    • At the webUI for OTRS, go to Admin->SysConfig.
    • Show the Group for "Framework".
    • Select Core::SOAP
    • Set the SOAP::User and SOAP::Password (the sample java code expects opennms/opennms but you should use a "proper" password for production). The opennms package uses the same authentication technique as the existing SOAP handle.
  5. Check the path to the perl binary in $OTRS_HOME/bin/cgi-bin/opennms.pl. The package does not check for the location of your perl binary, and assumes it's /usr/bin/perl. If this is not the case then you will have to modify the cgi by hand.

Install OTRS Trouble Ticket Plugin in OpenNMS

The implementation of the OTRS plugin is as simple as the following steps:

  • Edit the $OPENNMS_HOME/etc/opennms.properties file and change this:
opennms.ticketer.plugin=org.opennms.netmgt.ticketd.NullTicketerPlugin

to something like this:

opennms.ticketer.plugin=org.opennms.netmgt.ticketer.otrs.OtrsTicketerPlugin
opennms.alarmTroubleTicketEnabled = true
opennms.alarmTroubleTicketLinkTemplate = <a href="http://localhost/otrs/index.pl?Action=AgentTicketZoom&TicketNumber=${id}">${id}</a>

(obviously you will want to specify the hostname of your otrs server, rather than "localhost")

  • Edit the $OPENNMS_HOME/etc/otrs.properties file and change the following according to your installation:
otrs.endpoint=http://localhost/otrs/opennms.pl
otrs.username=opennms
otrs.password=opennms
otrs.state=new
otrs.priority=3 normal
otrs.lock=unlock
otrs.queue=Raw
otrs.articletype=note-external
otrs.defaultuser=root@localhost
otrs.articlefrom=jonathan@opennms.org
otrs.articlesendertype=agent
otrs.articlecontenttype=text/plain; charset=ISO-8859-15
otrs.articlehistorycomment=update by OpenNMS
otrs.articlehistorytype=OwnerUpdate
otrs.ownerid=1
otrs.validopenstateid=1, 4, 6, 7, 8
otrs.validclosedstateid=2, 3, 9
otrs.validcancelledstateid=5
otrs.openstateid=1
otrs.closedstateid=2
otrs.cancelledstateid=5
otrs.ticketopenedmessage=Ticket opened by OpenNMS
otrs.ticketclosedmessage=Ticket closed by OpenNMS
otrs.ticketcancelledmessage=Ticket cancelled by OpenNMS
otrs.ticketupdatedmessage=Ticket updated by OpenNMS
otrs.articleupdatesubject=Ticket update from OpenNMS

Key fields that you will need to update are:

  • otrs.endpoint - you will need to substitute the domain name for your OTRS server here.
  • otrs.username=opennms - this will need to be the SOAP user you configured in the OTRS framework.
  • otrs.password=opennms - this will need to be the SOAP password that you configured in the OTRS framework.
  • otrs.articlefrom - This will be the eMail that the ticket appears from - you probably don't want to use my eMail address ;-).
  • otrs.ticketopenedmessage etc. - This allows you to localize the OTRS article body when the state of a ticket is changed via OpenNMS.
  • otrs.articleupdatesubject - This allows you to localize the OTRS article subject the state of a ticket is changed via OpenNMS.

If you are running OTRS 2.4, you can optionally change:

otrs.articlecontenttype=text/plain; charset=ISO-8859-15

to

otrs.articlecontenttype=text/html; charset=ISO-8859-15

This will allow OTRS to render the HTML from Alarms correctly (thanks Patrick).

Version History/Availability