<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Monitoring a Log File in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/monitoring-a-log-file/m-p/3142625#M802013</link>
    <description>The reason being tail -f sleeps for one second according to the UNIX man pages! Sometimes the log file may be appended with lots of lines so I'm worried that tail may not be doing an efficient tailing due to the sleep time!&lt;BR /&gt;&lt;BR /&gt;Thanks.</description>
    <pubDate>Tue, 16 Dec 2003 20:31:35 GMT</pubDate>
    <dc:creator>dude70_1</dc:creator>
    <dc:date>2003-12-16T20:31:35Z</dc:date>
    <item>
      <title>Monitoring a Log File</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/monitoring-a-log-file/m-p/3142601#M801989</link>
      <description>Hi Guys,&lt;BR /&gt;&lt;BR /&gt;I need to monitor at the end of a logfile using a korn script continuously for a particular phrase to occur. Like "Error Occured" then I have to  read the whole line and write to another file. Can you guys provide me any help!&lt;BR /&gt;&lt;BR /&gt;Thanks in advance!&lt;BR /&gt;Dude70</description>
      <pubDate>Thu, 11 Dec 2003 13:01:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/monitoring-a-log-file/m-p/3142601#M801989</guid>
      <dc:creator>dude70_1</dc:creator>
      <dc:date>2003-12-11T13:01:28Z</dc:date>
    </item>
    <item>
      <title>Re: Monitoring a Log File</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/monitoring-a-log-file/m-p/3142602#M801990</link>
      <description>Hi&lt;BR /&gt;&lt;BR /&gt;Try&lt;BR /&gt;&lt;BR /&gt;tail logfile | grep "error occured" &amp;gt; otherfile&lt;BR /&gt;&lt;BR /&gt;As a start point&lt;BR /&gt;&lt;BR /&gt;Paula</description>
      <pubDate>Thu, 11 Dec 2003 13:05:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/monitoring-a-log-file/m-p/3142602#M801990</guid>
      <dc:creator>Paula J Frazer-Campbell</dc:creator>
      <dc:date>2003-12-11T13:05:53Z</dc:date>
    </item>
    <item>
      <title>Re: Monitoring a Log File</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/monitoring-a-log-file/m-p/3142603#M801991</link>
      <description>A little more&lt;BR /&gt;&lt;BR /&gt;Create a file called monitorlog containing:-&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;--------------cut-----------------&lt;BR /&gt;#!/bin/sh&lt;BR /&gt;tail logfile | grep error occured &amp;gt; otherfile&lt;BR /&gt;sleep 10 &lt;BR /&gt;exec monirorlog&lt;BR /&gt;----------------cut--------------&lt;BR /&gt;&lt;BR /&gt;this will check the file and write out the error to otherfile, sleep for 10 seconds and then restart itself.&lt;BR /&gt;&lt;BR /&gt;Paula&lt;BR /&gt;&lt;BR /&gt;HTH&lt;BR /&gt;&lt;BR /&gt;Paula</description>
      <pubDate>Thu, 11 Dec 2003 13:09:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/monitoring-a-log-file/m-p/3142603#M801991</guid>
      <dc:creator>Paula J Frazer-Campbell</dc:creator>
      <dc:date>2003-12-11T13:09:33Z</dc:date>
    </item>
    <item>
      <title>Re: Monitoring a Log File</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/monitoring-a-log-file/m-p/3142604#M801992</link>
      <description>Modify the attached script, point it to the log you want to monitor, change lbolt to error or whatever and don't forget to change the email address.&lt;BR /&gt;&lt;BR /&gt;I will have to embarass you if I get an email from your system... :-)&lt;BR /&gt;&lt;BR /&gt;SEP</description>
      <pubDate>Thu, 11 Dec 2003 13:11:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/monitoring-a-log-file/m-p/3142604#M801992</guid>
      <dc:creator>Steven E. Protter</dc:creator>
      <dc:date>2003-12-11T13:11:42Z</dc:date>
    </item>
    <item>
      <title>Re: Monitoring a Log File</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/monitoring-a-log-file/m-p/3142605#M801993</link>
      <description>Thanks Paula,&lt;BR /&gt;&lt;BR /&gt;Thing is the log file is dumped with lots of errors some times. I don't want to read the same error again. I want to start from the point where I finished reading before.&lt;BR /&gt;&lt;BR /&gt;Thanks.</description>
      <pubDate>Thu, 11 Dec 2003 13:12:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/monitoring-a-log-file/m-p/3142605#M801993</guid>
      <dc:creator>dude70_1</dc:creator>
      <dc:date>2003-12-11T13:12:53Z</dc:date>
    </item>
    <item>
      <title>Re: Monitoring a Log File</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/monitoring-a-log-file/m-p/3142606#M801994</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;look here:&lt;BR /&gt;&lt;A href="http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=293706" target="_blank"&gt;http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=293706&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;greetings,&lt;BR /&gt;&lt;BR /&gt;Michael&lt;BR /&gt;</description>
      <pubDate>Thu, 11 Dec 2003 13:13:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/monitoring-a-log-file/m-p/3142606#M801994</guid>
      <dc:creator>Michael Schulte zur Sur</dc:creator>
      <dc:date>2003-12-11T13:13:41Z</dc:date>
    </item>
    <item>
      <title>Re: Monitoring a Log File</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/monitoring-a-log-file/m-p/3142607#M801995</link>
      <description>Neat script Steven,&lt;BR /&gt;&lt;BR /&gt;I was just giving pointers, you gave the solution.&lt;BR /&gt;&lt;BR /&gt;;^)&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Paula</description>
      <pubDate>Thu, 11 Dec 2003 13:14:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/monitoring-a-log-file/m-p/3142607#M801995</guid>
      <dc:creator>Paula J Frazer-Campbell</dc:creator>
      <dc:date>2003-12-11T13:14:55Z</dc:date>
    </item>
    <item>
      <title>Re: Monitoring a Log File</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/monitoring-a-log-file/m-p/3142608#M801996</link>
      <description>Hi&lt;BR /&gt;&lt;BR /&gt;Can you post an example of the log file?&lt;BR /&gt;&lt;BR /&gt;Paula</description>
      <pubDate>Thu, 11 Dec 2003 13:16:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/monitoring-a-log-file/m-p/3142608#M801996</guid>
      <dc:creator>Paula J Frazer-Campbell</dc:creator>
      <dc:date>2003-12-11T13:16:06Z</dc:date>
    </item>
    <item>
      <title>Re: Monitoring a Log File</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/monitoring-a-log-file/m-p/3142609#M801997</link>
      <description>Hi Dude70,&lt;BR /&gt;&lt;BR /&gt;this is the script from the thread from Bryan:&lt;BR /&gt;tail -f log.txt | while read LINE&lt;BR /&gt;do&lt;BR /&gt;echo $LINE | grep "Error Occured" &amp;gt;&amp;gt; log2.txt&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;greetings,&lt;BR /&gt;&lt;BR /&gt;Michael&lt;BR /&gt;</description>
      <pubDate>Thu, 11 Dec 2003 13:17:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/monitoring-a-log-file/m-p/3142609#M801997</guid>
      <dc:creator>Michael Schulte zur Sur</dc:creator>
      <dc:date>2003-12-11T13:17:12Z</dc:date>
    </item>
    <item>
      <title>Re: Monitoring a Log File</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/monitoring-a-log-file/m-p/3142610#M801998</link>
      <description>how about this&lt;BR /&gt;&lt;BR /&gt;tail -f logfile | grep my_error&lt;BR /&gt;&lt;BR /&gt;tail will keep waiting on the logfile and feed new lines to grep as they occur continuing until you kill the process.&lt;BR /&gt;&lt;BR /&gt;John.</description>
      <pubDate>Thu, 11 Dec 2003 13:21:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/monitoring-a-log-file/m-p/3142610#M801998</guid>
      <dc:creator>John Carr_2</dc:creator>
      <dc:date>2003-12-11T13:21:32Z</dc:date>
    </item>
    <item>
      <title>Re: Monitoring a Log File</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/monitoring-a-log-file/m-p/3142611#M801999</link>
      <description>Thanks Paula,&lt;BR /&gt;&lt;BR /&gt;That script has saved me from two production problems this year.&lt;BR /&gt;&lt;BR /&gt;The kudos are better than points.&lt;BR /&gt;&lt;BR /&gt;My script is run daily via cron. For your situation you'll want to run it probably several times an hour. If you lose networking, it obviously won't help much.&lt;BR /&gt;&lt;BR /&gt;SEP</description>
      <pubDate>Thu, 11 Dec 2003 13:29:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/monitoring-a-log-file/m-p/3142611#M801999</guid>
      <dc:creator>Steven E. Protter</dc:creator>
      <dc:date>2003-12-11T13:29:49Z</dc:date>
    </item>
    <item>
      <title>Re: Monitoring a Log File</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/monitoring-a-log-file/m-p/3142612#M802000</link>
      <description>Thanks guys for the overwhelming response! It was very helpful and I appreciate it. &lt;BR /&gt;&lt;BR /&gt;I have a small question here. If my script is waiting for the string "Error Occured" indefinitely,  will it create any perfornmance problem in the system?  Because I want to run this script 24 * 7 * 365.</description>
      <pubDate>Thu, 11 Dec 2003 17:38:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/monitoring-a-log-file/m-p/3142612#M802000</guid>
      <dc:creator>dude70_1</dc:creator>
      <dc:date>2003-12-11T17:38:00Z</dc:date>
    </item>
    <item>
      <title>Re: Monitoring a Log File</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/monitoring-a-log-file/m-p/3142613#M802001</link>
      <description>Also If I want to stop this script running in the background how should I do it?&lt;BR /&gt;&lt;BR /&gt;Thanks!</description>
      <pubDate>Thu, 11 Dec 2003 17:42:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/monitoring-a-log-file/m-p/3142613#M802001</guid>
      <dc:creator>dude70_1</dc:creator>
      <dc:date>2003-12-11T17:42:47Z</dc:date>
    </item>
    <item>
      <title>Re: Monitoring a Log File</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/monitoring-a-log-file/m-p/3142614#M802002</link>
      <description>Your best bet on running my script after you modify it(ignore if I'm wrong) is to run it on a reasonable schedule with cron.&lt;BR /&gt;&lt;BR /&gt;If your system totally halts, everyone is going to notice and the script is no good.&lt;BR /&gt;&lt;BR /&gt;If you run it once a minute and an error occurs with a DNS server and you get hundreds of errors, you are going to have a mailbox problem. Its going to be very full.&lt;BR /&gt;&lt;BR /&gt;If you really want continuous monitoring then you will probably want the script to set a flag after it detects and error. Say change a data file in /etc from 0 to 1.  When it picks up errors it makes a decision about doing a duplicate email, and only tries that say once a day.&lt;BR /&gt;&lt;BR /&gt;Running the script too often is likely to burn too much resources.  &lt;BR /&gt;&lt;BR /&gt;If the system is mission critical(mine are) and you can't even tolerate 10 seconds of non-resopnse, then run it regularly or consider other kinds of monitoring tools like scm.&lt;BR /&gt;&lt;BR /&gt;The script I uploaded only runs once a day. Its looking for bad disk drives and if it finds one, it runs another program that checks out all the disks.  I'm attaching that as a reference because its useful as well.&lt;BR /&gt;&lt;BR /&gt;Good Luck, thanks for the compliments and the points.&lt;BR /&gt;&lt;BR /&gt;SEP</description>
      <pubDate>Thu, 11 Dec 2003 17:49:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/monitoring-a-log-file/m-p/3142614#M802002</guid>
      <dc:creator>Steven E. Protter</dc:creator>
      <dc:date>2003-12-11T17:49:29Z</dc:date>
    </item>
    <item>
      <title>Re: Monitoring a Log File</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/monitoring-a-log-file/m-p/3142615#M802003</link>
      <description>Hi Steven&lt;BR /&gt;&lt;BR /&gt;I am actually using the following script and it is just fine for my purpose(writing all errors to another log). I want it to run 24*7. If I run this in the background forever is it ok? If I want to kill it(running in the background) how do I do it?&lt;BR /&gt;&lt;BR /&gt;Thanks. &lt;BR /&gt;&lt;BR /&gt;*******&lt;BR /&gt;tail -f log.txt | while read LINE&lt;BR /&gt;do&lt;BR /&gt;echo $LINE | grep "Error Occured" &amp;gt;&amp;gt; log2.txt&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;**********</description>
      <pubDate>Thu, 11 Dec 2003 17:59:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/monitoring-a-log-file/m-p/3142615#M802003</guid>
      <dc:creator>dude70_1</dc:creator>
      <dc:date>2003-12-11T17:59:30Z</dc:date>
    </item>
    <item>
      <title>Re: Monitoring a Log File</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/monitoring-a-log-file/m-p/3142616#M802004</link>
      <description>SEP&amp;gt; Modify the attached script, point it to the log you want to monitor, change lbolt to error or whatever and don't forget to change the email address.&lt;BR /&gt;&lt;BR /&gt;SEP&amp;gt; 41228.sh&lt;BR /&gt;SEP&amp;gt; :&lt;BR /&gt;SEP&amp;gt; /usr/sbin/dmesg | grep lbolt &amp;gt; /tmp/checkwardware&lt;BR /&gt;SEP&amp;gt; errs=`wc -l /tmp/checkwardware | awk {'print $1'}`&lt;BR /&gt;&lt;BR /&gt;nit picking.... since the tmp file is only used to count lines from,&lt;BR /&gt;How about replacing the above two lines form the suggested script by this one:&lt;BR /&gt;&lt;BR /&gt;/usr/sbin/dmesg | errs=`grep -c  lbolt`&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;fwiw,&lt;BR /&gt;Hein.&lt;BR /&gt;</description>
      <pubDate>Fri, 12 Dec 2003 00:28:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/monitoring-a-log-file/m-p/3142616#M802004</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2003-12-12T00:28:06Z</dc:date>
    </item>
    <item>
      <title>Re: Monitoring a Log File</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/monitoring-a-log-file/m-p/3142617#M802005</link>
      <description>Hi Dude70,&lt;BR /&gt;&lt;BR /&gt;I have tested it. This script takes absolutely no cpu resources whatsoever, while waiting for a line. Tail -f is like a programme waiting for an input from stdin and the user is drinking his coffee. ;-) So you can run it 24 hours per day without problems.&lt;BR /&gt;&lt;BR /&gt;have fun here,&lt;BR /&gt;&lt;BR /&gt;Michael&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 12 Dec 2003 04:47:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/monitoring-a-log-file/m-p/3142617#M802005</guid>
      <dc:creator>Michael Schulte zur Sur</dc:creator>
      <dc:date>2003-12-12T04:47:25Z</dc:date>
    </item>
    <item>
      <title>Re: Monitoring a Log File</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/monitoring-a-log-file/m-p/3142618#M802006</link>
      <description>Hi Dude70,&lt;BR /&gt;&lt;BR /&gt;If you do it manually, do a ps -ef | grep yourscriptname.&lt;BR /&gt;Then kill -9 pid.&lt;BR /&gt;&lt;BR /&gt;have fun,&lt;BR /&gt;&lt;BR /&gt;Michael&lt;BR /&gt;</description>
      <pubDate>Fri, 12 Dec 2003 04:50:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/monitoring-a-log-file/m-p/3142618#M802006</guid>
      <dc:creator>Michael Schulte zur Sur</dc:creator>
      <dc:date>2003-12-12T04:50:44Z</dc:date>
    </item>
    <item>
      <title>Re: Monitoring a Log File</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/monitoring-a-log-file/m-p/3142619#M802007</link>
      <description>Thanks Michael!</description>
      <pubDate>Fri, 12 Dec 2003 14:05:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/monitoring-a-log-file/m-p/3142619#M802007</guid>
      <dc:creator>dude70_1</dc:creator>
      <dc:date>2003-12-12T14:05:35Z</dc:date>
    </item>
    <item>
      <title>Re: Monitoring a Log File</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/monitoring-a-log-file/m-p/3142620#M802008</link>
      <description>Guys,&lt;BR /&gt;&lt;BR /&gt;I have a small problem here!&lt;BR /&gt;I am trying to capture the line that has the "Error Occured" string&lt;BR /&gt;&lt;BR /&gt;tail -f log.txt | while read LINE&lt;BR /&gt;do&lt;BR /&gt;var= `echo $LINE | grep "Error Occured"`&lt;BR /&gt;echo $var&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Apart from assigning the line to the variable var, list of files in the working directory is also added to $var. What am I doing wrong here?&lt;BR /&gt;</description>
      <pubDate>Fri, 12 Dec 2003 21:00:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/monitoring-a-log-file/m-p/3142620#M802008</guid>
      <dc:creator>dude70_1</dc:creator>
      <dc:date>2003-12-12T21:00:50Z</dc:date>
    </item>
  </channel>
</rss>

