Article Number: 552 Rating: Unrated Last Updated: Sun, Nov 20, 2016 at 6:09 PM. This guide will show you how to integrate Nagios XI with ServiceNow.

Similar documents
Article Number: 513 Rating: 5/5 from 1 votes Last Updated: Tue, Jul 19, 2016 at 10:09 PM

Article Number: 722 Rating: Unrated Last Updated: Thu, Jul 20, 2017 at 12:31 AM

Article Number: 549 Rating: Unrated Last Updated: Tue, May 30, 2017 at 11:02 AM

It is important to remember that an external worker needs all of the plugins installed on it so it can execute the checks that are handed to it.

This document is intended for use by Nagios Administrators that want to use Slack for notifications.

Article Number: 602 Rating: Unrated Last Updated: Tue, Jan 2, 2018 at 5:13 PM

This is sometimes necessary to free up disk space on a volume that cannot have extra disk space easily added.

Argument 1 = A number (0, 1, 2, 3) that will be used as the exit code the script will exit with (this is how Nagios determines the status)

Bomgar PA Integration with ServiceNow

Understanding Notification Variables

Monitoring Apache Tomcat Servers With Nagios XI

Article Number: 406 Rating: 3/5 from 2 votes Last Updated: Mon, Jun 5, 2017 at 3:08 AM. This document describes how to install NDOUtils from source.

Article Number: 38 Rating: Unrated Last Updated: Thu, Apr 28, 2016 at 9:49 PM

Offloading MySQL to Remote Server

Purpose. Target Audience. Prerequisites. What Is An Event Handler? Nagios XI. Introduction to Event Handlers

Backing Up And Restoring Your Nagios XI System

OK: {C: 68% free / 99.51GB total} 'C: free'= g; ; ;0; 'C: free %'=68%;20;10;0;100

HelpAndManual_illegal_keygen Contactor Elite Autoresponder Installation Guide

Nagios XI Using The Core Config Manager For Host Management

This guide is broken up into several sections and covers different Linux distributions and non- Linux operating systems.

Offloading NDO2DB To Remote Server

Ticketing Service 1 Request Tracker (RT) Installation and Configuration

Purpose. Target Audience. Windows Machine Requirements. Windows Server Core (No Desktop) Nagios XI. Monitoring Windows Using WMI

Building Block Installation - Admins

How To Use The Actions Component

Using The Core Config Manager For Service Management

Administrator Manual. Last Updated: 15 March 2012 Manual Version:

Article Number: 77 Rating: 4.8/5 from 4 votes Last Updated: Mon, Feb 27, 2017 at 5:54 PM

Administrator Manual. Last Updated: 15 March 2012 Manual Version:

MANAGEMENT AND CONFIGURATION MANUAL

MANAGEMENT AND CONFIGURATION MANUAL

Configuring SAP Targets and Runtime Users

Upgrade Instructions. NetBrain Integrated Edition 7.1. Two-Server Deployment

Workspace Administrator Help File

Setting up Omeka on IU s Webserve

This document is intended for use by Nagios XI Administrators who wish to monitor JMX applications.

ZENworks Service Desk 8.0 Using ZENworks with ZENworks Service Desk. November 2018

Reset the Admin Password with the ExtraHop Rescue CD

How to Configure And Text Notifications

Purpose. Target Audience. Installation Overview. Install SDK Prerequisites. Nagios XI. Monitoring VMware With Nagios XI

Table of Contents 1 Citrix Access Gateway 5 VPX Introduction...1

SAS Enterprise Case Management 2.2. Administrator s Guide

Siemens PLM Software. HEEDS MDO Setting up a Windows-to- Linux Compute Resource.

Zend Server Cluster Manager 5.x Installation Guide

ServiceNow: User Guide

8.0 Help for Community Managers Release Notes System Requirements Administering Jive for Office... 6

Quick-Start Tutorial. Airavata Reference Gateway

VMware AirWatch Certificate Authentication for EAS with NDES-MSCEP. For VMware AirWatch

CORAL Resources Module User Guide

Contents Upgrading BFInventory iii

Zend Server Cluster Manager 5.6 Installation Guide

Data Protection Guide

January 12, Prepared by Dina Borisov, Product manager Jetro Platforms. All rights reserved.

Cloud Help for Community Managers...3. Release Notes System Requirements Administering Jive for Office... 6

BlueMix Hands-On Workshop Lab A - Building and Deploying BlueMix Applications

