Nagios Service-Now Ticketer

**DEVELOPMENT OF THIS PLUGIN HAS CEASED AS OF 14/6/2014, IF YOU WOULD LIKE TO TAKE OVER THIS PROJECT PLEASE SEE THE CONTACT US PAGE**

Description:

A complex alert integration script for Nagios that can open and update tickets in Service-Now.

Download:

https://github.com/jsmroshamboot/NSNT/archive/master.zip

Known Issues:

Certain meta-characters (most notably the ampersand) will cause the script to fail when trying to parse information to certain fields to Service-Now.

Patch Notes:

v1.2:

  • Now requires and loads XML::Simple to resolve some distro compatibility issues. (Thanks KL)

  • When doing a builddb it now attempts simple authentication when talking to the WSDL. This must have been a security hole fixed in the Service-Now Dublin update. (Thanks KL)

  • No longer bewildering writes the data-type of extracted fields when doing a builddb to nothing in particular. (Thanks KL)

v1.1:

  • Fixed Storm Watch database string error preventing it from operating properly when dropping tickets. (thanks AM)

  • Fixed the script being ignorant of the host UP state. (thanks AM)

v1.0:

  • Removed unnecessary code.

  • Fixed several bugs relating to Storm Watch logic.

  • *NEW* swservice* feature that checks the total tickets for an individual service and suppresses if necessary.

  • swhost* will now ignore a particular service if it is being too noisy when determining if all the tickets from a particular host need to be suppressed.

  • swtotal* will now ignore hosts/services that are being too noisy when determining if it needs to suppress tickets.

  • *NEW* logrotate feature added to assist with creating a log rotate entry.

  • *NEW* patching feature added to assist when upgrading from old versions to new versions.

  • *NEW* Ticket Track now hashes incoming messages, this is used to prevent duplicate tickets or updating tickets too regularly.

  • Updated some of the default settings in config.ini to be more typical for new installs.

v0.2:

  • Corrected Storm Watch behaviour so that it does a better job of preventing unwanted noise.

  • Improved logging text to be more useful.

  • Added additional logic to database clean up.

v0.1:

  • First release

Usage:

Please read the README included in the zip file for full instructions.

Below are the Pre-Install requirements and installation instructions:-

Pre-Install Requirements

=========================================

  • MySQL Database

  • Openssl-devel package

  • Install the below Perl modules

  • DBI

  • Soap::Lite

  • Config::INI::Reader

  • Getopt::Whatever

  • Digest::MD5

  • Config::IniFiles

  • Service-Now SOAP API must be enabled, refer to Service-Now documentation for more details.

You may additionally need the following perl modules (thanks AM):

  • IO::Socket::SSL

  • Crypt::SSLeay

  • Net::SSLeay

  • IO::String

  • Mixin::Linewise

Installation

=========================================

  1. Copy the files contained within this zip file to your /usr/local/nagios/libexec/eventhandlers or /usr/local/nagios/libexec directory.

  2. Log in to your database as an administrative user (probably root) then create the service-now ticketer database: CREATE DATABASE nagsnt;

  3. Create a MySQL user for the nagios service-now ticketer database: CREATE USER ‘nagsnt’@‘nagios_ip_address’ IDENTIFIED BY ‘user_password’;

  4. Grant the user priveleges to the database: GRANT ALL PRIVILEGES ON nagsnt.* TO ‘nagsnt’@‘nagios_ip_address’;

  5. Navigate to the directory you extracted the snt files on the Nagios server, open the config.ini file.

  6. Read the configuration section below and set the option in the INI file, save and exit.

  7. Run the table builder: ./sn_ticketer.pl -builddb

Optionally you can use the default field_map.ini settings but in the likely case you need to customize it do one of the following:

  1. If you are familiar with the service-now page field formats then read the Field mapping section below, then open the field_map.ini and begin mapping.

OR

9a. If you are NOT familiar with the service-now page field formats then create a backup copy of field_map.ini

9b. Open field_map.ini and remove all the default [incident.do] configuration settings, save and exit.

9c. Run the map builder: ./sn_ticketer.pl -page=‘incident.do’ -buildmap

9d. Open the field_map.ini, if everything went well it should now contain all of the available fields for creating incidents.

9e. Remove all of the fields you don’t need and read the Field mapping section below to learn more about configuration.


Upgrading

  1. When upgrading from an older version be sure to run ./sn_ticketer.pl -applypatches

  2. Once this completes, check your config.ini for new options and adjust accordingly.


Usage

./sn_ticketer.pl -page=”” [-host=”” -passive - [-service=”” -state=””]] [-builddb] [-applypatches] [-logrotate] [-buildmap]

-page

The page in the field map you wish to use for this alarm.

-host

The host that triggered this alarm, required when ticket track is enabled.

-service

Required option for ticket track to operate properly when the alarm is service related.

-state

The host/service state. Setting this is highly recommended when using ticket track otherwise it won’t operate properly.

-passive

If this notification is related to passive data set this flag so that the ticket isn’t kept alive.

-

Customargs are defined by using the $$ symbols in the fieldmap file. Please see the readme for more details.

-builddb

Creates the database table required for ticket track operation.

-applypatches

Applies database and config file patches to ensure compatability with latest sn_ticketer version.

-logrotate

Create log rotate entry.

-buildmap

Generate the field mappings for a given Service-Now page.

-help

Display this help text.