Skip to content

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 account@yax.im'
  pipe '~/bin/sendMsg foo@bar.org 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: 2125551212@vtext.com\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.

Clone this wiki locally