Skip to main content

In this article we will see how to create automatic tickets in your favorite ITSM tool with Open-Ticket module.
 

What is the Open-Ticket module?
 

If you are here and want to automation this, you already know this… but a reminder is never useless.

This module is designed to easily create formatted tickets on an ITSM tool and in case of API usage, have the ability to automatically acknownledge hosts and services with ticket number in Centreon over custom view and a dedicated widget.

You can find most informations about ITSM tool supported in the online documentation here.
 

What is the automatic creation ticket objective?
 

By default, Open-Ticket is able to manually create a ticket through an API call or by email. You select your alert service and click on “create a ticket”.

Automation frees you from these manipulations by automatically sending information to your ITSM tools.


How do I implement the automation?
 

We start of principle the open-ticket module is installed and works correctly. If not, follow this procedure: https://docs.centreon.com/docs/alerts-notifications/ticketing-install/


Step 1: Install the plugin to manage notifications

Install it on all your pollers able to send notifications (central too if makes monitoring)

On Debian

apt install centreon-plugin-notification-centreon-opentickets-api

On RHEL / Alma Linux / Oracle Linux

dnf install centreon-plugin-notification-centreon-opentickets-api


Step 2: Create the notification commands on the UI

  • Go to Configuration > Commands > Notifications menu
  • Create two new commands for host and service notifications like this:

For host:

$CENTREONPLUGINS$/centreon_notification_centreon_opentickets_api.pl --mode=open-host --api-hostname=<CENTRALNAME_OR_IP> --api-username=<CENTREONUSER_LOGIN> --api-password='<CENTREONUSER_PASSWORD>' --rule-name=<OPENTICKET_RULE_NAME> --host-id=$_HOSTID$ --host-state=$HOSTSTATE$ --host-output="$HOSTOUTPUT$" --last-host-statechange=$LASTHOSTSTATECHANGE$

For service:

$CENTREONPLUGINS$/centreon_notification_centreon_opentickets_api.pl --mode=open-service --api-hostname=<CENTRALNAME_OR_IP> --api-username=<CENTREONUSER_LOGIN> --api-password='<CENTREONUSER_PASSWORD>' --rule-name=<OPENTICKET_RULE_NAME> --host-id=$_HOSTID$ --service-id=$_SERVICEID$ --service-state=$SERVICESTATE$ --serviceoutput="$SERVICEOUTPUT$" --last-service-state-change=$LASTSERVICESTATECHANGE$

with:

<CENTRALNAME_OR_IP> : Centreon URL or IP

<CENTREONUSER_LOGIN> : admin user without access to the UI (see creation below)

<CENTREONUSER_PASSWORD> : his password

<OPENTICKET_RULE_NAME> : Open-tickect rule name

the result could be like this for host notification:

You can add some other informations in the command line like custom message, selected value in dropdown list (for example your workspace or the team to affect or the priority of the ticket), in fact all the mandatory fields to create a ticket

 --extra-property='custom_message=automatic opening' --select='jira_project=Support' --select='jira_issuetype=Send Issue'

where “jira_project” is the name of the project field in Jira and “Support” is the project name to affect

The field names and his values are defined in your ITSM tool and getted by open-ticket to manage it.

  • Save it.


Step 3: Create a dedicated user for those commands

  • Go to Configuration > Users > Contacts / Users menu and create a new user:

No need a valid email because using API

No need a UI access

Needs admin rights

Set classicaly the notification options you need and commands created previously

  • Save your new contact.


Step 4: Define hosts or services you want to automatically create ticket

As same as other notifications, set the dedicated open-ticket notification contact and notification options (timeperiod and statuses) to the hosts and services you want to automatically create tickets.

Save and export the configuration on pollers needed.

 

Be carreful to fully qualified hosts and services selected for automation to avoid a lot of tickets on your ITSM tool.

 

That’s all. Have fun to resolve your automatically created tickets.

Be the first to reply!

Reply