vfire Server Console Guide Version 1.5

Citrix Access Gateway Enterprise Edition 10

Administration Manual

Using SSL/TLS with Active Directory / LDAP

Administration Guide. 05 Apr TM and copyright Imagicle spa

Dell Wyse Management Suite. Version 1.1 Deployment Guide

VMware AirWatch Certificate Authentication for EAS with ADCS

Quick Start Guide (CM)

SO, ARE YOU READY? HERE WE GO:

AVWorks. Installer/User Guide

More Raspian. An editor Configuration files Shell scripts Shell variables System admin

Understanding The User Macros Component

Next. Welcome! This guide will get you started down the path to bulk text messaging excellence. Let s start by going over the basics of the system

Sales Quote Demo Setup

Using the TUI Upgrade Utility to Update an Existing Release 2.4 Server

CUSTOMER PORTAL. Introduction and Guide

This document covers how to manage fused servers in Nagios Fusion.

User Guide. Version R94. English

SAS Enterprise Case Management 2.1. Administrator s Guide

Archive Manager - SMTP feature

Using ZENworks with Novell Service Desk

Setting Up the MPLS VPN Environment

Community Mobile Patrol Officer User Guide v13.4

HOW TO INSTALL E-LD TO E-xD USING CONNECTION TO USB CONSOLE

User Guide. Version R92. English

KOHA 3.4 INSTALLATION ON UBUNTU LINUX. Dibyendra Hyoju August 2011 Madan Puraskar Pustakalaya

Zend Server Cluster Manager 5.5 Beta. Installation Guide. By Zend Technologies.

Question: 1 Which item must be enabled on the client side to allow users to complete certification in offline mode?

SAS Model Manager 2.3

California Naturalist Volunteer Portal. A Quick User Guide to the New Volunteer Management System 3.1

High Availability Failover. Version 1.0

BMC FootPrints 12 Integration with Remote Support

Copyright 2018 VMware, Inc. All rights reserved. Copyright and trademark information.

Getting Started Using Cisco License Manager

AimSniff. Jason Healy, Director of Networks and Systems

User and System Administration

Healthcare Database Connector

ITSM Training for Field Service

User's Guide c-treeace SQL Explorer

Direct Mail Quick Start User Guide. FL-HIE User Guide.v1.5

Storage Manager 2018 R1. Installation Guide

Client Portal Training Manual

Getting Started User s Guide

Smart Connection User Guide

Bitnami Ruby for Huawei Enterprise Cloud

Transcription:

Nagios XI - Integrating ServiceNow Article Number: 552 Rating: Unrated Last Updated: Sun, Nov 20, 2016 at 6:09 PM O ve r vie w This guide will show you how to integrate Nagios XI with ServiceNow. ServiceNow is an online application that provides incident management. Nagios XI can be configured to automatically send notifications to ServiceNow to appear as incidents. Do wnlo a d Pa c ka ge You will need to download the Service Now Ticketer from here: https://exchange.nagios.org/directory/plugins/helpdesk-and-ticketing/service-now-ticketer/details Once downloaded, extract the files as you'll need to upload them as you follow this guide. S e r vic e No w Ac c o unt De t a ils You will need a username, password and URL to insert to the configuration file. The URL will be something like customername.service-now.com and will be required in the configure section later. I ns t a ll Pe r l Pr e - Re quis it e s Open an SSH / Console session to your Nagios XI server. Perl modules need to be installed using these commands: yum install -y perl-dbi perl-xml-simple perl-soap-lite perl-config-inifiles perl-digest-md5-file Some additional Perl modules need installing through CPAN (they are not available through yum as a package). First run cpan to make sure it's configured: cpan If you are presented with the cpan[1]> prompt then it is configured, you can exit: exit The install commands are after these following steps. If you get output such as: Sorry, we have to rerun the configuration dialog for CPAN.pm due to some missing parameters... The following questions are intended to help you with the configuration. The CPAN module needs a directory of its own to cache important index files and maybe keep a temporary mirror of CPAN files. This may be a site-wide or a personal directory. Then CPAN is not configured yet. All you need to do is press Ente r to accept the default option provided (there are several prompts). If prompted for a CPAN mirror, type the following: http://www.perl.com/cpan/ When you are finished you will arrive at the cpan[1]> prompt. Type the following to save the settings you just made: o conf commit Now you can exit as the install commands are done outside of cpan. exit Installation of Perl modules using CPAN is performed using these commands: cpan Getopt::Whatever Wait while the module is installed. If you run the command again it will confirm they are installed with Getopt::Whatever is up to date (x.xx). cpan Config::INI::Reader You will receive this message:

You will receive this message: ---- Unsatisfied dependencies detected during ---- ---- RJBS/Config-INI-0.025.tar.gz ---- Mixin::Linewise::Writers [requires] Mixin::Linewise::Readers [requires] Test::More [requires] Shall I follow them and prepend them to the queue of modules we are processing right now? [yes] Press Ente r to install the dependencies (you may be presented with this multiple times). Wait while the module is installed. If you run the command again it will confirm they are installed with Config::INI::Reader is up to date (x.xxx). C r e a t e Da t a ba s e The ServiceNow integration requires a database to be created which will be called nagsnt. There will also be a dedicated database user account called servicenow with the password servicenow_password (we suggest you use a more secure password). The storage location of the database will be the default location that MySQL / MariaDB uses, this can be changed however it is not covered in this guide. If your database is offloaded Nagios XI has the default root password of 'nagiosxi', if this has been changed you will need to use your password in the following commands. This command will connect to the local MySQL / MariaDB database engine interface. mysql -u root -p'nagiosxi' Now execute these four commands (press Enter after each command): CREATE DATABASE nagsnt DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci; CREATE USER 'servicenow'@'localhost' IDENTIFIED BY 'servicenow_password'; GRANT USAGE ON *.* TO 'nagsnt'@'localhost' IDENTIFIED BY 'servicenow_password' WITH MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 M GRANT ALL PRIVILEGES ON nagsnt.* TO 'servicenow'@'localhost' WITH GRANT OPTION ; Now you can exit the local MySQL / MariaDB database engine interface. \q Run this command to ensure that the database has been created: echo 'show databases;' mysql -u servicenow -p'servicenow_password' -h localhost The last command should output something like: Database information_schema nagsnt test I ns t a ll S c r ipt + C o nf ig File s You will now upload the files you extracted earlier. Open Nagios XI and Navigate to Admin > System Extensions > Ma na g e P lug ins. Click the Brows e button Browse the the extracted files and upload config.ini Repea these steps for field_map.ini and sn_ticker.pl In your SSH / Console session execute the following commands to edit the config.ini file: cd /usr/local/nagios/libexec vi config.ini When using the vi editor, to make changes press i on the keyboard first to enter insert mode. Press Esc to exit insert mode. You will need to change these settings: ; Enable ticket track. enable_tickettrack = 0

; The database settings are only required if you are using ticket track and the tt_type = db [database] db_type = mysql db_username = servicenow db_password = servicenow_password db_port = 3306 db_address = 127.0.0.1 db_database = nagsnt ; The credentials required to log in to service-now [servicenow] sn_username = servicenow_user sn_password = password sn_url = myinstance.service-now.com Specifically these settings relate to the database that was created earlier: db_username = servicenow db_password = servicenow_password db_address = 127.0.0.1 Specifically these settings relate to the Service-Now information that you obtained earlier: sn_username = servicenow_user sn_password = password sn_url = myinstance.service-now.com When you have finished, save the changes in vi by typing :wq and pressing Ente r. Execute the following command to set the field_map.ini file to defaults: sed -i '/^; This is an example entry./q' field_map.ini Build Da t a ba s e + C o nf igur e You will now run a script to build the database. In your SSH / Console session execute the following command: /usr/local/nagios/libexec/sn_ticketer.pl --builddb If the script worked the following output is produced: Database table created succesfully. Execute the following command that will generate the mappings for the field_map.ini file: /usr/local/nagios/libexec/sn_ticketer.pl --page='incident.do' --buildmap If the script worked the the field_map.ini file will contain the following: ; ; The INI Heading is the page to edit and the fields to enter data into are the options for that heading. ; The following special characters are evaluated in the order listed, they must not contain spaces! ; $WORD$ is a substitution option to be specified as an argument ; &EXPRESSION& should be mathematical expression that will be evaluated. ; %PAGE:FIELD:WORD% Using this will lookup the object ID of another service-now entry. ; ^ Fields prefixed with this symbol will be updated ; @ Arguments of fields prefixed with ^ and this symbol will be appended instead of being overwritten. ; WHITESPACE BETWEEN META CHARACTERS IS NOT ALLOWED. [incident.do] closed_at = $closed_at$ incident_state = $incident_state$ group_list = $group_list$ closed_by = $closed_by$ assignment_group = $assignment_group$ category = $category$ expected_start = $expected_start$ description = $description$

