Skip to main content

ServiceNow Event Manager

How it works​

Overview​

Servicenow Stream-connector send business activities, hosts and services check results from centreon-engine to ServiceNow using its REST API and ServiceNow Event Manager

You can send the data you want to your ServiceNow instance, simply pick the implementation which best match your needs:

architecture

Data​

Here is the default data mapping description helping you understand how the data is going to be processed in Service Now.

Host event

CentreonServiceNow Event Manager fieldDescription
hostnamenodeThe hostname
outputdescriptionThe Centreon Plugin output
last_checktime_of_eventThe time of the event
hostnameresourceThe hostname
statusseverityThe severity level depends on the host status

Service event

CentreonServiceNow Event Manager fieldDescription
hostnamenodeThe hostname
outputdescriptionThe Centreon Plugin output
last_checktime_of_eventThe time of the event
service_descriptionresourceThe service name
statusseverityThe severity level depends on the host status

Compatibility​

  • Madrid
  • New York
  • Orlando
  • Quebec

Requirements​

  • ServiceNow Event Manager integration requires an Event Manager License
  • A ServiceNow OAuth account is needed for the stream connector to POST events over the Snow API. Refer to their official documentation.
  • The ServiceNow account must have the following privileges: evt_mgmt_integration
  • It is also necessary to use a Centreon account with either admin privileges or Export configuration and Broker configuration menu access in the WUI, as well as a root access in command-line interface.

Integration Walkthrough​

Download the Stream-connector source code​

Login as root on the Centreon central server using your favorite SSH client.

Install the required lua dependencies distributed through Centreon official repositories:

yum install -y lua-curl

Download the connector source code:

wget -O /usr/share/centreon-broker/lua/servicenow.lua https://raw.githubusercontent.com/centreon/centreon-stream-connector-scripts/master/centreon-certified/servicenow/servicenow-apiv1.lua
chmod 644 /usr/share/centreon-broker/lua/servicenow.lua

The ServiceNow Stream-connector is now installed on your Centreon central server!

Configure Centreon-Broker output​

  1. Login to the Centreon GUI using an administrator account.
  2. Navigate to the Configuration > Pollers menu and select Broker configuration.
  3. Click on the central-broker-master broker configuration object and navigate to the Output tab.
  4. Add a new Generic - Stream connector output.
  5. Name it as you want (eg. ServiceNow) and set the right path for the LUA script: /usr/share/centreon-broker/lua/servicenow.lua.
NameTypeValue
instanceStringInstance name: <your-instance>.service-now.com
usernameStringServiceNow username
passwordStringServiceNow password
client_idStringServiceNow OAuth ClientId
client_secretStringServiceNow OAuth ClientSecret
  1. Save your configuration, then navigate to the Configuration > Pollers menu and select Pollers.
  2. Select the Central poller and click on Export configuration.
  3. Keep Generate Configuration Files and Run monitoring engine debug (-v) checked and select Move Export Files and then click on the Export button.
  4. Restart the cbd service:
systemctl restart cbd

Now your central server has loaded the ServiceNow SC and has started to send data!

To make sure that everything goes fine, you should have a look at central-broker-master.log and connector-servicenow.log, both located in /var/log/centreon-broker.

Advanced configuration​

Event filtering

To optimize datas passing through the Stream-connector, you can optionnaly select Neb in Filter Category.

Parameters table

NameTypeDefault valueDescription
proxy_addressString``If needed, the address of the proxy server (requires proxy_port option)
proxy_portString``The port of the proxy server
proxy_usernameString``If needed, the proxy user (requires proxy_password option)
proxy_passwordString``the proxy user password
logfileString/custom/path/to/connector-snow.loglogfile for the stream connector
host_statusString0,1,2send event for up, down and unreachable hosts
service_statusString0,1,2,3send event for ok, warning, critical, unknown services
hard_onlyNumber1Only send events in hard state
acknowledgedNumber0Only send events that are not acknowledged
element_typeStringhost_status,service_statusSend host and service centreon status event
category_typeStringNebFilter out non Neb events
in_downtimeNumber0Only send events that are not in downtime
max_buffer_sizeNumber10Send 10 events at a time unless max_buffer age is reached before
max_buffer_ageNumber5Store events for 5 second before sending them unless max_buffer_size is reached before
max_stored_eventsNumber10Keep event in cache to avoid sending duplicated events, change with caution
skip_anon_eventsNumber1Do not send events from hosts or services that are not found in the broker cache
skip_nil_idNumber1Do not send events from objects that do not have an ID (meta services most of the time)

How to Uninstall​

  1. Login to the Centreon WUI using an administrator account.
  2. Navigate to the Configuration > Pollers menu and select Broker configuration.
  3. Click on the central-broker-master broker configuration object and navigate to the Output tab.
  4. Delete the Generic - Stream connector output by clicking on the red circled cross at the end of the line.
  5. Save your configuration, then navigate to the Configuration > Pollers menu and select Pollers.
  6. Select the Central poller and click on Export configuration.
  7. Keep Generate Configuration Files and Run monitoring engine debug (-v) checked and select Move Export Files and then click on the Export button.
  8. Restart the cbd service:
systemctl restart cbd

The Stream Connector is not loaded anymore!

  1. Optionally, you can even delete the script file:
rm -f /usr/share/centreon-broker/lua/servicenow.lua