nrpe external master #0

Supports: trusty
Add to new model


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

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


(string) Root disk check. This can be made to also check non-root disk systems as follows: -u GB -w 20% -c 15% -r '/srv/juju/vol-' -C -u GB -w 25% -c 20% The string '-p /' will be appended to this check, so you must finish the string taking that into account. See the nagios check_disk plugin help for further details.
-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) Determines whether a server is identified by its unit name or host name. If you're in a virtual environment, "unit" is probably best. If you're using MaaS, you may prefer "host".
(string) IP address of the nagios master to allow rsyncs from
(string) Number of processes check or 'auto' for the charm to generate thresholds based on processor count
(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