Sponsored Content
Top Forums Shell Programming and Scripting Check log file size every 10 minute. Alert if log not update Post 302763637 by ooilinlove on Wednesday 30th of January 2013 08:56:20 AM
Old 01-30-2013
Lightbulb Check log file size every 10 minute. Alert if log not update

How to check log size every 10min. by script (can use crontab)
if log size not change with alert "Log not update"

Code:
Base run on SunOS  5.8 Generic_Virtual sun4u sparc SUNW,SPARC-Enterprise

Code:
logFiles="log1.log log2.log"
logLocation="/usr/home/test/log/"

Out put.
Code:
Tue Jan 31 16:24:03 ICT 2013
log1.log :: Log not running :: Pls Check Service   1  minute.
log2.log :: Log not running :: Pls Check Service   2  minute.
 
Tue Jan 31 16:25:03 ICT 2013
log1.log :: Log not running :: Pls Check Service   3  minute.
log2.log :: OK
 
Tue Jan 31 16:26:04 ICT 2013
log1.log :: Log not running :: Pls Check Service   1  minute.
log2.log :: Log not running :: Pls Check Service   2  minute.
 
Tue Jan 31 16:27:04 ICT 2013
log1.log :: Log not running :: Pls Check Service   3  minute.
log2.log :: Log not running :: Pls Check Service   4  minute.

 

10 More Discussions You Might Find Interesting

1. HP-UX

Check size and rotate log script.

Hi Can you suggest some perl script. My OS is HP-UX 11.11 I want to it into a cron job. Every night it will backup the file with that day's date and open a dummy file. Thanks Ash (3 Replies)
Discussion started by: ashishT
3 Replies

2. Linux

Limit size of log file from syslog

Hi, I'm using Linux 2.6 cross compiled for a embedded powerpc. Earlier we were using busybox syslogd for logging the messages, but as the flexibilty is less, we decided to move to standard syslog. Now I want to limit the size of the log file (/var/log/messages) to 128K. I couldn't find... (4 Replies)
Discussion started by: jockey007
4 Replies

3. Shell Programming and Scripting

fetchmail - log file size limitation

Hi, I am using fetchmail in my application so as to download mails to the localhost where the application is hosted from the mailserver.Fetchmail is configured as as to run as a daemon polling mails during an interval of 1sec. So my concern here is, during each 2sec it is writing two... (10 Replies)
Discussion started by: DILEEP410
10 Replies

4. Shell Programming and Scripting

Check File Size For Log Rotation

Hi Can anyone assist me, I am trying to compate the size of a logfile to a maximum size 1000 and delete if exceeds the limit. The problem I am getting is the command not found for the line if ( $LOGNAME_SIZE >= $MAXSIZE); then Appreciate your response. Script: LOGDIR="/home/... (6 Replies)
Discussion started by: sureshcisco
6 Replies

5. Shell Programming and Scripting

Log file size

I am very new tothe shellscripting. I wrote a script as follows. NOW=$(date +"%b-%d-%y") LOGFILE="log-$NOW.log" sqlplus -s username/password @select.sql <<EOF >>$LOGFILE exit EOF the out put of the script file is around 20 columns.But it is not displaying in single line. Some part ofthe... (2 Replies)
Discussion started by: ronythomas
2 Replies

6. Shell Programming and Scripting

Help writing a script check log not update.

:wall:Dear All.:p How to check log size every 10min. by script (not crontab) if log size not change with alert "Log not update" My Path :: /usr/home/logical/mono/log/tplink/ My Log :: mono11_tplink.log , mono12_tplink.log , etc I want oup put. EX. if log not update. . . . Fri Jan ... (1 Reply)
Discussion started by: ooilinlove
1 Replies

7. Shell Programming and Scripting

Alert log not update every time.

