HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Script Required
Operating System - HP-UX
1828406
Members
3562
Online
109977
Solutions
Forums
Categories
Company
Local Language
back
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
back
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
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- 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
09-07-2006 06:56 PM
09-07-2006 06:56 PM
Hi All,
We need script for % of cpu and free memory.
1.sar -uM 1 1
vvc1app2@root>sar -uM 2 2
HP-UX vvc1app2 B.11.11 U 9000/800 09/08/06
12:02:56 cpu %usr %sys %wio %idle
12:03:01 0 0 0 0 100
1 1 0 0 99
2 0 1 0 99
3 11 1 0 89
system 3 1 0 97
12:03:21 0 0 0 0 100
1 0 0 0 100
2 0 0 0 100
3 0 0 1 99
system 0 0 0 100
Average 0 1 1 1 98
Average 1 3 1 0 97
Average 2 0 1 1 98
Average 3 5 1 0 93
Average system 2 1 0 97
2.app2@root>vmstat
procs memory page faults cpu
r b w avm free re at pi po fr de sr in sy cs us sy id
1 0 0 188372 3379377 107 16 0 0 0 0 0 1057 1540 139 0 1 99
Requirement:
1.In sar -uM 5 5 command output ,the last line gives the aveage % idle for cpu i.e 97%.If we will subtract from 100%,it will give % of CPU used i.e 3%(100 -97 =3%).We need this output i.e % of CPU used, in single script .
2.In vmstat command ouput,the free memory is 3379377 KB.If we will multiply by 4, it will give free memory in KB,after that we will divide by 1024 it will give in MB and again divide by 1024 it will give in GB.We need out put in GB only in single script.
The above two requirement is required in single script.Pls give the script for the above requirement.
Regards,
Suresh.
We need script for % of cpu and free memory.
1.sar -uM 1 1
vvc1app2@root>sar -uM 2 2
HP-UX vvc1app2 B.11.11 U 9000/800 09/08/06
12:02:56 cpu %usr %sys %wio %idle
12:03:01 0 0 0 0 100
1 1 0 0 99
2 0 1 0 99
3 11 1 0 89
system 3 1 0 97
12:03:21 0 0 0 0 100
1 0 0 0 100
2 0 0 0 100
3 0 0 1 99
system 0 0 0 100
Average 0 1 1 1 98
Average 1 3 1 0 97
Average 2 0 1 1 98
Average 3 5 1 0 93
Average system 2 1 0 97
2.app2@root>vmstat
procs memory page faults cpu
r b w avm free re at pi po fr de sr in sy cs us sy id
1 0 0 188372 3379377 107 16 0 0 0 0 0 1057 1540 139 0 1 99
Requirement:
1.In sar -uM 5 5 command output ,the last line gives the aveage % idle for cpu i.e 97%.If we will subtract from 100%,it will give % of CPU used i.e 3%(100 -97 =3%).We need this output i.e % of CPU used, in single script .
2.In vmstat command ouput,the free memory is 3379377 KB.If we will multiply by 4, it will give free memory in KB,after that we will divide by 1024 it will give in MB and again divide by 1024 it will give in GB.We need out put in GB only in single script.
The above two requirement is required in single script.Pls give the script for the above requirement.
Regards,
Suresh.
Solved! Go to Solution.
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-07-2006 07:09 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-07-2006 11:07 PM
09-07-2006 11:07 PM
Re: Script Required
Hi,
a modified/simplified version (note for printf:
%% -> %):
sar -uM 1 4 | awk '/Average system/ {printf("%d%%s\n",100-$NF)}'
vmstat | awk '/^ *[0-9]/ {printf("%dGB\n",$5/256/1024)}'
mfG Peter
a modified/simplified version (note for printf:
%% -> %):
sar -uM 1 4 | awk '/Average system/ {printf("%d%%s\n",100-$NF)}'
vmstat | awk '/^ *[0-9]/ {printf("%dGB\n",$5/256/1024)}'
mfG Peter
The Universe is a pretty big place,
it's bigger than anything anyone has ever dreamed of before.
So if it's just us, seems like an awful waste of space, right?
Jodie Foster in "Contact"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-08-2006 05:27 PM
09-08-2006 05:27 PM
Re: Script Required
Hi All,
Thank you for ur given input.
Regards,
Suresh.
Thank you for ur given input.
Regards,
Suresh.
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Support
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP