LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   monitoring logfile (https://www.linuxquestions.org/questions/linux-newbie-8/monitoring-logfile-896370/)

RAVINDER_KUKREJA 08-09-2011 10:23 AM

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.

tinyTux 08-09-2011 12:06 PM

Quote:

Originally Posted by RAVINDER_KUKREJA (Post 4437797)
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.

I don't want to waste your zero reply status. However, I am fairly certain that the reason no one has responded is because no one understands your question. Please rewrite your question with more detail. You may also want to have someone help you with your English if that is an issue.

szboardstretcher 08-09-2011 12:08 PM

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.

xwjitftu 08-09-2011 12:45 PM

And please mark your subject as something meaningful, not just "help".

RAVINDER_KUKREJA 08-10-2011 07:08 AM

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

kirukan 08-10-2011 07:13 AM

SNMPtrap, monitoring tools like Nagios...

Nylex 08-10-2011 12:44 PM

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.

EricTRA 08-10-2011 01:15 PM

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

priyophan 08-10-2011 04:37 PM

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.