-
-
Notifications
You must be signed in to change notification settings - Fork 19
Ideas for self monitoring
Dogora edited this page Aug 18, 2015
·
3 revisions
Some useful programs for a self-monitored alarm are as follows:
swatch would watch the log file generated by nxgipd, and sendxmpp and/or msmtp would send log entries via XMPP or email to you.
A typical swatch configuration file will have entries such as this:
# alarm is on
watchfor /Siren/
echo red
pipe 'sendxmpp -t -o yax.im [email protected]'
pipe '~/bin/sendMsg [email protected] acct'
threshold track_by=siren,type=limit,count=5,seconds=60
The script ~/bin/sendMsg would be something like this:
#!/bin/bash
msg=$(cat)
echo -e "To: [email protected]\nFrom: $1\n\n$msg" | msmtp -a $2 -t --logfile=/tmp/msmtp.log
in order to send yourself a text, assuming you use Verizon for your mobile service.