NAME

check_supervisorctl - Check supervisorctl for the status of running items as well as configs.

SYNOPSIS

check_supervisorctl [-f <config_dir>] [-c] [-d <ignore_config>] [-i <ignore>] [-s <status mapping>] [-R] [-l] [-L]

check_supervisorctl -h/--help

check_supervisorctl -v/--version

DESCRIPTION

Calls 'supervisorctl status' and by default alerts for anything not starting or running.

Optionally then checks under the conf.d dir for supervisor and to check to see what is there matches what is running, wanting each item running to have it's own config and ensure everything present is running, ensure that the config and current status is in sync. This operates under the assumption that each item has it's own config and the name of the two matches post removing /\.conf$/ from the name of the file.

FLAGS

-c

Check configs as well.

-f <config_dir>

The directory to look for configs under if -c is set.

Only items matching /\.conf$/ are checked.

Default: /usr/local/etc/supervisor/conf.d

Linux: /etc/supervisor/conf.d

-d <ignore_config>

A config entry to ignore.

May be used more than once.

-i <ignore>

A item from status to ignore.

May be used more than once.

-R

Restart items that are stopped, exited, fatal, or backoff. Items ignored via -i are not touched. Backoff items are restarted via 'supervisorctl restart' and the rest via 'supervisorctl start'.

This does not change the exit value. A stopped item that was restarted is still alerted on, so what is monitoring it knows it was restarted. Each is listed as RESTARTED or RESTART FAILED.

-l

Add configs that are not running, the same as -L, for use with -R.

Requires -R and -c.

-L

Add configs that are not running via 'supervisorctl reread' and 'supervisorctl add'. Configs ignored via -d, or for items ignored via -i, are not touched.

This does not change the exit value. Each is listed as ADDED or ADD FAILED.

Requires -c.

-s <status=mapping>

Maps a status to to a exit value.

May be used more than once to define more than one mapping.

For supervisorctl it is as below.

stopped  = 2
starting = 0
running  = 0
backoff  = 2
stopping = 2
exited   = 2
fatal    = 2
unknown  = 2

For config checking it is as below.

not_running            = 2
config_missing         = 2
config_dir_missing     = 3
config_dir_nonreadable = 3

For if supervisorctl status could not be ran or returned something that is not a item and status, such as when it can not talk to supervisord, it is as below.

status_error = 3