My Script . This check log file size every 1 minute. #! /bin/bash logFiles="log1.log log2.log" logLocation="/usr/home/test/log/" sleepTime=60 failMessage=":: Log not running :: Pls Check Service" successMessage="OK" arr=($logFiles) arrlen=${#arr} arrcount=() date for... (0 Replies)
Discussion started by: ooilinlove
0 Replies

8. Shell Programming and Scripting

help with script Alert log not update every time.

:p Hello :) This is my script . This check log file size every 1 minute. Credit code https://www.unix.com/shell-programming-scripting/151723-help-writing-script-check-log-not-update.html #! /bin/bash logFiles="log1.log log2.log" logLocation="/usr/home/test/log/" sleepTime=60 ... (8 Replies)
Discussion started by: ooilinlove
8 Replies

9. Shell Programming and Scripting

Count of matched pattern occurences by minute and date in a log file

Anyone knows how to use AWK to achieve the following Sun Feb 12 00:41:01-00:41:59 Success:2 Fail:2 Sun Feb 12 00:42:01-00:42:59 Success:1 Fail:2 Sun Feb 12 01:20:01-01:20:59 Success:1 Fail:2 Mon Feb 13 22:41:01-22:41:59 Success:1 Fail:1 log file: Success Success Fail Fail ... (9 Replies)
Discussion started by: timmywong
9 Replies

10. Shell Programming and Scripting

Take minute per minute from a log awk

Hi, I've been trying to develop a script that performs the parsing of a log every 1 minute and then generating some statistics. I'm fairly new to programming and this is why I come to ask if I can lend a hand. this is my log: xxxx 16/04/2012 17:00:52 - xxxx714 - E234 - Time= 119 ms.... (8 Replies)
Discussion started by: jockx
8 Replies
ncalogd.conf(4) 						   File Formats 						   ncalogd.conf(4)

NAME
ncalogd.conf - NCA logging configuration file SYNOPSIS
/etc/nca/ncalogd.conf DESCRIPTION
The ncalogd.conf is used to configure Solaris Network Cache and Accelerator ("NCA") logging. The file contains two fields, key and value. The status key is used to indicate if the user wants to have NCA logging turned on. If the value of status key is enabled, then NCA logging will be turned on. If the value of the status key is disabled, then NCA logging will not be invoked. The default value is disabled. The logd_path_name key specifies the absolute pathname of the log file. The log file must be a raw device without a filesystem or a file on a local file system. The default value is /var/nca/log. logd_path_name can also contain a whitespace-delimited list of values for multiple log files to a maximum of 16. If you specify multiple log files, you must enclose the list in quotation marks ("). With multiple files, NCA logging moves to the next file on the list once the file size specified by logd_file_size has been reached. When the last file is full, NCA logging rotates back to the first file in the list. A pointer to the current log file is stored in /var/nca/current. The logd_file_size key specifies the value of the file size, in bytes, allowed for each log file specified in by the logd_path_name key. The default value is 1000000 bytes. In order to implement changes to the ncalogd.conf file, you will need to stop and start NCA logging or reboot. NCA stores logs in a binary format. Use the ncab2clf(1) utility to convert the log from a binary format to the Common Log File format. EXAMPLES
Example 1: A Sample ncalogd.conf File The following is a sample ncalogd.conf file that specifies three log files: # # NCA Log Daemon Configuration File # status=enabled logd_path_name="/var/nca/log1 /var/nca/log2 /var/nca/log3" logd_file_size=1000000 Note that there is no NCA logging daemon. Logging is performed as one of the functions of the NCA software. FILES
/etc/nca/ncalogd.conf Lists configuration parameters for NCAlogging. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWncar | +-----------------------------+-----------------------------+ |Interface Stability |Evolving | +-----------------------------+-----------------------------+ SEE ALSO
nca(1), ncab2clf(1), ncakmod(1), dd(1M), door_create(3DOOR), nca.if(4), ncakmod.conf(4), attributes(5) System Administration Guide: IP Services SunOS 5.10 22 Jan 2002 ncalogd.conf(4)
All times are GMT -4. The time now is 02:33 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy