<?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: checklist script in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/checklist-script/m-p/4225595#M327922</link>
    <description>&lt;!--!*#--&gt;Sudhakar,&lt;BR /&gt;&lt;BR /&gt;Thanks for the inputs, but you are not actually running that every day I hope??&lt;BR /&gt;&lt;BR /&gt;- Why grep syslog over and over? Let grep look for all 'intersting' lines in one command? But what about new, unlisted problem signatures? It may be better to let grep exclude lines which are deemed 'not so interesting' for the application such that you will also catch those 'new' errors.&lt;BR /&gt;&lt;BR /&gt;- If you do want to grep for problems in 'zones' (error, fail, ...) then don't you want to identify those zones with a seperator (a few empties, a line of dashes, whatever).&lt;BR /&gt;&lt;BR /&gt;- By doing the known potential issues in chunks, you'll loose easy access to time context. &lt;BR /&gt;&lt;BR /&gt;- Do you really want to see last weeks errors highlighted again and again?&lt;BR /&gt;&lt;BR /&gt;Imho you need either a marker file with the last record looked at last time (tail 1 syslog &amp;gt; last_syslog_looked_at :-),&lt;BR /&gt;or you need to pre-filter for yesterday (and today ?!)&lt;BR /&gt;&lt;BR /&gt;For example:&lt;BR /&gt;&lt;BR /&gt;$ yesterday=$(TZ=$TZ+24 date +"%b %e")&lt;BR /&gt;$ today=$(date +"%b %e")&lt;BR /&gt;$ echo $yesterday $today&lt;BR /&gt;Jun 30 Jul 1&lt;BR /&gt;$ grep -E "^$yesterday|^$today" /var/adm/syslog/syslog.log | grep -iE "error|fail"&lt;BR /&gt;&lt;BR /&gt;To 'analyze' syslog properly I suspect that you quickly need a real script instead of a buch of greps.&lt;BR /&gt;&lt;BR /&gt;Here is a starting point in the shape of a perl scripts which goes over an input file (syslog) just once and examines each line for a list of matches.&lt;BR /&gt;On match it pushed that line into an array for those matches.&lt;BR /&gt;At end of input report for each match type:&lt;BR /&gt;&lt;BR /&gt;$ cat syslog_filter.pl&lt;BR /&gt;use warnings;&lt;BR /&gt;use strict;&lt;BR /&gt;my @targets = qw ( error fail hein fault );&lt;BR /&gt;my @AoA; # Array of Arrays&lt;BR /&gt;my $i;&lt;BR /&gt;while (&amp;lt;&amp;gt;) {&lt;BR /&gt;  foreach $i ( 0 .. @targets - 1 ) {&lt;BR /&gt;    if (/$targets[$i]/i) {push @{$AoA[$i]}, $_};&lt;BR /&gt;  }&lt;BR /&gt;}&lt;BR /&gt;foreach $i ( 0 .. @targets - 1 ) {&lt;BR /&gt;  print "----- $targets[$i] -----\n";&lt;BR /&gt;  print @{$AoA[$i]} if $AoA[$i];&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;Run as:&lt;BR /&gt;&lt;BR /&gt;#perl syslog_filter.pl  /var/adm/syslog/syslog.log&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Enjoy folks,&lt;BR /&gt;Hein.&lt;BR /&gt;</description>
    <pubDate>Tue, 01 Jul 2008 13:07:13 GMT</pubDate>
    <dc:creator>Hein van den Heuvel</dc:creator>
    <dc:date>2008-07-01T13:07:13Z</dc:date>
    <item>
      <title>checklist script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/checklist-script/m-p/4225592#M327919</link>
      <description>How are you guys doing ? ..&lt;BR /&gt;&lt;BR /&gt;Coming to the question ..&lt;BR /&gt;&lt;BR /&gt;I am looking for a script which will will allow me to make a checklist on a hp-ux server B11.23 every morning</description>
      <pubDate>Tue, 01 Jul 2008 09:12:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/checklist-script/m-p/4225592#M327919</guid>
      <dc:creator>kacou</dc:creator>
      <dc:date>2008-07-01T09:12:02Z</dc:date>
    </item>
    <item>
      <title>Re: checklist script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/checklist-script/m-p/4225593#M327920</link>
      <description>this is very much simple. but can get an idea&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;&lt;BR /&gt;echo "Server name: `hostname` OS: `uname -s`          ";&lt;BR /&gt;echo "Date: `date`       ";&lt;BR /&gt;echo "Currently logged users:" ; who -a |grep 172.16.* ; &lt;BR /&gt;#echo "Files in `pwd`" ; ls -l ;  &lt;BR /&gt;echo "last 25 lines of syslog file:" ; tail -25 /var/log/messages; &lt;BR /&gt;echo "Used Disk Space" ;df -h ;  &lt;BR /&gt;#echo "Total No# of oracle process:" ; ps -fu oracle |wc -l ; &lt;BR /&gt;echo "Total No# of root process:" ; ps -fu root |wc -l ; &lt;BR /&gt;echo "Please wait command is running need 25 second to finish" ; sar -u 5 5 ; &lt;BR /&gt;#echo "Plase wait script is runining, need 45 second to finish" ;./system.sh ; &lt;BR /&gt;echo "wait for a while"; sar -d 1 1; &lt;BR /&gt;echo "wait for a while"; sar -q 5 5 ; &lt;BR /&gt;echo "wait for some times"; sar -w 5 5 ;&lt;BR /&gt;echo "Currently Logged: ";w ;&lt;BR /&gt;#exit 0 ;&lt;BR /&gt;#sleep 300&lt;BR /&gt;echo "  "&lt;BR /&gt;echo "Process Finished:";date;&lt;BR /&gt;</description>
      <pubDate>Tue, 01 Jul 2008 09:16:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/checklist-script/m-p/4225593#M327920</guid>
      <dc:creator>Jeeshan</dc:creator>
      <dc:date>2008-07-01T09:16:46Z</dc:date>
    </item>
    <item>
      <title>Re: checklist script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/checklist-script/m-p/4225594#M327921</link>
      <description>Write a script named dailyscript which includes,&lt;BR /&gt;&lt;BR /&gt;grep -i full  /var/adm/syslog/syslog.log  &lt;BR /&gt;grep -i fail  /var/adm/syslog/syslog.log &lt;BR /&gt;grep -i fault  /var/adm/syslog/syslog.log &lt;BR /&gt;grep -i error  /var/adm/syslog/syslog.log &lt;BR /&gt;grep -i scsi  /var/adm/syslog/syslog.log &lt;BR /&gt;grep -i lbolt  /var/adm/syslog/syslog.log &lt;BR /&gt;grep -i ems  /var/adm/syslog/syslog.log &lt;BR /&gt;grep -i lpmc  /var/adm/syslog/syslog.log &lt;BR /&gt;grep -i critical /var/adm/syslog/syslog.log &lt;BR /&gt;grep -i Recovered /var/adm/syslog/syslog.log&lt;BR /&gt;grep -i Restored /var/adm/syslog/syslog.log &lt;BR /&gt;grep -i incorr  /var/adm/syslog/syslog.log &lt;BR /&gt;grep -i su:  /var/adm/syslog/syslog.log &lt;BR /&gt;grep -i cmcld /var/adm/syslog/syslog.log&lt;BR /&gt;tail -30 /var/adm/sulog &lt;BR /&gt;netstat -in |pg&lt;BR /&gt;netstat -nvr  |pg&lt;BR /&gt;netstat -an |grep "ESTABLISHED" |wc -l |pg&lt;BR /&gt;cat /var/adm/syslog/syslog.log &lt;BR /&gt;grep -i "connection logging"&lt;BR /&gt;grep -i LVM /var/adm/syslog/syslog.log &lt;BR /&gt;grep -i scsi /var/adm/syslog/syslog.log&lt;BR /&gt;ll /var/opt/resmon/log&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Sudhakar</description>
      <pubDate>Tue, 01 Jul 2008 10:22:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/checklist-script/m-p/4225594#M327921</guid>
      <dc:creator>SUDHAKAR_18</dc:creator>
      <dc:date>2008-07-01T10:22:41Z</dc:date>
    </item>
    <item>
      <title>Re: checklist script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/checklist-script/m-p/4225595#M327922</link>
      <description>&lt;!--!*#--&gt;Sudhakar,&lt;BR /&gt;&lt;BR /&gt;Thanks for the inputs, but you are not actually running that every day I hope??&lt;BR /&gt;&lt;BR /&gt;- Why grep syslog over and over? Let grep look for all 'intersting' lines in one command? But what about new, unlisted problem signatures? It may be better to let grep exclude lines which are deemed 'not so interesting' for the application such that you will also catch those 'new' errors.&lt;BR /&gt;&lt;BR /&gt;- If you do want to grep for problems in 'zones' (error, fail, ...) then don't you want to identify those zones with a seperator (a few empties, a line of dashes, whatever).&lt;BR /&gt;&lt;BR /&gt;- By doing the known potential issues in chunks, you'll loose easy access to time context. &lt;BR /&gt;&lt;BR /&gt;- Do you really want to see last weeks errors highlighted again and again?&lt;BR /&gt;&lt;BR /&gt;Imho you need either a marker file with the last record looked at last time (tail 1 syslog &amp;gt; last_syslog_looked_at :-),&lt;BR /&gt;or you need to pre-filter for yesterday (and today ?!)&lt;BR /&gt;&lt;BR /&gt;For example:&lt;BR /&gt;&lt;BR /&gt;$ yesterday=$(TZ=$TZ+24 date +"%b %e")&lt;BR /&gt;$ today=$(date +"%b %e")&lt;BR /&gt;$ echo $yesterday $today&lt;BR /&gt;Jun 30 Jul 1&lt;BR /&gt;$ grep -E "^$yesterday|^$today" /var/adm/syslog/syslog.log | grep -iE "error|fail"&lt;BR /&gt;&lt;BR /&gt;To 'analyze' syslog properly I suspect that you quickly need a real script instead of a buch of greps.&lt;BR /&gt;&lt;BR /&gt;Here is a starting point in the shape of a perl scripts which goes over an input file (syslog) just once and examines each line for a list of matches.&lt;BR /&gt;On match it pushed that line into an array for those matches.&lt;BR /&gt;At end of input report for each match type:&lt;BR /&gt;&lt;BR /&gt;$ cat syslog_filter.pl&lt;BR /&gt;use warnings;&lt;BR /&gt;use strict;&lt;BR /&gt;my @targets = qw ( error fail hein fault );&lt;BR /&gt;my @AoA; # Array of Arrays&lt;BR /&gt;my $i;&lt;BR /&gt;while (&amp;lt;&amp;gt;) {&lt;BR /&gt;  foreach $i ( 0 .. @targets - 1 ) {&lt;BR /&gt;    if (/$targets[$i]/i) {push @{$AoA[$i]}, $_};&lt;BR /&gt;  }&lt;BR /&gt;}&lt;BR /&gt;foreach $i ( 0 .. @targets - 1 ) {&lt;BR /&gt;  print "----- $targets[$i] -----\n";&lt;BR /&gt;  print @{$AoA[$i]} if $AoA[$i];&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;Run as:&lt;BR /&gt;&lt;BR /&gt;#perl syslog_filter.pl  /var/adm/syslog/syslog.log&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Enjoy folks,&lt;BR /&gt;Hein.&lt;BR /&gt;</description>
      <pubDate>Tue, 01 Jul 2008 13:07:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/checklist-script/m-p/4225595#M327922</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2008-07-01T13:07:13Z</dc:date>
    </item>
    <item>
      <title>Re: checklist script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/checklist-script/m-p/4225596#M327923</link>
      <description>BTW, every message sent by EMS to syslog is also sent to root by mail - consider to check roots email.&lt;BR /&gt;Should be enough for most cases.</description>
      <pubDate>Tue, 01 Jul 2008 14:16:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/checklist-script/m-p/4225596#M327923</guid>
      <dc:creator>Torsten.</dc:creator>
      <dc:date>2008-07-01T14:16:00Z</dc:date>
    </item>
    <item>
      <title>Re: checklist script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/checklist-script/m-p/4225597#M327924</link>
      <description>Consider using logcheck run as a cron job.  It can classify the level of concern for various messages.</description>
      <pubDate>Wed, 02 Jul 2008 14:13:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/checklist-script/m-p/4225597#M327924</guid>
      <dc:creator>Bill Thorsteinson</dc:creator>
      <dc:date>2008-07-02T14:13:04Z</dc:date>
    </item>
  </channel>
</rss>

