conn check #3

Supports: trusty


Provides the conn-check tool for checking service connectivity, and enables exposing the results to Nagios


conn-check is a utility for performing network connection verification checks against deployed environments.

This charm handles installing conn-check and providing a configuration via a relation so that YAML can be automatically handed off to conn-check, e.g. from conn-check-configs.

The charm also provides the relation required by the NRPE charm and so can be used with Nagios to run regular checks.


Deploy your application and the subordinate:

juju deploy myapp
juju deploy conn-check

Relate them together to install conn-check on the myapp unit(s):

juju add-relation myapp conn-check

This will install conn-check from a launchpad branch of known good wheel dependencies.

You can also specify a revno (to avoid compatibility changes from always tracking HEAD):

# Will install from tag conn-check-r86 on lp:~ubuntuone-hackers/conn-check/wheels
juju set conn-check revision=86

Configuring your charm to support conn-check

Your charm needs to do 2 things to provide conn-check configuration YAML to the subordinate to run tests:

  1. Provide the conn-check relation (interface conn-check)
  2. Provide a conn-check-relation-joined hook which sets the config_path value on the relation pointing to a file containing YAML checks (see the conn-check readme for more details on checks).

Configuring as a Nagios check

To use your conn-check config as a regular Nagios check, just relate the conn-check subordinate to the NRPE subordinate:

# Nagios master to report back to
juju deploy nagios central-monitor

# Add the local Nagios monitor to your service
juju deploy nrpe myapp-nrpe
juju add-relation myapp myapp-nrpe

# Now tell the Nagios subordinate to run checks with conn-check
juju add-relation myapp-nrpe conn-check

# And report back to the master
juju add-relation myapp-nrpe central-monitor

Running conn-check manually with the provided action

The charm ships with a handy action to run conn-check manually on a unit.

Unfortunately there is a bug in juju < 1.21 which stops juju-run from working correctly with subordinates, so we instead we work around it with juju-ssh:

# Assuming your unit name is conn-check/0
juju ssh conn-check/0 'juju-run conn-check/0 actions/run-check'

If you're using juju >= 1.21 you can just use juju-run directly:

# Just run checks on conn-check/0
juju run --unit conn-check/0 'actions/run-check'

# Run checks on all conn-check units
juju run --service conn-check 'actions/run-check'

Virtualenvs and your Python app

Every install of conn-check is installed into it's own virtualenv so that conn-check's dependencies don't overwrite or conflict with any system dependencies (e.g. those managed by the main charm or config manager).

Configuration options

  • revision
  • The revno of conn-check to deploy, HEAD is used if not set.
  • args
  • Extra CLI arguments to pass to conn-check (see the conn-check readme for details).

Contact Information


(string) Extra command line arguments to pass to conn-check.
(string) Name for the Nagios service generated if related via nrpe.
(string) Conn-check revision to use.