- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: command to check memory/cpu usage
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
Discussions
Discussions
Forums
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
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
тАО09-20-2007 09:33 AM
тАО09-20-2007 09:33 AM
there is to get the memory/cpu usage so I can
use it with nagios. There does not seem to be
any pre-compiled check for memory or cpu usage
in nagios.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-20-2007 09:44 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-20-2007 10:03 AM
тАО09-20-2007 10:03 AM
Re: command to check memory/cpu usage
Does not give me the values I need like in
glance in percent.
Current
CPU Util | 14% 14% 14%
Mem Util | 47% 47% 47%
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-20-2007 11:07 AM
тАО09-20-2007 11:07 AM
Re: command to check memory/cpu usage
Cheers!
GM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-20-2007 11:25 AM
тАО09-20-2007 11:25 AM
Re: command to check memory/cpu usage
$ ./glance_stats
CPU Util 57% 65% 76%
Mem Util 84% 84% 84%
It takes about 6 seconds to run, because it REALLY wants to run three iterations. Although to me, this should only take two seconds. This is about as tight as I could make it using the "-j 1" and the "-iterations 2" parameters. Both of these, according the the man page are the minimum. However, instead of getting two 1 second runs, I seem to get three 2 second runs. Go figure...
Here's the script file:
glance -f /var/tmp/glance.$$ -nosort -j 1 -iterations 2 > /dev/null 2>&1
awk '/CPU Util|Mem Util/{print $1" "$2" "$5" "$6" "$7}' \
/var/tmp/glance.$$ | tail -2
rm -f /var/tmp/glance.$$
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-20-2007 12:03 PM
тАО09-20-2007 12:03 PM
Re: command to check memory/cpu usage
This is also a great read on how to monitor a remote system with nagios:
http://www.crucialwebhost.com/blog/nagios-howto-using-nrpe-to-monitor-remote-services/
here's an example from our nagios box:
watchman:~# /usr/local/nagios/libexec/check_load -w .8,1.2,1.6 -c 1.0,1.5,2.0
OK - load average: 0.13, 0.08, 0.02|load1=0.130;0.800;1.000;0; load5=0.080;1.200;1.500;0; load15=0.020;1.600;2.000;0;
Cheers!
GM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-21-2007 04:03 AM
тАО09-21-2007 04:03 AM
Re: command to check memory/cpu usage
to be some kind of race condition. I do not
get the High on CPU every now and then.
# glance_stats
CPU Util 9% 9% 9%
Mem Util 48% 48% 48%
root@dbsvr1 [/lhome]
# glance_stats
CPU Util 8% 9% 11%
Mem Util 48% 48% 48%
root@dbsvr1 [/lhome]
# glance_stats
CPU Util 6% 9%
Mem Util 48% 48% 48%
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-21-2007 04:47 AM
тАО09-21-2007 04:47 AM
Re: command to check memory/cpu usage
did not get populated all the time so
I changed your code to take care of that
and I only needed the Avg.
glance -f /var/tmp/glance.cpu -nosort -j 1 -iterations 2 > /dev/null 2>&1
awk -F\| '/CPU Util/{print $2}' \
/var/tmp/glance.cpu | tail -1 | awk '{print $2}'
Thanks again.
I will also look at the links sent.
There seems to be a lot of locations on
the web about Nagios and distributions.
Thanks all.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-21-2007 06:27 AM
тАО09-21-2007 06:27 AM
Re: command to check memory/cpu usage
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-26-2007 03:07 AM
тАО09-26-2007 03:07 AM
Re: command to check memory/cpu usage
This will help quite a bit with your problem.
https://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=1033211