- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: glance process shell
Operating System - HP-UX
1752571
Members
4968
Online
108788
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
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
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
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
05-09-2002 09:15 PM
05-09-2002 09:15 PM
glance process shell
I want to make script for some process util. first ask me the number of process or name. If it exists print utilization per 5minutes .If not exist print echo "Not exist"
here is some scripts
#!/usr/bin/sh
echo "pid= \c"
read my_pid
for PID in `ps -ef|sed 's/^ *//g'|grep -v \^UID|awk '{print $2}'`
do
if [ $my_pid -eq $PID ]
then
echo $PID>./tmp_pid
echo "WE FOUND $my_pid IS $PID"
glance -adviser_only -syntax adv_cpu >>./result 2>>error
fi
done
----
print "---------", gbl_stattime
print "process pid util"
print "-------------------------------------------------------"
process loop {
if (proc_proc_id == $`{tail ./tmp_pid}` ) then
print proc_proc_name|12, " ", proc_proc_id, " ", proc_cpu_total_util, " "}
print " "
#
here is some scripts
#!/usr/bin/sh
echo "pid= \c"
read my_pid
for PID in `ps -ef|sed 's/^ *//g'|grep -v \^UID|awk '{print $2}'`
do
if [ $my_pid -eq $PID ]
then
echo $PID>./tmp_pid
echo "WE FOUND $my_pid IS $PID"
glance -adviser_only -syntax adv_cpu >>./result 2>>error
fi
done
----
print "---------", gbl_stattime
print "process pid util"
print "-------------------------------------------------------"
process loop {
if (proc_proc_id == $`{tail ./tmp_pid}` ) then
print proc_proc_name|12, " ", proc_proc_id, " ", proc_cpu_total_util, " "}
print " "
#
1 REPLY 1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-10-2002 12:35 AM
05-10-2002 12:35 AM
Re: glance process shell
Hi
You can find a few examples in /opt/perf/examples/adviser.
Documentation is /opt/perf/paperdocs/gp/C.
Just to see cpu you can also use top with the
-f option which is undocumented but writes to a file.
Or ps as
UNIX95= ps -e -o pcpu -o ruser -o vsz -opid -o args|head -n1
UNIX95= ps -e -o pcpu -o ruser -o vsz -opid -o args|grep -v %CPU| sort -nr|tail
-n +2|head -n 20
steve Steel
You can find a few examples in /opt/perf/examples/adviser.
Documentation is /opt/perf/paperdocs/gp/C.
Just to see cpu you can also use top with the
-f option which is undocumented but writes to a file.
Or ps as
UNIX95= ps -e -o pcpu -o ruser -o vsz -opid -o args|head -n1
UNIX95= ps -e -o pcpu -o ruser -o vsz -opid -o args|grep -v %CPU| sort -nr|tail
-n +2|head -n 20
steve Steel
If you want truly to understand something, try to change it. (Kurt Lewin)
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.
News and Events
Support
© Copyright 2024 Hewlett Packard Enterprise Development LP