NAME

Monitoring::Sneck::Checks::service - checks services are running

VERSION

Version 0.0.1

SYNOPSIS

web|perl:service -s nginx -s php-fpm -e
www_jail|perl:service -s nginx -j www

DESCRIPTION

Checks each service given is running, and with --enabled, that it is set to start at boot too. Any that is not is CRITICAL.

On Linux, systemctl is-active and is-enabled are asked, and on FreeBSD, service status and service enabled, in a jail too with --jail. Other OSes, or Linux without systemd, are UNKNOWN.

OPTIONS

- -s, --service :: A service. May be given more than once. Required.

- -e, --enabled :: They must also be enabled.

- -j, --jail :: On FreeBSD, check the services in this jail. UNKNOWN on other OSes.

METHODS

check

Does the check.

running

Returns 1 and its state if a service is running, else 0 and its state, such as inactive or failed. Dies if this OS is not supported.

enabled

Returns 1 if a service is enabled, else 0.

jail_args

Returns the args for service to run in --jail, if given.