With an alarmhandler this can be done. In the smsd.conf, define the following:
alarmhandler = /usr/local/bin/smsd_alarmhandlerCreate this file with the following content, and make it executable for smsd:
#!/bin/bash
LOG="/var/log/smsd_alarmhandler.log"
# $1 the keyword ALARM
# $2 a date in the format yyyy-mm-dd
# $3 a time in the format hh:mm:ss
# $4 the alarm severity (1 digit number)
# $5 the modem name or SMSD
# $6 the alarm text
echo "$2 $3,$4, $5: $6" >> $LOG
if echo -n "$6" | grep "MODEM IS NOT REGISTERED, WAITING 1 SEC. BEFORE RETRYING 3. TIME" >/dev/null; then
EMAIL="sysadmin@localhost"
subject="$6"
message="$*"
echo "$message" | /usr/bin/mail \
-a "From: smsd@localhost" \
-s "$subject" \
"$EMAIL"
fi
'bash' Syntax Highlight powered by GeSHi Take this script as a sample, and modify it to fit to your purposes. Currently it sends an email when problem with registration continues, and smsd will retry third time. If something like this is not tested, lot of emails will be sent, which probably is not good.
See also
this post. With that patch applied, you can monitor "
Problem with registration has started" events, and also "
Problem with registration has ended" events, if necessary.