Sponsored Content
Full Discussion: log monitoring
Top Forums Shell Programming and Scripting log monitoring Post 302435682 by gaithrit on Thursday 8th of July 2010 02:58:38 AM
Old 07-08-2010
If the file is being appended for every run and only the appended lines need to be processed. Suppose run1 is the file of the first run and run2 is the file of second run which has same content as run1 and some extra appended lines. The appended lines can be brought into a separate file and this file can be processed.

The command and ouput is :
Code:
bash-3.00$ cat run1
Hi
Bye
bash-3.00$ cat run2
Hi
Bye
See
You
bash-3.00$ tail -n $((`cat run2 | wc -l` - `cat run1 | wc -l`)) run2
See
You
bash-3.00$

This command gives the extra lines from run2. Hope this helps.

Thanks.

Last edited by pludi; 07-08-2010 at 04:10 AM..
 

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. 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

3. 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

4. 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

5. Shell Programming and Scripting

Automate Log Monitoring Process

I am a new member of this forum and am also new to unix shell scripting. I joined the forum to seek for help to achieve my task as this forum helps people. here's what i do manually on daily basis 1)Loginto different unix box 2)Ftp the log files (morethan 50 each dir) to windows 3)use text pad... (3 Replies)
Discussion started by: sharugan
3 Replies

6. Shell Programming and Scripting

Monitoring a users log in time?

how do i start with this guys? Sample run: $ LOGTIME it2015678 <enter> User it2015678 is CRUZ Tommy H And has logged on to the system for: 8 hours 12 minutes from the time this script was run. (1 Reply)
Discussion started by: skypigeon
1 Replies

7. Shell Programming and Scripting

Online log monitoring script

#!/bin/bash tail /oracle/app/admin/ABC/bdump/alert_ABC.log >> tempoutput& Error=`egrep 'error|warn|critical|fail|ORA-1683' tempoutput` echo "$Error" |mailx -s "ABC Error " ABCD@domain.lk cat /dev/null > tempoutput I wrote this script and put in to cronjob every 5 min. so every 5... (4 Replies)
Discussion started by: hishanms
4 Replies

8. Shell Programming and Scripting

Monitoring log for FATAL in last 15mins only

Hi all, I need to develop the following script. Could anyone please provide me some inputs. 1) Monitor the system log file (sys.log) for any lines in the parameter file that will contain all the different phrases of FATAL errors that the process has to scan for in the sys.log. If any FATAL... (7 Replies)
Discussion started by: stunnerz_84
7 Replies

9. Shell Programming and Scripting

Monitoring script for a log file

Hi, I need to get a script working to monitor a log file and throw an alert via mailx as soon as a particular error is encountered. I do not want repeatative email notifications of same error so simply cat logfile and grepping the error would not work. Here is what i planned but it seems... (2 Replies)
Discussion started by: roshan.171188
2 Replies

10. UNIX for Beginners Questions & Answers

Monitoring script for Log file

Hi, Iam new to unix , plz help me to write below script. I need to write a script for Monitoring log file when any error occurs it has to send a mail to specified users and it should be always pick latest error not the existing one and the script should be able to send mail all errors (more... (1 Reply)
Discussion started by: vij05
1 Replies
cmvxserviced(1m)														  cmvxserviced(1m)

NAME
cmvxserviced - monitor VxVM and CVM volumes for a high availability package. SYNOPSIS
cmvxserviced [-h|-v] [-O log_file] [-D log_level] [-t poll_interval] volume_path... DESCRIPTION
cmvxserviced monitors VxVM and CVM volumes. It runs as a service within a package that depends on the monitored storage. When a monitored volume fails or becomes inaccessible (see Scope of Monitoring), the service will exit, causing the package to fail on the current node. The package's failover behavior depends on its configured settings. cmvxserviced periodically probes each volume named by volume_path, which must identify a block device file. Scope of Monitoring The VxVM Volume Monitor detects the following failures: o Failure of the last link to a storage device or set of devices critical to volume operation o Failure of a storage device or set of devices critical to volume operation o An unexpected detachment or disablement of a volume The VxVM Volume Monitor does not detect the following failures: o Failure of a redundant link to a storage device or set of devices if a functioning link remains o Failure of a mirrored plex within a volume (assuming at least one plex is functional) o Corruption of data on a volume which VxVM or CVM regards as enabled and active Options cmvxserviced supports the following options: -h Displays the usage, as listed above, and exits. -v Displays the monitor version and exits. NOTE Do not include the -h or -v parameters in your service command; this will result in immediate package failure at runtime. -O log_file Specifies a file for logging (log messages are printed to the console by default). -D log_level Specifies the log level. The level of detail logged is directly proportional to the numerical value of the log level. That is, a log level of 7 will provide the greatest amount of log information. The default log level is 0. -t poll_interval Specifies the interval between volume probes. You can specify a polling interval of as little as 1 (one second), but bear in mind that a short polling interval (less than 10 seconds) may impair system performance if you are monitoring a large number of volumes. HP recom- mends a polling interval of at least 10 seconds if 50 or more volumes are being monitored by a single service com- mand. The default polling interval is 60 seconds. EXAMPLES
/usr/sbin/cmvxserviced -O /pkg1/monlog.log -D 3 /dev/vx/dsk/cvm_dg0/lvol2 This command monitors a single volume, /dev/vx/dsk/cvm_dg0/lvol2, at log level 3, with a polling interval of 60 seconds, and prints all log messages to the file /pkg1/monlog.log. There should be a one to one relationship between monitoring services and log files. This provides a means to correlate log messages with the originating monitor. /usr/sbin/cmvxserviced /dev/vx/dsk/cvm_dg0/lvol1 dev/vx/dsk/cvm_dg0/lvol2 This command monitors two volumes at the default log level of 0, with a polling interval of 60 seconds, and prints all log messages to the console. /usr/sbin/cmvxserviced -t 10 /dev/vx/dsk/cvm_dg2/lvol3 This command monitors a single volume at log level 0, with a polling interval of 10 seconds, and prints all log messages to the console. AUTHOR
cmvxserviced was developed by HP. Requires Optional Serviceguard Software cmvxserviced(1m)
All times are GMT -4. The time now is 03:35 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy