- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- checklist script
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-01-2008 02:12 AM
07-01-2008 02:12 AM
Coming to the question ..
I am looking for a script which will will allow me to make a checklist on a hp-ux server B11.23 every morning
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-01-2008 02:16 AM
07-01-2008 02:16 AM
Solution#!/usr/bin/sh
echo "Server name: `hostname` OS: `uname -s` ";
echo "Date: `date` ";
echo "Currently logged users:" ; who -a |grep 172.16.* ;
#echo "Files in `pwd`" ; ls -l ;
echo "last 25 lines of syslog file:" ; tail -25 /var/log/messages;
echo "Used Disk Space" ;df -h ;
#echo "Total No# of oracle process:" ; ps -fu oracle |wc -l ;
echo "Total No# of root process:" ; ps -fu root |wc -l ;
echo "Please wait command is running need 25 second to finish" ; sar -u 5 5 ;
#echo "Plase wait script is runining, need 45 second to finish" ;./system.sh ;
echo "wait for a while"; sar -d 1 1;
echo "wait for a while"; sar -q 5 5 ;
echo "wait for some times"; sar -w 5 5 ;
echo "Currently Logged: ";w ;
#exit 0 ;
#sleep 300
echo " "
echo "Process Finished:";date;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-01-2008 03:22 AM
07-01-2008 03:22 AM
Re: checklist script
grep -i full /var/adm/syslog/syslog.log
grep -i fail /var/adm/syslog/syslog.log
grep -i fault /var/adm/syslog/syslog.log
grep -i error /var/adm/syslog/syslog.log
grep -i scsi /var/adm/syslog/syslog.log
grep -i lbolt /var/adm/syslog/syslog.log
grep -i ems /var/adm/syslog/syslog.log
grep -i lpmc /var/adm/syslog/syslog.log
grep -i critical /var/adm/syslog/syslog.log
grep -i Recovered /var/adm/syslog/syslog.log
grep -i Restored /var/adm/syslog/syslog.log
grep -i incorr /var/adm/syslog/syslog.log
grep -i su: /var/adm/syslog/syslog.log
grep -i cmcld /var/adm/syslog/syslog.log
tail -30 /var/adm/sulog
netstat -in |pg
netstat -nvr |pg
netstat -an |grep "ESTABLISHED" |wc -l |pg
cat /var/adm/syslog/syslog.log
grep -i "connection logging"
grep -i LVM /var/adm/syslog/syslog.log
grep -i scsi /var/adm/syslog/syslog.log
ll /var/opt/resmon/log
Regards,
Sudhakar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-01-2008 06:07 AM
07-01-2008 06:07 AM
Re: checklist script
Thanks for the inputs, but you are not actually running that every day I hope??
- 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.
- 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).
- By doing the known potential issues in chunks, you'll loose easy access to time context.
- Do you really want to see last weeks errors highlighted again and again?
Imho you need either a marker file with the last record looked at last time (tail 1 syslog > last_syslog_looked_at :-),
or you need to pre-filter for yesterday (and today ?!)
For example:
$ yesterday=$(TZ=$TZ+24 date +"%b %e")
$ today=$(date +"%b %e")
$ echo $yesterday $today
Jun 30 Jul 1
$ grep -E "^$yesterday|^$today" /var/adm/syslog/syslog.log | grep -iE "error|fail"
To 'analyze' syslog properly I suspect that you quickly need a real script instead of a buch of greps.
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.
On match it pushed that line into an array for those matches.
At end of input report for each match type:
$ cat syslog_filter.pl
use warnings;
use strict;
my @targets = qw ( error fail hein fault );
my @AoA; # Array of Arrays
my $i;
while (<>) {
foreach $i ( 0 .. @targets - 1 ) {
if (/$targets[$i]/i) {push @{$AoA[$i]}, $_};
}
}
foreach $i ( 0 .. @targets - 1 ) {
print "----- $targets[$i] -----\n";
print @{$AoA[$i]} if $AoA[$i];
}
Run as:
#perl syslog_filter.pl /var/adm/syslog/syslog.log
Enjoy folks,
Hein.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-01-2008 07:16 AM
07-01-2008 07:16 AM
Re: checklist script
Should be enough for most cases.
Hope this helps!
Regards
Torsten.
__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.
__________________________________________________
No support by private messages. Please ask the forum!
If you feel this was helpful please click the KUDOS! thumb below!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-02-2008 07:13 AM
07-02-2008 07:13 AM