- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Script to check the memory and process utiliza...
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
11-22-2002 02:24 AM
11-22-2002 02:24 AM
Is there any script which monitors a specific process, and informs the user about the CPU and memory utilization.
regards
chakri
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-22-2002 02:29 AM
11-22-2002 02:29 AM
Re: Script to check the memory and process utilization
You can use top ( free ) or glance ( evaluation version 60 days free) .
Gideon
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-22-2002 02:31 AM
11-22-2002 02:31 AM
Re: Script to check the memory and process utilization
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-22-2002 02:32 AM
11-22-2002 02:32 AM
Re: Script to check the memory and process utilization
# glance -G
to report on a specific process.
Chuck J
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-22-2002 02:34 AM
11-22-2002 02:34 AM
SolutionPut the following lines into a script, make it executable, and run it with an argument of the pid you want, it then shows you what you want.
echo "PID USER CPU% MEM_SIZE COMMAND"
while true
do
UNIX95= ps -eo "pid ruser pcpu vsz=Kbytes" -o comm |grep $1
sleep 1
done
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-22-2002 02:44 AM
11-22-2002 02:44 AM
Re: Script to check the memory and process utilization
Script doesnt show me all the process, i want to see the process which are started on command line,, they are not visible,
--chakri
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-22-2002 02:49 AM
11-22-2002 02:49 AM
Re: Script to check the memory and process utilization
So now you want to monitor all processes ? if so remove from the script the bit;
| grep $1
now it will show all processes every 1 second (you can easily adjust the interval by modifying the sleep value from 1 to whatever you want). Now when you run the script you can simply pipe it into grep for what you want (either a pid, or userid or command).
eg; ./<script> | grep
The script uses ps -e which shows ALL processes running at the instant it is run so you should be able to grep to find what you want from the output.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-22-2002 02:52 AM
11-22-2002 02:52 AM
Re: Script to check the memory and process utilization
can you give me proper command syntax to use.
regards
chakri
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-22-2002 03:01 AM
11-22-2002 03:01 AM
Re: Script to check the memory and process utilization
UNIX95= ps -eo "pid ruser pcpu vsz=Kbytes" -o args
If this still doenst do what you want please provide examples.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-22-2002 03:04 AM
11-22-2002 03:04 AM
Re: Script to check the memory and process utilization
args is working fine
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-22-2002 03:48 AM
11-22-2002 03:48 AM
Re: Script to check the memory and process utilization
if want to see memory utilization in %, then what is the option
regards
chakri
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-22-2002 04:11 AM
11-22-2002 04:11 AM
Re: Script to check the memory and process utilization
for an individual user what do you mean by %, % of what ? total memory in use on the server?
Heres a script to show total memory and free% for the whole server;
let x=$(grep -i physical: /var/adm/syslog/OLDsyslog.log|tail -1|awk '{print $2}')/1048
let z=$(vmstat|tail -1|awk '{print $5}')*4096;let z=$z/1000000
let free=100000/$x*$z
let free=$free/1000
let free=100-$free
echo "$x Mb physical memory \n$z Mb memory free \n$free % used"
To do it for an individual user is going to take some more scripting. Is that what you want ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-22-2002 04:27 AM
11-22-2002 04:27 AM