watch_list = $watch_list$ upon_reject = $upon_reject$ reopen_count = $reopen_count$ subcategory = $subcategory$ rfc = $rfc$ delivery_task = $delivery_task$ work_notes = $work_notes$ comments_and_work_notes = $comments_and_work_notes$ time_worked = $time_worked$ number = $number$ resolved_by = $resolved_by$ resolved_at = $resolved_at$ sla_due = $sla_due$ correlation_display = $correlation_display$ delivery_plan = $delivery_plan$ activity_due = $activity_due$ ; boolean knowledge = $knowledge$ ; boolean made_sla = $made_sla$ hold_reason = $hold_reason$ opened_at = $opened_at$ parent_incident = $parent_incident$ approval_set = $approval_set$ priority = $priority$ reassignment_count = $reassignment_count$ comments = $comments$ state = $state$ order = $order$ assigned_to = $assigned_to$ business_duration = $business_duration$ child_incidents = $child_incidents$ calendar_stc = $calendar_stc$ parent = $parent$ location = $location$ ; boolean active = $active$ calendar_duration = $calendar_duration$ follow_up = $follow_up$ short_description = $short_description$ work_start = $work_start$ due_date = $due_date$ user_input = $user_input$ impact = $impact$ approval_history = $approval_history$ opened_by = $opened_by$ problem_id = $problem_id$ business_service = $business_service$

upon_approval = $upon_approval$ company = $company$ caused_by = $caused_by$ notify = $notify$ severity = $severity$ additional_assignee_list = $additional_assignee_list$ business_stc = $business_stc$ urgency = $urgency$ close_code = $close_code$ approval = $approval$ contact_type = $contact_type$ close_notes = $close_notes$ work_end = $work_end$ cmdb_ci = $cmdb_ci$ correlation_id = $correlation_id$ escalation = $escalation$ caller_id = $caller_id$ work_notes_list = $work_notes_list$ Information on what all this means is explained at the end of this guide under the "Field Mapping" section. C r e a t e No t if ic a t io n C o mma nds You will now create the notification commands in Nagios XI. Open Nagios XI and Navigate to Configure > C o re C o nfig urura tio n Ma na g e r (CCM). Expand Commands and click >_C omma ndss Click the + Ad d Ne w button Command Name: notify-host-by-snt Command Line: $USER1$/sn_ticketer.pl --page="incident.do" --host="$hostname$" --state="$hoststate$" --category="nagios" --short_description="$ Command Type: Active: mis c comma nd C he c ke d Click S a ve Click the + Ad d Ne w button Command Name: notify-service-by-snt Command Line: $USER1$/sn_ticketer.pl --page="incident.do" --host="$hostname$" --state="$hoststate$" --category="nagios" --short_description="$ Command Type: Active: Click S a ve mis c comma nd C he c ke d

C r e a t e S e r vic e No w Na gio s XI Us e r (C o nt a c t ) To be able to send to ServiceNow you need a contact object created in CCM. The simplest way to do this is to create a Nagios XI user account for ServiceNow and that in turn will cre Navigate to Admin > Users > Ma na g e Us e rs. Click Ad d Ne w Us e r General Settings Username: See rvicee Noww Password & Repeat Password (accept the auto generated password, you won't need to use it) Force Password Change at Next Login: Un- - c he c k Email User Account Information: Un- - c he c k Username: See rvicee Noww Email: See rvicee Now@loca c a lhoss t (it's not important and is not used) Create as Monitoring Contact: C he c ke d Enable Notifications: C he cke d Account Enabled: C he c ke d Security Settings Authorization Level: Us e r Can see all objects: C he c ke d Has read-only access: C he c ke d Click the Ad d Us e r button to create the user The new user should appear in the list. As s ign No t if ic a t io n C o mma nds To C o nt a c t You will now assign the notification commands in CCM to the ServiceNow contact. Navigate to Configure > C o re C o nfig urura tio n Ma na g e r (CCM). Expand Alerting and click C o nta c ts C lic k the s e rvic e no w contact to edit it Ale rt SeS e ttings s tab Click the Ma na g e Ho s t No tific a tio n C o mma nd s button In the le ft pane select the no tify- ho s t- b y- s nt command Click the Ad d S e le c te d > button Click the C los s e button Click the Ma na ge g e SeS e rvice e Notifica a tion n C ommao nds s button In the le ft pane select the no tify- s e rvic e - b y- s nt command Click the Ad d S e le c te d > button Click the C los s e button Click the SaS a ve button Click the Apply C onfigura tion button As s ign C o nt a c t To Ho s t And S e r vic e O bje c t s The last part of this step is to assign the contact to host and service objects that you want to send notifications to ServiceNow. In this example, the built in service "Service Status - ntpd" for the localhost object will be used. We can easily stop the service to force the Nagios service to fail and hence the notifica Navigate to Configure > C o re C o nfig urura tio n Ma na g e r (CCM). Expand Monitoring and click See rvicee s C lick k the Se rvice Sta tus - ntpd service to edit it Ale rt SeS e ttings s tab Click the Ma na g e C o nta c ts button In the le ft pane select the s e rvic e no w contact Click the Ad d S e le c te d > button Click the C los s e button

