Monitoring Nagios Using Opsgenie
How do you monitor Nagios? Opsgenie has an easy-to-use plugin that sends heartbeat messages to Opsgenie API. Nagios runs this plugin periodically. If Opsgenie does not receive a heartbeat for a configurable time period, it notifies appropriate people via email, iOS & Android push notifications, SMS and phone calls.
Instructions to use Opsgenie Nagios Plugin:
- Please create an Opsgenie account if you haven't done already.
- Add a heartbeat in Opsgenie Heartbeats page.
- Create an Opsgenie Heartbeat integration from Integrations page and copy its Api key.
- Download the Nagios Heartbeat plugin from its GitHub release page and put the binary file into your Nagios libexec directory.
- Define a command in Nagios like so:
define command{
command_name opsgenie_heartbeat
command_line /usr/local/Nagios/libexec/heartbeat -apiKey $ARG1$ -name $ARG2$
}
- Define a service that will run the command like so:
define service {
service_description OpsGenie Heartbeat
host_name localhost
check_interval 10
check_period 24x7
max_check_attempts 60
retry_interval 1
notification_interval 60
check_command opsgenie_heartbeat!API_KEY!HEARTBEAT_NAME
}
where API_KEY is the api key you acquired from Opsgenie Heartbeat integration and HEARTBEAT_NAME is the name of the heartbeat you added.
- For details about defining command and service in Nagios, see Nagios Object Definitions doc.
- For details about Opsgenie Heartbeats and how to use them, refer to our Heartbeat Monitoring Document.
- Source code of the Heartbeat Plugin is available at GitHub
Troubleshooting
Make sure the binary file heartbeat is executable.
Updated over 5 years ago