LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-19-2009, 06:22 PM   #1
Coallanz
LQ Newbie
 
Registered: Apr 2009
Posts: 1

Rep: Reputation: 0
Unhappy Percentage of CPU utilization using SNMP


Hey folks,

I was wondering if you could help out with a question on SNMP.
It should be pretty simple for you but trust me, I'm having a very hard time to make some sense of it.

I'm trying to basically create a script on Linux to display a message whenever my processor utilization percentage reaches a specified limit.

What I can't understand is how to "read" the info I get from SMNP.
I tried the following lines:

snmpget -v2c -c public 127.0.0.1 ssCpuRawIdle.0

And I observe results like "231273" and "233607". Now, I read somewhere that to get a percentage, I should divide the difference betwen these 2 values by the sum of them. That's where I got myself stuck on.

Could you please give me any hints? Or maybe another MIB I should be querying or anything that gives some light?

Thank you so very much,

Demerson.
 
Old 04-19-2009, 07:50 PM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
ssCpuRawIdle.0 is a 32bits counter. Maybe you're looking for ssCpuIdle.0, a percentage like 'top' would show. Also see ssCpuSystem.0 and ssCpuUser.0.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Disk utilization percentage & wait time ssuhaib Linux - Newbie 4 03-14-2009 09:35 AM
Linux desktop GUI tool for CPU utilization and bandwidth utilization karimasif Linux - Software 4 03-03-2008 01:09 PM
CPU utolization in percentage for each process nsyed4 Linux - Newbie 1 12-04-2007 05:51 PM
ps -aux CPU usage percentage depdiver Linux - General 1 02-25-2006 02:02 AM
find remaining percentage of cpu happy78 Programming 11 09-26-2005 08:02 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:22 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration