Re: MSGPATH x syslog
Posted in 2010
I have more or less what you want... My "relatively complex script" can be setup for what you want. The configuration file must be setup with a pattern that matches every thing, and you can configure it to call a function that calls the logger. The main script already accepts arguments that allows it torun as a Daemon or as a "worker". The deamon checks all instances in the machine and launches a worker for all of them. The "workers" keep a tail -f on the file. There is one problem though... This script is written to use another one that I use to setup the environment. This script has some utility functions that can generate a list (numbers) of environments... And the workers are launched with a specific environment number. This part of the script would have to be chenged/tailored to your needs, but it should be trivial... If you want to take a look at it I can try to pre-configure it for you. I've used the scripts for some time, but I had a problem in the tail of Tru64 (the system used by the customer at the time). Regards. On Wed, Nov 24, 2010 at 12:31 AM, Cesar Inacio Martins < cesar_inacio_martins@yahoo.com.br> wrote: > Hi Fernando, > > Thanks for your suggestion. > I'm trying doing something more simple, something like, set and forget, > just like Informix is... > and easy to implement with any version of informix. > > As far I tested the logger command , they is very flexible.. > so , at first I think try this approach, please tell me your opinion: > > - write a script what should keep running 24x7 > - the script is started by any event in alarmprogram + "at" (the command) > or by crontab (each 5 minute), and run in background, maybe with nohup > - the script should be smarter to detect if him self is already running or > not ... if yes , just do nothing.. > - the basic command of the script will be: > tail -f online.log | logger -t ifx [...other parameters...] > > Here I'm still need check how send this syslog to a remote syslog server.. > but this is other problem :) > > > > On 11/23/2010 09:55 PM, Fernando Nunes wrote: > > > > On Tue, Nov 23, 2010 at 11:01 PM, Cesar Inacio Martins < > cesar_inacio_martins@yahoo.com.br> wrote: > >> Hi, >> >> Anyone know if is possible redirect the output of the MSGPATH to >> Linux/syslog ? >> >> I already think try use a pipe file + logger command... but , isn't >> elegant and I not sure if will work properly. >> >> Regards >> Cesar >> > > Hello Cesar. > I wouldn't suggest that solution. It's not clear to me what (and when) will > happen if the logger process gets killed. All pipes will buffer (and I've > seen amazing buffer capabilities....) but we never know how long... And you > could end up with the engine trying to write to a "full" fifo. It could > cause problems in the engine, or at best you could loose messages. > > So, I would suggest another approach... I think that what's relevant is the > events. So you could alter the ALARMPROGRAM script and enable it to use > logger. > In fact I've done it for a customer. The altered script has the ability to > send emails, send SMS, and write to the syslog using logger. > > The only problem I see is that unfortunately there are still important > events that don't call the ALARMPROGRAM... This is a real shame, but there > are solutions. > One I've implemented is a relatively complex script that keeps an eye on > the message log. For each message it reads it searches for it in a config > file where regular expressions are associated with actions. These actions > can be functions defined in yet another script, or simply a call to the > alarmprogram with extended event codes. > You could also turn on ALARM_ALL_EVENTS (possibly misspelled) ONCONFIG > option. > Finally there is a nice trick that can be done with sysmaster:sysonlinelog > but I would need to elaborate more on this carefully. But basically you > could write a task for the DB scheduler that keeps track of the last > position it checked, and that keeps "trailing" the new lines in onlinelog > using the SQL interface. > > If you're interested in any of this ideas I can provide more help... > > Regards. > > _______________________________________________ >> Informix-list mailing list >> Informix-list@iiug.org >> http://www.iiug.org/mailman/listinfo/informix-list >> > > > > -- > Fernando Nunes > Portugal > > http://informix-technology.blogspot.com > My email works... but I don't check it frequently... > > > _______________________________________________ > Informix-list mailing list > Informix-list@iiug.org > http://www.iiug.org/mailman/listinfo/informix-list > > -- Fernando Nunes Portugal http://informix-technology.blogspot.com My email works... but I don't check it frequently... --0015174c44005503b70495c1ff3e