I need your help.


 
Thread Tools Search this Thread
Operating Systems Solaris I need your help.
# 22  
Old 09-07-2008
Quote:
Originally Posted by matrixmadhan
Yes, thats right. But in the most of the cases the systems are loosely coupled by design such that each of the unit performs their job so seldom you could control the functionality or add functionality to process that is creating the log messages.
I agree it is uncommon but the OP stated he didn't want to read the output file for some reason.

If there are valid reasons not to read the file and then not to use the usual and sensible ways suggested elsewhere ("tail -f" or custom equivalent), then Solaris allows to still fulfill the requirement in at least one of these ways. The last two suggestions aren't intrusive to the process creating the log messages.

- patching the code that writes the data (only if source code is available).
- interpose a library that intercept the pattern write
- use a dtrace script to do the same

Of course, my suggestions probably do not make that much sense in this particular case as there are probably no valid reason not to read data appended to the output file. I would however support them should a very fast response time (<1s) is expected.

Eventing is faster and less demanding than polling.
# 23  
Old 09-07-2008
"Eventing is faster and less demanding than polling."
Yep... thats what Im trying to say...
Time is crucial in my work.. we need to report directly once the file contained the "pattern"... so we dont want to depend on polling... we are thinking of using something like triggering (eventing).
# 24  
Old 09-07-2008
Do you happen to have control over the source/module that generates the logs, then its very easy to achieve this ?
# 25  
Old 09-07-2008
No Smilie ... the problem that I dont... this is a MOTOROLA build in system that we don't have control over.... we just can read it..
# 26  
Old 09-07-2008
It would help if you answer to the questions I already asked in post #15:

You should tell more about what this log file is, what process(es) are writing to it, at what rate and what Solaris release you are using.
# 27  
Old 09-07-2008
Dear jlliagre...

the log file contains alarms for our GSM network, it's updated almost every seconds..... some of these alarms are critical, others are major. what I want to do is to run something like (ring, script.... etc) once this file recieves a critical alarm.. and we are using solaris9. and as you said, eventing (triggering) is what I need.

Thanks for your kind help
# 28  
Old 09-07-2008
As fun as would be a interposing solution, I guess that simple shell script would be enough as a basis to something that fit your needs:
Code:
#!/bin/ksh

tail -f /somepath/somelogfile | while IFS="\n" read line
do
  case "$line" in
  (*ERROR*)
    echo ERROR found in "$line"
    ;;
  (*warning*)
    echo warning found in "$line"
    ;;
  esac
done

Login or Register to Ask a Question

Previous Thread | Next Thread
Login or Register to Ask a Question