Well... Good and bad news.
I've setup a public repository of scripts I normally use. The URL is:
http://onlinedomus.com/informix/viewvc.cgi
The script I talked about in in PUBLIC/informix/scripts/ix and it's called
ixproclog*
But the bad news is that it depends on another script called setinfx
located at PUBLIC/informix/scripts/setinfx/shell/
The purpose of this latest script is to allow easy and quick moving from
one Informix environment to another. As an example:
===========================================================================================
bg@pacman.onlinedomus.com:fnunes-> . setinfx l
List of available INFORMIX environments on pacman.onlinedomus.com (setinfx
version 1.30)
1) Cheetah (IBM Informix Dynamic Server Version 11.50.UC8W2)
2) Panther Pri (IBM Informix Dynamic Server Version 11.70.UC4)
3) Cheetah (IBM INFORMIX-4GL Version 7.50.UC4)
4) Panther (IBM/Informix-Client SDK Version 3.70.UC4)
5) Test ADM (IBM Informix Dynamic Server Version 11.50.UC8W2)
6) CM (IBM/Informix-Client SDK Version 3.70.UC4)
7) CM (IBM/Informix-Client SDK Version 3.70.UC4)
Choose an environment number (1-7 q to quit) :
==================================================================
or you could just run ". setinfx 1"
For this to happen you'd need to create two config files:
1) ~informix/etc/infx_env.lst
contains the list of environments. Could look like this:
#Description|INFORMIXSERVER|ONCONFIG|INFORMIXDIR|SERVERDIR|INFORMIXSQLHOSTS|TYPE:S=server,D=4GL/tools|Empty|HOSTNAME(can
ber LOCAL)|Script to execute
Cheetah|cheetah|onconfig.cheetah|/usr/informix/srvr1150uc8w2|=|/home/informix/etc/sqlhosts|S||pacman|TERMCAP.sh
Panther
Pri|panther|onconfig.panther|/usr/informix/srvr1170uc4|=|/home/informix/etc/sqlhosts|S||pacman|TERMCAP_PRI.sh
Cheetah|cheetah||/usr/informix/tool750uc4|/usr/informix/srvr1150uc7|/home/informix/etc/sqlhosts|D||pacman|TERMCAP.sh
Panther|panther||/usr/informix/csdk370uc4|/usr/informix/srvr1150uc7|/home/informix/etc/sqlhosts|D||pacman|TERMCAP.sh
Test
ADM|test|onconfig.test|/usr/informix/srvr1150uc8w2|=|/home/informix/etc/sqlhosts|S||pacman|TERMCAP.sh
CM|bigbrother|cmsm.cfg|/usr/informix/csdk370uc4/|/usr/informix/srvr1170uc4|/usr/informix/csdk370uc4/etc/sqlhosts.cmsm|D||pacman|TERMCAP.sh
CM|bg||/usr/informix/csdk370uc4/|/usr/informix/srvr1170uc4|/usr/informix/csdk370uc4/etc/sqlhosts.cmsm|D||pacman|TERMCAP.sh
2) ~informix/etc/setinfx.params
Defines some options. Could look like this:
admingroups: informix
system_ld_library_path :/lib
path_informixdir_bin: BEGIN
/usr/informix/tool
/usr/informix/srvr
where:
- the line with "admingroups:" contains a list of space separated unix
groups that will "see" the environments for "servers" (7th field in the
file above == "S" or "s")
system_ld_library_path: contains possible system paths to add to
LD_LIBRARY_PATH. This will be placed first in the list for client
environments (7th field of file above == "D"). This is optional and was
introduced for performance reasons
- path_informixdir_bin: BEGIN indicates that $INFORMIXDIR/bin will be
placed at the head of PATH. Can be "END" for opposite effect
- the rest of the lines are prefixes that will be searched and removed from
PATH and LD_LIBRARY_PATH before setting new ones, each time you switch
environments.
For this to work you'd need "setinfx" and "setinfx_utils" on the user PATH.
---------------
If you're still here, after setting the above for your environment you
should also use the follwoing pieces for "ixproclog":
- ixproclog (the script)
- ixproclog.def (the config file)
This latest would look like:
#-----------------------------------------------------------------------------------------------------------------------------------
# Field description:
# 1-Online log
msg|2-alarm_class_id|3-alarm_severity|4-alarm_class_msg|5-function|6-alarm_send|7-IDS
versions
#-----------------------------------------------------------------------------------------------------------------------------------
#Checkpoint Completed|900|1|Checkpoint completed|ix_checkpoint|Y|:7:9:10:|
Client host or user|901|3|Connect fail - User not trusted||Y|:7:9:10:|
password is not correct for the database server|901|3|Connect fail - Bad
password||Y|:7:9:10:|
Archive started|902|2|Archive Started||Y|7:9:10:|
Dynamic Server Started|903|3|Engine started||Y|:7:9:10:|
Dynamic Server Stopped|903|3|Engine stopped||Y|:7:9:10:|
Quiescent Mode|903|3|Engine entered Quiescent Mode||Y|:7:9:10:|
On-Line Mode|903|3|Engine entered On-Line Mode||Y|:7:9:10:|
KAIO: out of OS resources|904|4|Kaio out of OS resources||Y|:7:9:10:|
You'd have to configure this for your needs...
Each line specifies an event driven action with 7 pipe separated fields:
1) The online message that you want to trap and act upon
2) The class id used to call the ALARMPROGRAM
3) The alarm severity used to call the ALARMPROGRAM
4) The class message used to call the ALARMPROGRAM
5) Some function that you can define in a file named "ixproclog.inc"
6) Call (Y) or not (N) the alarprogram (you may prefer just to use a
customized function)
7) The versions of IDS where this is aplicable (separated by ":"
=========================
If you're still here, than you'd need to run something like:
ixproclog DAEMON
This would source the "setinfx_utils" which would define a function to get
all the server environments from the infx_env.lst file.
For each one of this, a function would be launched in backgroud with
"ixproclog WORKER <n>" where <n> would be the environment number:
panther@pacman.onlinedomus.com:fnunes-> ./ixproclog DAEMON
awk: warning: escape sequence `\.' treated as plain `.'
Launched WORKER 1 with PID 12324
Launched WORKER 2 with PID 12325
Launched WORKER 5 with PID 12326
each one will launch a tail -1f for the respective online.log and every
time a message is written it will try to match it against the entries in
"ixproclog.def" and act accordingly.
===============================================================================
Overcomplex? Yes. Flexible? YES! :)
If your version has it, you could check SHMVIRT_ALLOCSEG
If by any change you decide to go with this complex path, feel free to ask
any questions.
Of course, please test on a non production environment first, until you
feel confortable.
Regards.
On Tue, Dec 20, 2011 at 10:32 PM, Fernando Nunes <domusonline@gmail.com>wrote:
> Hmmm.... I checked the script. It depends on another one that was written
> by someone else (many years ago) and almost re-written by me over the
> years... But as of today I cannot supply this second one.
> This should be solved in a couple of days. If not, I could change this
> last script to avoid the dependence...
>
> Let me try to solve this weird situation... The purpose of this script as
> I tried to explain it to act on online.log messages after configuring this
> on a simple config script.
> The script I'm trying to obtain permission to distribute is a script that
> allows us to change the instance on a machine that has more than one (and
> that changes the INFORMIX variables accordingly). So, I think this and
> other scripts I have could benefit the community and I'm working on trying
> to make them available (most customers where I've been already have them
> somewhere).
>
> The config script looks like:
>
>
> #-----------------------------------------------------------------------------------------------------------------------------------
> # Field description:
> # 1-Online log
> msg|2-alarm_class_id|3-alarm_severity|4-alarm_class_msg|5-function|6-alarm_send|7-IDS
> versions
>
> #-----------------------------------------------------------------------------------------------------------------------------------
> #Checkpoint Completed|900|1|Checkpoint completed|ix_checkpoint|Y|:7:9:10:|
> Client host or user|901|3|Connect fail - User not trusted||Y|:7:9:10:|
> password is not correct for the database server|901|3|Connect fail - Bad
> password||Y|:7:9:10:|
> Archive started|902|2|Archive Started||Y|7:9:10:|
> Dynamic Server Started|903|3|Engine started||Y|:7:9:10:|
> Dynamic Server Stopped|903|3|Engine stopped||Y|:7:9:10:|
> Quiescent Mode|903|3|Engine entered Quiescent Mode||Y|:7:9:10:|
> On-Line Mode|903|3|Engine entered On-Line Mode||Y|:7:9:10:|
> KAIO: out of OS resources|904|4|Kaio out of OS resources||Y|:7:9:10:|
>
>
> #-----------------------------------------------------------------------
>
> So, for example, when a "KAIO*" message appears I call the alarm program
> with class_id = 904 (which I customized in the script), severity 4,
> class_msg = "Kaio out of OS resources", and it works for versions 7, 9, 10
> (11: should be added). Optionally it could call a funcion specified in the
> 5th column and defined in another shell script that's loaded by the main
> one (so that you can run very specific commands for each particular
> situation if needed)
>
> So, this is completely configurable and allows you to easily trap whatever
> our R&D did not decide to call the alarm program for.
>
>
> Another (simpler?) option would be to set ALRM_ALL_EVENTS in ONCONFIG, but
> my experience with that was not very good (but it was long ago, and I can't
> exactly remember the problems - if any - besides the obvious one: two many
> messages)
>
> Regards.
>
>
> On Tue, Dec 20, 2011 at 6:36 PM, FRANK <yunyaoqu@gmail.com> wrote:
>
>> Fernando,
>>
>> Thanks a lot! it is great if you can send me your script. I am not
>> rushing, any time is good.
>>
>> Thanks again,
>> Frank
>>
>> On Tue, Dec 20, 2011 at 12:01 PM, Fernando Nunes <domusonline@gmail.com
>> >wrote:
>>
>> > I'm not sure if the changes in the alarms made recently have changed
>> this.
>> > In the past I have created a shell script that constantly monitors
>> (with a
>> > tail -f, not pooling) the online.log and can be configured to act on
>> > specified messages (regular expressions if I remember well).
>> >
>> > This script can be configured to call alarmprogram, which I normally
>> > costumize so that it recognizes more (customized) events.
>> > The advantage of doing that is that the configuration made once for the
>> > alarms (SMS, email, syslog etc.) will work for all events.
>> >
>> > I can provide the script if you don't find a better solution. How fast
>> > would you need this?
>> >
>> > (Eric: If you're reading this, we must talk! :) )
>> > Regards
>> >
>> > On Tue, Dec 20, 2011 at 4:47 PM, FRANK <yunyaoqu@gmail.com> wrote:
>> >
>> > > Hi, Folks,
>> > >
>> > > IDS11.50 FC8, Redhat Linux.
>> > >
>> > > I am going to narrow down which job peoridically caused IDS to add new
>> > > memory segments.
>> > >
>> > > Basically, the plan is, whenever IDS is adding a new memory segment(
>> > > as in the attached online log messge) , the event will trigger my
>> > > script to take a snapshot of all current jobs running in IDS.
>> > >
>> > > My question is how to determine this event in the alarm script? Any
>> > > other good choices?( like a sensor.....)
>> > >
>> > > Thanks,
>> > > Frank
>> > >
>> > > 03:10:23 Maximum server connections 299
>> > > 03:10:23 Checkpoint Statistics - Avg. Txn Block Time 0.001, # Txns
>> > blocked
>> > > 9, Plog used 8827, Llog used 102989
>> > > 03:12:02 Dynamically allocated new virtual shared memory segment (size
>> > > 32768KB)
>> > > 03:12:02 Memory sizes:resident:3327048 KB, virtual:3313540 KB, no
>> > SHMTOTAL
>> > > limit
>> > > 03:15:23 Logical Log 17698 Complete, timestamp: 0x584eb4c3.
>> > >
>> > > --0015174ff3d497118004b488d3c9
>> > >
>> > >
>> > >
>> > >
>> >
>> >
>>
>> *******************************************************************************
>> > > Forum Note: Use "Reply" to post a response in the discussion forum.
>> > >
>> > >
>> >
>> > --
>> > Fernando Nunes
>> > Portugal
>> >
>> > http://informix-technology.blogspot.com
>> > My email works... but I don't check it frequently...
>> >
>> > --00248c7691360936ac04b4890374
>> >
>> >
>> >
>> >
>>
>> *******************************************************************************
>> > Forum Note: Use "Reply" to post a response in the discussion forum.
>> >
>> >
>>
>> --001636eeffdb59739804b48a593b
>>
>>
>>
>> *******************************************************************************
>> Forum Note: Use "Reply" to post a response in the discussion forum.
>>
>>
>
>
> --
> Fernando Nunes
> Portugal
>
> http://informix-technology.blogspot.com
> My email works... but I don't check it frequently...
>
--
Fernando Nunes
Portugal
http://informix-technology.blogspot.com
My email works... but I don't check it frequently...
--00248c6a6a42e5812604b4a4875c