Created
November 4, 2020 19:43
-
-
Save M507/6ee504e414797a6cb2a56ceb6f7d654c to your computer and use it in GitHub Desktop.
pfsense service checker - Slack
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 | |
for value in arpwatch dhcpd dpinger ntpd openvpn syslogd unbound | |
do | |
pfSsh.php playback svc status $value | grep stopped | |
if [ $? -eq 0 ] | |
then | |
out="Important alert from "`hostname`": service $value is down!" | |
echo $out | |
curl -X POST -H 'Content-type: application/json' [Webhook URL] --data "{\"text\": \"${out}\"}" | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is useful, thank you for sharing.