Skip to content

Instantly share code, notes, and snippets.

@M507
Created November 4, 2020 19:43
Show Gist options
  • Save M507/6ee504e414797a6cb2a56ceb6f7d654c to your computer and use it in GitHub Desktop.
Save M507/6ee504e414797a6cb2a56ceb6f7d654c to your computer and use it in GitHub Desktop.
pfsense service checker - Slack
#!/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
@sh1dow3r
Copy link

This is useful, thank you for sharing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment