Skip to content

Instantly share code, notes, and snippets.

@matthanley
Created February 13, 2020 11:06
Show Gist options
  • Save matthanley/138ad1e5d8386bb58f186b8f26ba596d to your computer and use it in GitHub Desktop.
Save matthanley/138ad1e5d8386bb58f186b8f26ba596d to your computer and use it in GitHub Desktop.
PRTG systemd service check (Linux SSH Script)
#!/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