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. Fri Apr 26, 2024 19:25
SMSTools3 Community » Help and support Bottom

[answered] Define when to call Alarm Handler

  This topic is locked

Page:  1

Author Post
Member
Registered:
Jun 2009
Location: Germany
Is it possible to configure the alarm handler that the alarm handler-Script will only be called on local errors?
For example, if dialing and everything local works, but the remote site rejects receiving SMS, I do not need an alarm handler generated Mail (using a bash script called by the alarm handler). But if an error occurs that depends on my site, eg, modem doesnt work, I need an email.
Maybe I misread the docu, but I couldnt find something about.

Sure, I can filter remote errors in my script using grep, but therefore I have to know which errors are local and which remote & it needs more 'cpu time' if calling everytime the shell script and filtering rather then generate no alarm.
Axel

Member
Registered:
Jun 2009
Location: Germany
Topic owner
Sorry, hope that is not a too stupid question :roll:

Is this an error talking about a local problem or does it only mean that the remote site rejectetd sms receiving?

GSMLAN1: The modem answer was not OK: +CMS ERROR: 21 (Short message transfer rejected)

If it is a local error (getting it while bulk sending), should / can I put any parameters in my config to avoid?
Axel

Administrator
Registered:
May 2009
Location: Jyväskylä, Finland
aschneck wrote
Is it possible to configure the alarm handler that the alarm handler-Script will only be called on local errors?

No it's not. You can only set the alarmlevel, but it's a different thing.

aschneck wrote
Sure, I can filter remote errors in my script using grep, but therefore I have to know which errors are local and which remote & it needs more 'cpu time' if calling everytime the shell script and filtering rather then generate no alarm.

Somebody have to decide when to generate alarm and when not, and smsd cannot do this. :(

There are lot of network depended issues, which cause that you should collect a database of general alarms, and use it for filtering. I think that the cpu time usually is not the problem.

For example you could first collect all alarm messages to the /var/log/smsd_alarmhandler.log, and then check what are common messages and what messages should always create alarms which are monitored on-line.

aschneck wrote
Is this an error talking about a local problem or does it only mean that the remote site rejectetd sms receiving?

GSMLAN1: The modem answer was not OK: +CMS ERROR: 21 (Short message transfer rejected)

That actual message comes from the modem. There are two kinds of messages:

1. CME ERROR's (GSM Equipment related codes)
- "No network service" is probably the most usual CME related error.

2. CMS ERROR's (GSM Network related codes)
- Most errors are CMS related, which means "not a local" problem, but for example if you had an incorrect / unused phone number, you get CMS errors and the problem is "yours" ( = local ). ;)

Member
Registered:
Jun 2009
Location: Germany
Topic owner
yep, the term CPU-intensive was a theoretical, dont know how to better explain what I mean that it normally would be better, to filter at the first step :-)

OK, so I'll procede with my already started 'job' to try to find out which error I should alert and which not :mrgreen:

The main reason behind these question is / was to find out at what errors I have to try to restart the daemon or check the modem.

Administrator
Registered:
May 2009
Location: Jyväskylä, Finland
aschneck wrote
yep, the term CPU-intensive was a theoretical, dont know how to better explain what I mean that it normally would be better, to filter at the first step :-)

Alarmhandler is the first step which can do the filtering, in practice.

This software is used at least 80 countries, likely much more, and there are differences in SMSC's and also users have different needs for "filtering". It makes no sense if everything is included in the code, with a large number of configuration settings etc., when alarmhandler can be used for filtering with some simple lines of scripting.

aschneck wrote
OK, so I'll procede with my already started 'job' to try to find out which error I should alert and which not :mrgreen:

The main reason behind these question is / was to find out at what errors I have to try to restart the daemon or check the modem.

Yes, It's much better in results.

There is a list of possible error messages available in this page. However, it's preliminary list and from 3.2beta0. Currently there might be some differences to 3.1.14 because those versions of code are not yet synchronized.

For example, in some system I have this kind of alarmhandler:

#!/bin/bash

LOG="/var/log/smstools/alarmhandler.log"
CONTROLFILE="/var/lib/smsd/application/control"

# $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 ready to answer commands" >/dev/null; then

        if [ ! -f $CONTROLFILE ]
        then
                DATE=`date +"%Y-%m-%d %T"`
                echo "${DATE},1, $5: Alarmhandler created request for reset." >> $LOG
                echo "KEYWORD RESET SMS_TO $5 $DATE" > $CONTROLFILE
        fi
fi
 
'bash' Syntax Highlight powered by GeSHi


There is an external process which see if reset is needed, and if it is:
- smsd is stopped
- all modems get power-off-delay-on with USB controlled relay and AC adapter
- controlfile is removed
- smsd is started
- SMS notification is created to administrator

  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.