|
|||||||
| Forums | Search Forums | Register | Forum Rules | Man Pages | Albums | FAQ | Members | Calendar | Search | Today's Posts | Mark Forums Read |
| HP-UX HP-UX (Hewlett Packard UniX) is Hewlett-Packard's proprietary implementation of the Unix operating system, based on System V. |
|
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Formatted TOP command output in file
Hi All,
I want generate HP-UX overall system performance report. I tried executing top command and write that out put to file. but am not able to view the report in proper format. I can see report like below in file but i can see properly in terminal. Please suggest how can i get proper format of out as it shown in the terminal. [?25h[m[H[2J7[1;44r8System: ussbcap1[38CThu Jan 24 23:40:17 2013[BLoad averages: 4.50, 5.64, 6.52[B549 processes: 429 sleeping, 93 running, 27 zombies[BCpu states:[BCPU LOAD USER NICE SYS IDLE BLOCK SWAIT INTR SSYS[B 0 4.51 73.3% 0.0% 26.7% 0.0% 0.0% 0.0% 0.0% 0.0%[B 1 4.49 93.1% 0.0% 6.9% 0.0% 0.0% 0.0% 0.0% 0.0%[B--- ---- ----- ----- ----- ----- ----- ----- ----- -----[Bavg 4.50 83.2% 0.0% 16.8% 0.0% 0.0% 0.0% 0.0% 0.0%[2BMemory: 6586084K (6364224K) real, 8876320K (8507888K) virtual, 727260K free Page# 1/18[2BCPU TTY PID USERNAME PRI NI SIZE RES STATE TIME %WCPU %CPU COMMAND[B 1 ? 6922 mqm[6C234 24 15748K 2040K run 66562:13 40.53 40.46 autocons[B 1 ? 2372 root[5C152 20 15336K 1884K run 26462:41 25.87 25.83 dmisp[B 0 ? 5531 cyclone 152 20 206M 49916K run 76304:32 20.97 20.93 java[B 1 ? 26049 cyclone 152 20 1292M 1098M run 323:13 17.74 17.71 java[B 1 ? 20174 cyclone 152 20 1194M 1012M run[5C94:11 5.34 5.33 java[B 1 ? 3415 root[5C-16 20 45520K 8528K run 7149:30 2.12 2.12 midaemon[B 1 ? 8185 root[5C158 20 38164K 36416K sleep 0:00 4.36 1.29 sh[B 0 ? 8178 mqm[6C183 20 12900K 1388K run[6C0:00 3.70 1.22 auto_remote[B 0 ? 8192 mqm[6C183 20 12900K 1388K run[6C0:00 4.71 1.22 auto_remote[B 1 ? 37 Last edited by lravip123; 01-25-2013 at 01:59 AM.. |
| Sponsored Links | ||
|
|
#2
|
|||
|
|||
|
PLEASE use code tags as demanded!
Reading man pages is highly educational and sometimes really helps. cf. man top : Quote:
Last edited by RudiC; 01-25-2013 at 04:28 AM.. |
| Sponsored Links | ||
|
|
#3
|
||||
|
||||
|
Here is what i'm using on my HPUX boxes for basic CPU and DISK monitoring from cron in this manner : Code:
00,5,10,15,20,25,30,35,40,45,50,55 * * * * /bin/awk -f /root/monitork /root/mon.data > /dev/null 2>&1 It's not perfect, but suits my needs ![]() Code:
BEGIN {
cpu=95
stat="1 100"
sms="mailx -s \"`hostname`\" smsaddress@domain.com"
ml="mailx -s \"`hostname` Overload\" mail.address@domain.com"
system("bdf > mon.data")
system("sar -u "stat" >> mon.data")
close("bdf >> mon.data")
close("sar -u "stat" >> mon.data")
}
match($0,/Average/) {
if ( $2 > cpu ) {
loadmon="SAR: CPU is above "cpu"% on "$2"% for "substr(stat,3,5) " seconds"
}
}
match($0,/9[4-9]% \//) {
diskmon="Mountpoints ALARM "$NF " is on "$(NF -1)
}
match($0,/100% \//) {
print $NF $(NF -1)
full="Mountpoints ALARM "$NF " is full"
}
END {
if ( loadmon != "" ) {
print loadmon | ml
}
if ( diskmon != "" || full != "" ) {
print diskmon "\n" full | sms
}
}Hope that helps. |
| Sponsored Links | ||
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Conflicts in the output of TOP command | anand2308 | UNIX for Advanced & Expert Users | 2 | 01-04-2013 11:00 AM |
| String searching and output to a file in a formatted text | cuji | Shell Programming and Scripting | 3 | 07-20-2010 03:03 AM |
| Need help with shell script - output of top command | needyourhelp10 | Shell Programming and Scripting | 5 | 07-13-2010 01:27 PM |
| Extract header from top command output | meharo | Shell Programming and Scripting | 3 | 01-14-2010 11:45 AM |
| mailing customized and formatted ls -lt command output | mbak | Shell Programming and Scripting | 3 | 10-11-2008 12:07 PM |
|
|