Click the SaS a ve button Click the Apply C onfigura tion button Now to cause the service to fail by stopping the service: service ntpd stop Watching the /usr/local/nagios/var/nagios.log we can see it fail and send the alert: [1476416134] SERVICE ALERT: localhost;service Status - ntpd;unknown;soft;1;ntpd is stopped [1476416182] SERVICE ALERT: localhost;service Status - ntpd;unknown;soft;2;ntpd is stopped [1476416240] SERVICE ALERT: localhost;service Status - ntpd;unknown;soft;3;ntpd is stopped [1476416283] SERVICE ALERT: localhost;service Status - ntpd;unknown;hard;4;ntpd is stopped [1476416283] SERVICE NOTIFICATION: nagiosadmin;localhost;service Status - ntpd;unknown;xi_service_notification_handler;ntpd is stopped [1476416283] SERVICE NOTIFICATION: servicenow;localhost;service Status - ntpd;unknown;notify-service-by-snt;ntpd is stopped You will see something similar on the ServiceNow Incidents page: Now to let the service recover by starting the service: service ntpd start Watching the /usr/local/nagios/var/nagios.log we can see it recover and send the alert: This is a success/output message from running a command: [1476416577] SERVICE ALERT: localhost;service Status - ntpd;ok;hard;4;ntpd (pid 13847) is running... [1476416577] SERVICE NOTIFICATION: nagiosadmin;localhost;service Status - ntpd;ok;xi_service_notification_handler;ntpd (pid 13847) is [1476416577] SERVICE NOTIFICATION: servicenow;localhost;service Status - ntpd;ok;notify-service-by-snt;ntpd (pid 13847) is running... You will see something similar on the ServiceNow Incidents page:

You can also see the Service Notifications in Nagios XI to see that the ServiceNow contact was notified: Ne xt S t e ps At this point you should go and assign the contact to the required host and service objects in CCM. Fie ld Ma pping Field mapping is how the data from Nagios is assigned to the appropriate fields in ServiceNow. Looking at an extract from the command notify-service-by-snt : --short_description="$servicedesc$ on $HOSTNAME$ is $SERVICESTATE$" Looking at an extract from the /usr/local/nagios/libexec/field_map.ini file: short_description = $short_description$ When Nagios executes the sn_ticketer.pl script it provides the argument --short_description="xxxx". Everything between the double quotes is dynamic information from Na Any of the field mappings defined in the field_map.ini file can be referenced by the sn_ticketer.pl script, this allows you to customise what information Nagios sends to Servic All of the available Nagios macros can be found at this link: Standard Macros In Nagios Here is another example. Looking this command: $USER1$/sn_ticketer.pl --page="incident.do" --host="$hostname$" --state="$hoststate$" --category="nagios" --short_description="$hostnam You can append any new variable from Nagios to match one from your mappings. For example, if you want to populate the severity field in service now, and you have a mapping av severity = $severity$ You can use the $HOSTSTATEID$ macro in Nagios XI to populate the severity field in service now, this is done by appending this to the end of the command: --severity="$hoststateid$" The total command is now: $USER1$/sn_ticketer.pl --page="incident.do" --host="$hostname$" --state="$hoststate$" --category="nagios" --short_description="$hostnam

Fina l Tho ught s For any support related questions please visit the Nagios Support Forums at: http://support.nagios.com/forum/ Posted by: tle a - Thu, Oct 13, 2016 at 7:11 PM. This article has been viewed 4681 times. Online URL: https://support.nagios.com/kb/article/nagios-xi-integrating-servicenow-552.html