nrpe external master #1

  • By stub
  • Latest version (#1)
  • trusty, xenial
  • Stable

Description

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 10.10.10.10 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 10.10.10.10/32
nova secgroup-add-rule juju-${JUJU_ENV} tcp 5666 5666 10.10.10.10/32

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 https://bugs.launchpad.net/juju/+bug/1049340
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.

Configuration

load
(string) Load check. Parameters for the check_load script or 'auto' to allow the charm to generate parameters based on the processor count. For example, '-w 8,8,8 -c 15,15,15' sets the WARNING threshold to 8 and CRITICAL to 15.
auto
server_port
(int) port that nagios-nrpe-server will listen on
5666
nagios_address_type
(string) Determines whether the nagios host check should use the private or public IP address of an instance. Can be "private" or "public".
private
hostgroups
(string) Comma separated list of hostgroups to add for these hosts
zombies
(string) Zombie processes check
-w 3 -c 6 -s Z
hostcheck_inherit
(string) Hostcheck to inherit
server
swap
(string) Swap check
-w 90% -c 75%
nagios_hostname_type
(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".
unit
users
(string) Users check
-w 20 -c 25
nagios_master
(string) IP address of the nagios master to allow rsyncs from
None
nagios_host_context
(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.
juju
procs
(string) Number of processes check or 'auto' for the charm to generate thresholds based on processor count
auto
disk_root
(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%