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, ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| 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! |
| |||
| 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/ |
| ||||
| 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 |