Sponsored Content
Top Forums Shell Programming and Scripting permanent log monitoring and leaving the console Post 302351719 by MartinF on Wednesday 9th of September 2009 10:17:47 AM
Old 09-09-2009
Computer

Thank you guys for your help.
wc -l wouldn't work too well, because old datas from the log are backed up (so there would have to be some IFs...)
Meanwhile I had a lot of other job and now when I came back to this problem I found a solution, I created a small stop.sh, which adds some texts like 'You should STOP' at the end of application_common.log, and then let the main script in while statement do following test:

echo ${line} | grep 'You should STOP' >> /dev/null
if [ $? = 0 ]
then
echo "Logged at:"`date '+%h %d %H:%M:%S'`"The monitor is being shut down" >> ${LOGDIR}/extracted_errors.log
exit 0
fi

This works fine.. so farSmilie
So if anybody would have the same problem, this could be a soultion for you too.Smilie
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

log monitoring

Hi there, I have an application runnig on HP_UX which logs critical mesages to a log file. What I would like to do is tail the log file and report on new messages. Easy....I here you say. The log file is continuing to be written to and the check scritp will be executed from cron. I was... (2 Replies)
Discussion started by: nhatch
2 Replies

2. UNIX for Dummies Questions & Answers

Console Log

Does anyone know how to redirect any messages sent to /dev/console to a file. Thanks in advance. (4 Replies)
Discussion started by: kdreaves
4 Replies

3. Shell Programming and Scripting

Log Monitoring through Perl

Hi, I am new to perl. I want to write a perl script to monitor logs. Where i want to monitor exceptions logged or any kind of error strings. I have a dir(On Solaris) with multiple log file which keeps rolling to .gz file after some time in that same dir. These logs files size keeps on... (0 Replies)
Discussion started by: solitare123
0 Replies

4. Windows & DOS: Issues & Discussions

Log monitoring in windows

Hi, I'd like to know if there is a way to monitor a log file conitnuously for one or more strings and if found, send an alarm. It should also take care not to inlcude the old log file entries. Thanks. (2 Replies)
Discussion started by: er_ashu
2 Replies

5. Shell Programming and Scripting

Monitoring log file

Hi, I ned to monitor the tomcat log file called "catalina.out" for "Out of memory" error. the script should monitor this file and send us the mail as soon as it finds the string "Out of memory" in the file. can ypu suggest me which is the best way to do this? (4 Replies)
Discussion started by: shivanete
4 Replies

6. UNIX for Dummies Questions & Answers

Console Log in..

Hi, Can anubody tell me how to log in to a remote server through console? Your help is appreciated.. (5 Replies)
Discussion started by: Amol21
5 Replies

7. Red Hat

Cannot log from console login

Hello All, I'm facing the following problem: On a specific server I have installed Red Hat ES 4.5 and everything seems ok. But after a specific reboot, when the login prompt on the console, I put the root password and I canīt log on. It is strange for me due to if y try to log on using SSH I... (1 Reply)
Discussion started by: mig28mx
1 Replies

8. Shell Programming and Scripting

log monitoring

Hi All; I have a log file(dynamic) which i need to monitor; the format of the log file is as follows #Session ID STATUS The status can be one of the three /starting ;/loading ;/success Example #Session ID STATUS ABC /started.html XYZ /started.html ABC /loading.html ABC... (2 Replies)
Discussion started by: maverick_here
2 Replies

9. Solaris

Can not log onto console

Hi, I have been trolling thorugh vast numbers of information but have not yet found a solution to my problem. I am unable to log onto my servers console and I can not explain whats going on. I am running Solaris 10 and have a console connected to it via a kvm switch. I am able to see the... (2 Replies)
Discussion started by: philjt88
2 Replies

10. Shell Programming and Scripting

Output to console and to log

I have a menu based script where user will select different action via displayed menu. I want to log all the action or say whatever displayed on screen to a log file and want to achieve with in the same script. i tried named pipe as below.. logfile=mylogfile mkfifo ${logfile}.pipe... (3 Replies)
Discussion started by: vidyadhar85
3 Replies
IP-MONITOR(8)							       Linux							     IP-MONITOR(8)

NAME
ip-monitor, rtmon - state monitoring SYNOPSIS
ip [ ip-OPTIONS ] monitor [ all | OBJECT-LIST ] [ file FILENAME ] DESCRIPTION
The ip utility can monitor the state of devices, addresses and routes continuously. This option has a slightly different format. Namely, the monitor command is the first in the command line and then the object list follows: ip monitor [ all | OBJECT-LIST ] [ file FILENAME ] OBJECT-LIST is the list of object types that we want to monitor. It may contain link, address, route, mroute, prefix, neigh and netconf. If no file argument is given, ip opens RTNETLINK, listens on it and dumps state changes in the format described in previous sections. If the file option is given, the program does not listen on RTNETLINK, but opens the given file, and dumps its contents. The file should contain RTNETLINK messages saved in binary format. Such a file can be generated with the rtmon utility. This utility has a command line syntax similar to ip monitor. Ideally, rtmon should be started before the first network configuration command is issued. F.e. if you insert: rtmon file /var/log/rtmon.log in a startup script, you will be able to view the full history later. Nevertheless, it is possible to start rtmon at any time. It prepends the history with the state snapshot dumped at the moment of starting. SEE ALSO
ip(8) AUTHOR
Original Manpage by Michail Litvak <mci@owl.openwall.com> iproute2 13 Dec 2012 IP-MONITOR(8)
All times are GMT -4. The time now is 05:52 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy