Created
February 13, 2020 11:06
-
-
Save matthanley/138ad1e5d8386bb58f186b8f26ba596d to your computer and use it in GitHub Desktop.
PRTG systemd service check (Linux SSH Script)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
systemctl status $1 > /dev/null 2>&1 | |
result=$? | |
if [ $result -ne 0 ]; then | |
echo "2:$result:$1 down" | |
else | |
echo "0:$result:$1 ok" | |
fi | |
exit $result |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment