SMS Server Tools 3
This site is hosted by Kekekasvi.com
 Menu
Basic information:
Additional information:
Support:
Get SMS Server Tools 3:
Additional Options

 Sponsored links

 Search
Custom Search

 Visitor locations
 
 SMS Server Tools 3 Community
Welcome, Guest. Please login or register. Thu Mar 28, 2024 17:12
SMSTools3 Community » Help and support Bottom

[answered] Modem Registered Alert

  This topic is locked

Page:  1

Author Post
Member
Registered:
Nov 2010
Location: Sindh, Pakistan
Operating system name and version: SUSE 10.3
Version of smsd: 3.1.14
Smsd installed from: sources
Name and model of a modem / phone: MOXA UPort 1110
Interface: USB

Hi,

if /var/log/smsd.log contain a following error, then email generate to sysadmin@mblonline.com:

MODEM IS NOT REGISTERED, WAITING 1 SEC. BEFORE RETRYING

Administrator
Registered:
May 2009
Location: Jyväskylä, Finland
With an alarmhandler this can be done. In the smsd.conf, define the following:

alarmhandler = /usr/local/bin/smsd_alarmhandler

Create 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.

  This topic is locked

Page:  1

SMSTools3 Community » Help and support Top

 
Time in this board is UTC.  

Privacy Policy   SMS Server Tools 3 Copyright © Keijo Kasvi.