nrpe external master #2

Supports: precise


Nagios is a host/service/network monitoring and management system. The purpose of this addon is to allow you to execute Nagios plugins on a remote host in as transparent a manner as possible. This program runs as a background process on the remote host and processes command execution requests from the check_nrpe plugin on the Nagios host. It's specifically designed to connect to an external master.

This is a pretty special purpose charm currently, and most likely you'll want to look at lp:charms/nrpe to see if it fits your needs better. This will be merged into that one in the not too distant future.

Some other caveats: - It's included in the CharmStore as an example of a workaround for the lack of cross-environment relations. - It might be obsoleted if/when cross-environment relations land in Juju core - It currently requires the application of out of band security groups. As an example, if your nagios master has an IP of you'd want to expose rsync and nrpe from that machine only using the following commands (in Openstack, as an example - will vary by provider) so that you are only opening them to the specific server, rather than any IP: nova secgroup-add-rule juju-${JUJU_ENV} tcp 873 873 nova secgroup-add-rule juju-${JUJU_ENV} tcp 5666 5666

This charm provides a means of interacting with a Nagios server that's managed outside of the Juju environment. This can be useful if you have a situation where you have a number of different Juju environments that you want to connect to the same nagios instance until is fixed.

It's a subordinate charm, and works by creating a base set of checks in /etc/nagios/nrpe.d, including check_load, check_users, check_disk_root. All of the options for these are configurable but sensible defaults have been set in config.yaml.

The most important config option that you'll want to set is the "nagios_master" option. This should be the hostname or the IP address of the Nagios server that you want to connect to. It will be added to the "allowed_hosts" configuration option of /etc/nagios/nrpe.cfg. An rsync stanza will also then be created allowing the Nagios server to pick up configs from /var/lib/nagios/export (as a target called "external-nagios"), which will also be configured to allow connections from the hostname or IP address as specified for the "nagios_master" variable.

It's up to you to configure the Nagios master to pull the configs needed, which will then cause it to connect back to the instances in question to run the nrpe checks you've defined.

You will also want to modify the primary charms in question to create service-specific checks. They should do this in the nrpe-external-master-relation-changed hook, by dumping the checks they need into /etc/nagios/nrpe.d, and the server side configs to call those checks into /var/lib/nagios/export.


(string) Root disk check
-u GB -w 25% -c 20% -K 5%
(string) Hostcheck to inherit
(string) Comma separated list of hostgroups to add for these hosts
(string) Load check
-w 8,8,8 -c 15,15,15
(string) a string that will be prepended to instance name to set the host name in nagios. So for instance the hostname would be something like: juju-postgresql-0 If you're running multiple environments with the same services in them this allows you to differentiate between them.
(string) IP address of the nagios master to allow rsyncs from
(string) Number of processes check
-w 150 -c 200
(int) port that nagios-nrpe-server will listen on
(string) Swap check
-w 90% -c 75%
(string) Users check
-w 20 -c 25
(string) Zombie processes check
-w 3 -c 6 -s Z