Re: need program to send an alarm to my pager
Posted in 1999
Not having a text pager (yet), I can only guess, but maybe you should check with
your pager service provider. I see that you have specified a subject line, perhaps
they only send the subject line if one is provided. Have you tried running the
mailx commands from the command line? Try it and send your pager a message with no
subject, just to see if the message body is transmitted.
> I tinkered with the log_full.sh script that comes with Informix to try to
> accomplish this very thing. You'll need an alpha pager to make this work.
> This is what I have so far.
>
> PROG=`basename $0`
> USER_LIST=informix
> EXIT_STATUS=0
> DBA_ADDRESS="[my pager's e-mail address]"
> INFORMIXDIR=[the appropriate INFORMIXDIR path]>
> EVENT_SEVERITY=$1
> EVENT_CLASS=$2
> EVENT_MSG="$3"
> EVENT_ADD_TEXT="$4"
> EVENT_FILE="$5"
>
> case "$EVENT_SEVERITY" in
> 3 | 4 | 5)
> cat "Severity: $1" "Class: $2" $3 $4 $5 >
> $INFORMIXDIR/etc/alertdba.msg
> mailx -s "DBA ALERT ON [servername]" $DBA_ADDRESS <
> $INFORMIXDIR/etc/alertdba.msg
> ;;
>
> *)
> # EXIT_STATUS=1
> ;;
> esac
>
> EXIT_STATUS=$?
>
> exit $EXIT_STATUS
>
> I've called the above script alertdba.sh. If you implement something like
> this, make sure that the ALARMPROG parameter in your onconfig file points to
> this script.
>
> You'll probably recognize some of the structure of log_full.sh in here. All
> I did was add my pager's e-mail address, and change the central CASE
> statement to send me anything of severity 3, 4 or 5.
>
> I should mention that I haven't gotten this program to work perfectly yet.
> It has gone off only once, and I did get a page with the appropriate
> subject, but the body of the message, (which should have told me what the
> problem was), didn't come through. Even though it didn't tell me what the
> problem was, it told me THAT there was a problem, and I came back and fixed
> it.
>
> If anyone knows why I didn't get the body of the message in my e-mail page,
> I'd welcome any de-bugging advice. Thanks.
>
> Hope this helps,
Mark Collins
mcollins@us.dhl.com
The problem lies in how easily and dangerously we forget that
manipulating things is not the same as understanding them.