- Jun 13, 2000
- 26,389
- 1,778
- 126
I'm not sure if Bash is the best to use for this. Basically, there's a program running on this system that tells me the status of a tomcat app. I wrote a bash script that executes the program and sends the output to a log file to run nightly in my crontab. I've then setup another script to email me the contents of that file. It works great.
What I want to do now is somehow filter the log file that I created and use the output to decide whether or not I get notified via Email. I need help figuring out the best way to parse the data to then put it through a >= test of some sort.
These are the two lines that I need to filter around. I only need to be Emailed when these numbers are above a certain number...say 100 or 1000. I just need notification that things are queuing up so I can fix whatever's wrong.
Current Total Bytes in System: 0
Current Messages in System: 0
Any ideas on the best way to do this? Would it be easier to do in perl? Thanks,
-Scar
What I want to do now is somehow filter the log file that I created and use the output to decide whether or not I get notified via Email. I need help figuring out the best way to parse the data to then put it through a >= test of some sort.
These are the two lines that I need to filter around. I only need to be Emailed when these numbers are above a certain number...say 100 or 1000. I just need notification that things are queuing up so I can fix whatever's wrong.
Current Total Bytes in System: 0
Current Messages in System: 0
Any ideas on the best way to do this? Would it be easier to do in perl? Thanks,
-Scar