Transporting from GitHub:
Would it be worth while to write a script to monitor how the Pi-Hole is working? For another opensource project I wrote the below code to send a push bullet alert when called.
**######### Variables #########**
pb_access_token="" _# Pushbullet Access-Token (Example: "bYdBDvrasdYsjdGsmdSLd38S6" )( "" = PushBullet Alerting OFF)_
pb_device_id="" _# Pushbullet Device ID To Send Alerts To (Example: "ujAczShN1VsKnSTs" )( "" = If Blank the script will alert to all PushBullet Devices )_
**######### Function To Send Alert via PushBullet ##########**
pushbullet_alert () {
pb_message_title="$1"
pb_message_body="$2"
if [ -n "$pb_access_token" ] && [ -n "$pb_device_id" ]; then
curl -k --header 'Access-Token: '$pb_access_token -X POST https://api.pushbullet.com/v2/pushes --header 'Content-Type: application/json' --data-binary '{"device_iden": "'$pb_device_id'", "type": "note", "title": "'"$pb_message_title"'", "body": "'"$pb_message_body"'"}' > /dev/null 2>&1
if [[ $? != 0 ]]; then echo -e "PushBullet Alert Push Failed -- \e[31m**SCRIPT FAILED**\e[39m (pushbullet_alert)" >> $script_log_file; fi
elif [ -n "$pb_access_token" ]; then
curl -k --header 'Access-Token: '$pb_access_token -X POST https://api.pushbullet.com/v2/pushes --header 'Content-Type: application/json' --data-binary '{"type": "note", "title": "'"$pb_message_title"'", "body": "'"$pb_message_body"'"}' > /dev/null 2>&1
if [[ $? != 0 ]]; then echo -e "PushBullet Alert Push Failed -- \e[31m**SCRIPT FAILED**\e[39m (pushbullet_alert)" >> $script_log_file; fi
fi
}
**######### Example On How To Call The Function #########**
pushbullet_alert "Interface(s) Down" "(Manual Intervention Required) -- Unable to restart Interface(s)"