conf-10-check-nrpe/conf/usr/local/bin/check_systemd

31 lines
682 B
Plaintext
Raw Normal View History

2019-09-30 07:19:30 +02:00
# BSD 3-Clause License
#
# Copyright (c) 2019, Alban Vidal <alban.vidal@zordhak.fr>
# All rights reserved.
#
# Please see license file on root of this directory
################################################################################
# !! GIT FILE !!
# https://framagit.org/zorval/scripts/check-nrpe
################################################################################
# Little script which check systemd status
RETURN_CODE=0
# Check systemd status
STATUS=$(systemctl --failed --no-pager --no-legend)
# Test if return is OK
if [ -z "$STATUS" ]; then
echo "OK"
else
echo "Systemd error"
echo "$STATUS"
RETURN_CODE=2
fi
exit "$RETURN_CODE"