Unix Technical Forum

alarmprogram.sh

This is a discussion on alarmprogram.sh within the Informix forums, part of the Database Server Software category; --> Hello We have a dev mount onto production so the alarmprogram.sh is shared by prod and dev. problem is, ...


Go Back   Unix Technical Forum > Database Server Software > Informix

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-20-2008, 08:37 AM
tomcaml@yahoo.com
 
Posts: n/a
Default alarmprogram.sh

Hello

We have a dev mount onto production so the alarmprogram.sh is shared by
prod and dev. problem is, i get too many alarms from dev especially
when i run out of locks.
is there a way for me to separate the two or at least configure the .sh
so i do not receive an email for each lock request that is not
fullfilled?


thanks!

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-20-2008, 08:38 AM
Jonathan Leffler
 
Posts: n/a
Default Re: alarmprogram.sh

tomcaml@yahoo.com wrote:
> We have a dev mount onto production so the alarmprogram.sh is shared by
> prod and dev. problem is, i get too many alarms from dev especially
> when i run out of locks.
> is there a way for me to separate the two or at least configure the .sh
> so i do not receive an email for each lock request that is not
> fullfilled?


Adjust the contents of the separate ONCONFIG files to point to
different scripts in the ALARMPROGRAM (check spelling) entry.

And/or hack the alarmprogram.sh script so it handles things the way
you want instead of the way it wants. For example, my moderately
minimal (but eminently usable for development) script follows. You'll
need to hack the line that runs 'environ' from my bin directory -- it
does an complete dump of 'the environment' which includes a lot more
information than just the environment variables (user ID, current
directory, etc).

#!/usr/bin/ksh
#
# @(#)$Id: alarmprog.sh,v 1.3 2003/06/16 21:13:51 jleffler Exp $
#
# Alternative ALARMPROG -- logs alarms to known log file
# NB: Despite the optimistic #!/usr/bin/ksh at the top, IDS executes
# /usr/bin/sh.

EVENT_SEV="$1"
EVENT_CLS="$2"
EVENT_MSG="$3"
EVENT_TXT="$4"
EVENT_FIL="$5"

date=`TZ=UTC0 date +"%Y-%m-%d %H:%M:%S +00:00"`
logfile=/usr/informix/log/${INFORMIXSERVER:=unknown_server}.alm

if [ ! -s $logfile ]
then
# Empty or non-existent log file
{
echo "$date: Starting logfile for $INFORMIXSERVER"
echo "----------------------------------------------------------"
/work/jleffler/bin/environ -a | sed 's/^/ /'
echo "----------------------------------------------------------"
echo ""
} > $logfile
fi
chmod 664 $logfile >/dev/null 2>&1

if [ "$EVENT_TXT" != "$EVENT_MSG" ]
then text=":text='$EVENT_TXT'"
else text=
fi

if [ -n "$EVENT_FIL" ]
then file=":file=$EVENT_FIL"
else file=""
fi

echo
"$date:$INFORMIXSERVER:sev=$EVENT_SEV:class=$EVENT _CLS:msg='$EVENT_MSG'$text$file"
>>$logfile


exit 0

All this does is log the entries into a log file - and exit
successfully. It knows that event text is often the same as event
message and avoids repeating itself.

This is the complete antithesis of the standard alarm program, which
handles everything. Even that, though, is just an example -- a fully
worked example, but nevertheless, just an example. You can redesign
it to do whatever you want; to ignore that which can be ignored; to
handle that which should be handled; to log everything or log nothing;
whatever you choose. Beware - with power goes responsibility!

--
Jonathan Leffler #include <disclaimer.h>
Email: jleffler@earthlink.net, jleffler@us.ibm.com
Guardian of DBD::Informix v2003.04 -- http://dbi.perl.org/
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-20-2008, 08:38 AM
Art S. Kagel
 
Posts: n/a
Default Re: alarmprogram.sh

tomcaml@yahoo.com wrote:
> Hello
>
> We have a dev mount onto production so the alarmprogram.sh is shared by
> prod and dev. problem is, i get too many alarms from dev especially
> when i run out of locks.
> is there a way for me to separate the two or at least configure the .sh
> so i do not receive an email for each lock request that is not
> fullfilled?
>
>
> thanks!
>


Get my alarm program, eventalarm.c, it ignores repeated identical errors,
emailing only one a minute (configurable period) if an error condition
continues over time. Eventalarm is contained in the package utils3_ak
available for download from the IIUG Software Repository. I have not yet
updated it with some of the newer error codes for 9.xx, but that's actually
trivial to do yourself.

Art S. Kagel
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 08:10 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com