![]() | |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
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 |
|
Informix-list mailing list Informix-list (AT) iiug (DOT) org http://www.iiug.org/mailman/listinfo/informix-list |
#3
| |||
| |||
|
| On Tue, Nov 23, 2010 at 11:01 PM, Cesar Inacio Martins cesar_inacio_martins (AT) yahoo (DOT) com.br mailto:cesar_inacio_martins (AT) yahoo (DOT) 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 (AT) iiug (DOT) org <mailto:Informix-list (AT) iiug (DOT) 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... |
#4
| |||
| |||
|
|
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 (AT) yahoo (DOT) 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 (AT) iiug (DOT) 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 (AT) iiug (DOT) org http://www.iiug.org/mailman/listinfo/informix-list |
![]() |
| Thread Tools | |
| Display Modes | |
| |