monitoring logfile
Suppose logs are updating in regular log file..I just want to automate with the script when there is no logs updation..i have url with me from where i can get alerts.
|
Quote:
|
I read this earlier. I am usually able to get some kind of clue of what someone is talking about, but in this case I really got nothing. No idea what this is referring to.
|
And please mark your subject as something meaningful, not just "help".
|
Set alerts for a log while when it stops updating
Hi All,
I have a log file which keeps on updating with time i.e. bmg@CCHNUSSDAPZP01 edr]$ ll pullprocessoredr.log* -rw-rw-r-- 1 bmg bmg 928660 Aug 10 17:34 pullprocessoredr.log -rw-rw-r-- 1 bmg bmg 30147 Aug 10 00:59 pullprocessoredr.log_2011-08-10-00.gz when the logs stop updating then I want to set alerts for it. There are no exceptions coming in these log files when it stops updating. Kindly suggest Thanks in advance |
SNMPtrap, monitoring tools like Nagios...
|
RAVINDER_KUKREJA, if you're finding someone's solution unhelpful, you need to respond with why, perhaps giving more details about your question/problem so that people can provide better answers. I'm assuming, of course, that you're the one who's marking responses to your threads as such, obviously.
|
Hello,
Have a look at logwatch, write your own scripts or use a monitoring tool as suggested by kirukan, whose post didn't need negative rep as pointed out by Nylex. May I offer you some friendly advice? Have a look at Google before asking general questions of that kind. You will learn a lot more trying to find out something and/or following instructions you've found online. Kind regards, Eric |
1. First of all check the intervals in which the logs are getting updated (say 5 mins )
schedule the following script in cron every 5 mins if your script gets updated within 5 mins to send an alert mail in case it is not getting updated . Note :- Please check out for mistakes in the script , i just type it in there . #!/bin/bash #######################################START OF SCRIPT########################################## logfile=SPECIFYNAME if [ -f /tmp/acctime ] then acctime=`cat /tmp/acctime` fi newacctime=`ls -ltr | awk '{print $8}' $logfile` echo $newacctime > /tmp/acctime if [ $acctime=$newacctime ] then echo "Please check logs or whatever message" | mailx -s "Log files update message" receiver@abc.com fi ####################################END OF SCRIPT################################# |
All times are GMT -5. The time now is 05:47 PM. |