APRSHOG Alert and Notification

During my lunch today, I was doing some testing with setting-up a receive-only APRS iGate. While I was watching the logs and troubleshooting a problem, I saw my callsign whiz by the screen. Oops! I had received a phone-call as I was getting out of the car, and forgotten to turn-off my HT! I quick went over to the NorCal APRSHOG site to see how “bad” I had been. Sure enough, I was already listed at #25 in the ranks at the time. I quickly ran-out to the car and powered off the HT.

This was all unintentional, and I am very conscious of the APRS traffic congestion, which is why I was working on setting-up a receive-ONLY APRS iGate. I decided I needed to find a way to try to monitor and make sure that I am alerted if this happens again. Next time this happens, I may not be watching APRS logs.

I wrote a little script that I called “aprshog-alert” to run on my Linux server. The script takes in my CALLSIGN and the threshold I want to be alerted on.

It will email me if my APRS callsign is ranked between 1 and 25 (considered a hog!):

[root@host ~]# ./aprshog-alert KI6ETL-9 25

Script:

#!/bin/sh
CALLSIGN=$1
LIMIT=$2
EMAIL="callsign@example.com"
SITE='http://www.norcalaprs.net/usagex.html'

RANK=`wget -q $SITE -O – | grep $CALLSIGN –before-context 1 | head -1 | sed -e :a -e 's/<[^>]*>//g;/

if [[ -z “$RANK” ]]; then
true;
elif [[ “$RANK” -le “$LIMIT” ]]; then
echo You are on the APRSHOG list at a rank of $RANK . Check on $SITE | mail -s '# APRS HOG ALERT #' $EMAIL
fi

I am confident that there are more elegant methods to accomplish this, but I wanted something usable immediately.

The final step is to add this as a cronjob on my Linux system, to run on an hourly basis. I don't want to abuse the APRSHOG site, so more frequent would be inappropriate.