you could just configure a logfile within your script.
Alternatively you just run the script with logfile options. For example:
To put output in logfile:
To put output and errors in logfile:
To separate:
Hi there,
I have a problem here that involves bash script since I was noob in that field. Recently, I have to monitor data involve in logs so I just run command tail -f for the monitoring. The logs was generate every hour so I need to quickly change my logs every time the new hour hits according... (2 Replies)
I would like to monitor a log file using a shell script and as soon as a line with a certain string in it appears I would like to run a program. I have been playing around with doing this using tail -f, but cannot get it to work. I found something similar here:... (1 Reply)
hi All,
how to find a pattern in the log file & display the above and below line
for example in the log file, i have many lines, whenever i search for "Category" it should display the above line with only few parameter like i want only the location name & department name
Thu Jul 02 11:05:23... (2 Replies)
Hi Folks,
I need help in creating a script to monitor a continuously updating log for one particular error. If the the script finds the error it should send out an email.
Thanks for all ur help (2 Replies)
Hi Friends,
I am trying to write a script which continiously monitor one specific error message from a log file. This script should continiously monitor the file for the error and send out the email when detect the error message. I tried the below command but fails. Please help me.
tail -f... (4 Replies)
AM in need of some plugin/script that can monitor HP-UX file "/var/opt/resmon/log/event.log" .
Have written a scrip in sh shell that is working fine for syslog.log and mail.log as having standard format, have interrogated that to Nagios and is working as I required .
But same script failed to... (3 Replies)
This is my log file and this is live log.
Any abnormal error other than following
I need to generate the email.
Log path : /DER/app/admin/ABC/bdump/erg.log
Current log# 2 seq# 103046 mem# 0: /ora2/oradata/ABC/redo02a.log
Current log# 2 seq# 103046 mem# 1:... (1 Reply)
This is my log file and this is live log.
Any abnormal error other than following
I need to generate the email.
Log path : /DER/app/admin/ABC/bdump/erg.log
Current log# 2 seq# 103046 mem# 0: /ora2/oradata/ABC/redo02a.log
Current log# 2 seq# 103046 mem# 1:... (7 Replies)
Hi,
Have written a script to monitor linux non standard log file based on line numbers, so each check store $otalinenum ..
then in next check after 10 minutes it compre the current_total_line_num > last_total_line_num then it will parse the log file from last_total_line_num to... (0 Replies)
Hi,
I need to amend an existing ksh script so that it runs a process (stop weblogic) and in parallel needs to monitor a log file (startup.log) in the background for a certain string (e.g. unable to stop weblogic). If the string appears in the log i need to kill the stop weblogic process.
... (5 Replies)
Discussion started by: dholmaster
5 Replies
LEARN ABOUT LINUX
bootlogd
BOOTLOGD(8) Linux System Administrator's Manual BOOTLOGD(8)NAME
bootlogd - record boot messages
SYNOPSIS
/sbin/bootlogd [-c] [-d] [-r] [-s] [-v] [ -l logfile ] [ -p pidfile ]
DESCRIPTION
Bootlogd runs in the background and copies all strings sent to the /dev/console device to a logfile. If the logfile is not accessible, the
messages will be kept in memory until it is.
OPTIONS -d Do not fork and run in the background.
-c Attempt to write to the logfile even if it does not yet exist. Without this option, bootlogd will wait for the logfile to appear
before attempting to write to it. This behavior prevents bootlogd from creating logfiles under mount points.
-r If there is an existing logfile called logfile rename it to logfile~ unless logfile~ already exists.
-s Ensure that the data is written to the file after each line by calling fdatasync(3). This will slow down a fsck(8) process running
in parallel.
-v Show version.
-l logfile
Log to this logfile. The default is /var/log/boot.
-p pidfile
Put process-id in this file. The default is no pidfile.
BUGS
Bootlogd works by redirecting the console output from the console device. (Consequently bootlogd requires PTY support in the kernel con-
figuration.) It copies that output to the real console device and to a log file. There is no standard way of ascertaining the real con-
sole device if you have a new-style /dev/console device (major 5, minor 1) so bootlogd parses the kernel command line looking for con-
sole=... lines and deduces the real console device from that. If that syntax is ever changed by the kernel, or a console type is used that
bootlogd does not know about then bootlogd will not work.
AUTHOR
Miquel van Smoorenburg, miquels@cistron.nl
SEE ALSO dmesg(8),fdatasync(3).
Jul 21, 2003 BOOTLOGD(8)