#!/bin/bash PLUGINDIR=$(dirname $0) . $PLUGINDIR/utils.sh if [ -e /lib/systemd/system/tunneldigger@.service ] ; then domains=$(/bin/ls /etc/systemd/system/multi-user.target.wants/tunneldigger@* | grep -oE "[0-9]+") fi if [ -e /lib/systemd/system/tunneldigger.service ] ; then systemctl --quiet is-active tunneldigger.service if [ $? -ne 0 ]; then echo "ERROR: service tunneldigger is not running" exit $STATE_CRITICAL else echo "OK: service tunneldigger is running" exit $STATE_OK fi fi ERROR_IN_DOM='' if [ -e /lib/systemd/system/tunneldigger@.service ] ; then for domain in $domains ; do systemctl --quiet is-active tunneldigger@${domain}.service if [ $? -ne 0 ] ; then ERROR_IN_DOM="$ERROR_IN_DOM $domain" fi done if [[ $ERROR_IN_DOM == '' ]] ; then echo "OK: service tunneldigger is running" exit $STATE_OK else echo "ERROR: service tunneldigger is not running in Dom: $ERROR_IN_DOM" exit $STATE_CRITICAL fi fi