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.

More information can be found at the Nagios site.

Plugin Version 1.1.0.2024010205

Supported versions

This plugin was developed and tested against Nagios Core version 3.4.1.

Create Nagios plugin procedures

Plugin procedures can be used in procedure steps, process steps, and pipeline tasks, allowing you to orchestrate third-party tools at the appropriate time in your component, application process, or pipeline.

Depending on your plugin configuration and how you run procedures, the Input parameters  Configuration name field may behave differently in the CloudBees CD/RO UI. For more information, refer to Differences in plugin UI behavior.

DisableHostNotifications

Disables notifications for a particular host. The command to be executed is:
printf "[$TimeStamp] DISABLE_HOST_NOTIFICATIONS;$Host\n" > $commandFileLocation

Parameter Description

Host

Required. Host to disable.

Command File Location

Location of the command file with the command_file option. CloudBees recommends that you store the external command file in its own directory (for example, /usr/local/nagios/var/rw). The default value for this parameter is /usr/local/nagios/var/rw/nagios.cmd, and this file should have enabled writing permissions.

EnableHostNotifications

Enables notifications for a particular host. The command to be executed is:
printf "[$TimeStamp] ENABLE_HOST_NOTIFICATIONS;$Host\n" > $commandFileLocation

Parameter Description

Host

Required. Host to disable.

Command File Location

Location of the command file with the command_file option. CloudBees recommends that you store the external command file in its own directory (for example, /usr/local/nagios/var/rw). The default value for this parameter is /usr/local/nagios/var/rw/nagios.cmd, and this file should have enabled writing permissions.

DisableHostGroupNotifications

Disables notifications for all hosts in a particular host group. The command to be executed is:
printf "[$TimeStamp] DISABLE_HOSTGROUP_HOST_NOTIFICATIONS;$hostGroup\n" > $commandFileLocation

Parameter Description

Host Group

Required. Host group to disable.

Command File Location

Required. Location of the command file with the command_file option. CloudBees recommends that you store the external command file in its own directory (for example, /usr/local/nagios/var/rw). The default value for this parameter is /usr/local/nagios/var/rw/nagios.cmd, and this file should have enabled writing permissions.

EnableHostGroupNotifications

Enables notifications for all hosts in a particular host group. The command to be executed is:
printf "[$TimeStamp] ENABLE_HOSTGROUP_HOST_NOTIFICATIONS;$hostGroup\n" > $commandFileLocation

Parameter Description

Host Group

Required. Host group to disable.

Command File Location

Required. Location of the command file with the command_file option. CloudBees recommends that you store the external command file in its own directory (for example, /usr/local/nagios/var/rw). The default value for this parameter is /usr/local/nagios/var/rw/nagios.cmd, and this file should have enabled writing permissions.

Nagios plugin release notes

EC-Nagios 1.1.0

  • Upgraded from Perl 5.8 to Perl 5.32. The plugin is not backward compatible with CloudBees CD/RO versions prior to 10.3. Starting from this release, a new agent is required to run EC-Nagios plugin procedures.

EC-Nagios 1.0.3

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

1.0.2

  • The plugin icon has been updated.

1.0.1

  • Applied code templates.

  • Made code improvements.

1.0.0

  • Initial release.