Icinga2 Integration Guide
Icinga 2 is an open source monitoring system which checks the availability of your network resources, notifies users of outages and generates performance data for reporting. Scalable and extensible, Icinga 2 can monitor large, complex environments across multiple locations.
What can Zenduty do for Icinga2 users?
With the Icinga2 Integration, Zenduty sends new Icinga2 host and service downtime alerts to the right team and notifies them based on on-call schedules via email, text messages(SMS), phone calls(Voice), Slack, Microsoft Teams and iOS & Android push notifications, and escalates alerts until the alert is acknowledged or closed. Zenduty provides your application engineers with detailed context around the Humio alert along with playbooks and a complete incident command framework to triage and remediate and resolve incidents with speed.
Whenever an alert is created on Icinga2(host or service downtime or threshold breach), Zenduty will create an incident. When the alert is resolved on Icinga2(host or service up), Zenduty will auto-resolve the incident.
You can also use Alert Rules to custom route specific Icinga2 alerts(depenging on the host, service or metric) to specific users, teams or escalation policies, write suppression rules, auto add notes, responders and incident tasks.
To integrate Icinga2 with Zenduty, complete the following steps:
In Zenduty:
-
To add a new Icinga2 integration, go to Teams on Zenduty and click on the team you want to add the integration to.
-
Next, go to Services and click on the relevant Service.
-
Go to Integrations and then Add New Integration. Give it a name and select the application Icinga2 from the dropdown menu.
-
Go to Configure under your integrations and copy the Webhook URL generated.
In Icinga2:
-
Install the Icinga2 software on your system.
[IMPORTANT]
{: .text-gamma .text-blue-300 }
Make sure you have Python2 installed on your system.
{: .text-blue-300 } -
After this, add an integration to your Zenduty account. This is NOT the integration automatically provided to you.
-
Then, download the Zenduty-Icinga2 files by following the steps given below:
$ cd /tmp $ git clone https://github.com/Zenduty/icinga-zenduty-script.git $ cd icinga-zenduty-script
-
Now open the Zenduty-Icinga2 configuration file and enter the provided integration key into the pager field.
-
Now, move the files into their respective folders inside /etc/icinga2/.
-
The Zenduty-Icinga2.conf file must go to the conf.d folder (or the objects.d folder, whichever exists).
$ mv zenduty-icinga2.conf /etc/icinga2/conf.d/ OR $ mv zenduty-icinga2.conf /etc/icinga2/objects.d/
-
The zenduty-webhook-notification.py file must go to the scripts folder.
$ mv zenduty-webhook-notification.py /etc/icinga2/scripts/
-
Ensure that ‘ICINGAADMINS’ exists as a user group. If not, define it as follows in the users.conf file in conf.d folder.
$ object UserGroup "icingaadmins" { $ display_name = "Icinga 2 Admin Group" }
-
Now add the custom attribute enable_zenduty to your configuration’s host and service configuration objects for all hosts and services you wish to receive alerts from.
$ vars.enable_zenduty = true
For example:
``` object Host "wp1.example.com" { import "web-server" import "wp-server" vars.ssh_port = 2222 address = "192.168.56.201" vars.enable_zenduty = true # Add this line for each host } ```
-
If the number of objects is large then you can add the above line to the generic-host and generic-service templates in the templates.conf file in the conf.d folder.
-
Finally you can import this template to your objects.
-
Restarting Icinga2 service:
$ /etc/init.d/icinga2 restart
-
Icinga2 is now integrated with Zenduty!