RE: Is there a Unix alarm program we can use with the Informix Log?
Posted in 1998
I wanted to post the solution I came up with in case anyone here would want
to use it. The problem we were having was with our QA department. They
dont necessarily watch the logs while they are testing(its so tedious), so I
needed something that would alarm them when the DB had an assert failure.
Eric Davies send a short bourne shell script that I mutated into what I call
AssertAlarm.
Instead of ringing a bell, or sending mail, I wanted something more
immediate on the screen. So I thought launching xv (unix image viewer) with
a dreadful image would be a good idea. The image we are using now is a
black and white of Duke head mens basketball coach Mike K with the words
ASSERT FAILURE written on top. Yes we are huge tarheel fans here.
The script takes 4 arguments. The XServer display, the image to display,
the path to the log file and the string to search for in the log file. I
will try my best to update the list if there are future problems with this
solution. feel free to use it.
-Thomas
------------------------
#!/bin/sh
if [ "$#" -ne 4 ]
then
echo ""
echo "AssertAlarm - display an image on the desktop when an assertion
failure occurs in the message.log "
echo ""
echo "Usage: $0 display image logfile string"
echo ""
echo "diplay: name of Xserver to display alert (i.e. dopey.test.com)"
echo "image: full path to image file (jpg/gif)"
echo "logfile: full path to file to check"
echo "string: exact string to search for in logfile (i.e. fatal or
\\"relocation error\\") "
echo ""
exit 1
else
/usr/bin/tail -f $3 | /usr/bin/nawk -v x="$4" -v y="$1" -v z="$2" '
BEGIN {FS = " "
alarm = "/usr/local/bin/xv -display " y ":0.0 " z " & "
print "The alarm will be " alarm
}
$0 ~ x { system(alarm)}
'
fi
------------------------------------
> -----Original Message-----
> From: owner-ius-users@iiug.org [mailto:owner-ius-users@iiug.org]On
> Behalf Of Thomas Tatum
> Sent: Wednesday, July 29, 1998 4:17 PM
> To: Ius-Users@Iiug. Org; 'Informix_List'
> Subject: Is there a Unix alarm program we can use with the Informix Log?
>
>
>
>
> Is there a Unix command/script/program that I could set up to
> alert me when
> the following is printed out in the message log?
>
>
>
> 16:44:59 Assert Failed: Exception Caught. Type: MT_EX_OS, Context: mem
> 16:44:59 INFORMIX-Universal Server Version 9.14.UC1X4
> 16:44:59 Who: Session(17, informix@xxxxx, 22506, 0)
> Thread(31, sqlexec, 0, 1)
> File: mtex.c Line: 183
> 16:44:59 Action: Please notify Informix Technical Support.
> 16:45:02 Blocking whole system for max 0 secs
> 16:45:02 VP 4 timed out during system block, releasing
> 16:45:02 VP 7 timed out during system block, releasing
> 16:45:02 Releasing server from system block
> 16:45:02 Releasing server from system block
> 16:45:02 Releasing server from system block
> 16:45:02 Releasing server from system block
> 16:45:02 Releasing server from system block
> 16:45:02 Releasing server from system block
> 16:45:02 Releasing server from system block
> 16:45:21 See Also: <path to logs>/af.1f4f3a
> 16:45:21 Assert Failed: Exception Caught. Type: MT_EX_OS, Context: mem>
> We are on solaris.
>
>
> Thomas Tatum
> 919-767-2129
>