Nagios plugin

3 minute readExtensibilityDeveloper productivity

The CloudBees CD/RO Nagios plugin interacts with the Nagios’s command-line tool and the Nagios utility allows you to perform different actions with the same results that you would get from the web-based interface.

The Nagios plugin implements the most important actions to manipulate hosts and host groups and allows the enabling and disabling of hosts and host groups.

CloudBees CD/RO itself provides some advantages like parameter checking, easy functionality selection using only checkboxes, combo buttons, historical log reports, procedure duration statistics, simple credentials attachment, and real-time analysis of the log been generated, among others.

CloudBees CD/RO is unable to retrieve historical log reports and all the actions associated with this because of the way Nagios works. Due to this, you must be careful when specifying the parameters, because there is no way to determine if the procedure will be successful.

Plugin Version 1.0.3.2020102201

More information can be found at Nagios.

CloudBees CD integration to nagios

The plugin interacts with the Nagios’s command-line tool, the Nagios utility allows you to perform different actions getting the same results that you would get from the web-based interface.

EC-Nagios implements the most important actions to manipulate Host and Host Groups. It allows the enabling and disabling of Host and Host Groups.

CloudBees CD itself provides some advantages like parameters checking, easy functionality selection using only check boxes, combo buttons, historical log reports, procedure duration statistics, simple credentials attachment, real time analysis of the log been generated, among others.

There are two issues to take into account, CloudBees CD in this particular case is unable to get historical log reports and all the actions associated with this because of the way Nagios works. These also means that the user must be really careful when writing the parameters, because there is no way to know if the procedure goes wrong or right.

Integrated version

This plugin was developed and tested against Nagios Core version 3.4.1

Plugin procedures

For all parameter descriptions below, required parameters are shown in bold italics.

DisableHostNotifications

Disables notifications for a particular host.

  • Command to be executed: printf "[$TimeStamp] DISABLE_HOST_NOTIFICATIONS;$Host\n" > $commandFileLocation

Parameter Description

Host

Specify the host that you want to disable. (Required)

Command File Location

Specify the location of the command file with the command_file option. Its best to put the external command file in its own directory (i.e. /usr/local/nagios/var/rw). The default value for this parameter is /usr/local/nagios/var/rw/nagios.cmd, this file should have enabled writing permissions.

Parameter form

EnableHostNotifications

Enables notifications for a particular host.

  • Command to be executed: printf "[$TimeStamp] ENABLE_HOST_NOTIFICATIONS;$Host\n" > $commandFileLocation

Parameter Description

Host

Specify the host that you want to enable. (Required)

Command File Location

Specify the location of the command file with the command_file option. Its best to put the external command file in its own directory (i.e. /usr/local/nagios/var/rw). The default value for this parameter is /usr/local/nagios/var/rw/nagios.cmd, this file should have enabled writing permissions.

Parameter form

DisableHostGroupNotifications

Disables notifications for all hosts in a particular hostgroup.

  • Command to be executed: printf "[$TimeStamp] DISABLE_HOSTGROUP_HOST_NOTIFICATIONS;$hostGroup\n" > $commandFileLocation

Parameter Description

Host Group

Specify the host group that you want to disable. (Required)

Command File Location

Specify the location of the command file with the command_file option. Its best to put the external command file in its own directory (i.e. /usr/local/nagios/var/rw). The default value for this parameter is /usr/local/nagios/var/rw/nagios.cmd, this file should have enabled writing permissions. (Required)

Parameter form

EnableHostGroupNotifications

Enables notifications for all hosts in a particular hostgroup.

  • Command to be executed: printf "[$TimeStamp] ENABLE_HOSTGROUP_HOST_NOTIFICATIONS;$hostGroup\n" > $commadFileLocation

Parameter Description

Host Group

Specify the host group that you want to enable. (Required)

Command File Location

Specify the location of the command file with the command_file option. Its best to put the external command file in its own directory (i.e. /usr/local/nagios/var/rw). The default value for this parameter is /usr/local/nagios/var/rw/nagios.cmd, this file should have enabled writing permissions. (Required)

Parameter form

Examples and use cases

Request disable of 'localhost' notifications

Previous nagios status

Expected output

Expected nagios status

Release notes

EC-Nagios 1.0.3

  • The documentation has been migrated to the main documentation site.

EC-Nagios 1.0.2

  • The plugin icon has been updated.

EC-Nagios 1.0.1

  • Apply code template.

  • Code improvements.

EC-Nagios 1.0.0

  • New Integration: Nagios.