Per CPU Graph Linux

Post general support questions here that do not specifically fall into the Linux or Windows categories.

Moderators: Developers, Moderators

Post Reply
Superfly
Posts: 5
Joined: Mon Feb 20, 2006 9:05 am

Per CPU Graph Linux

Post by Superfly »

Is there a way to graph CPU utilization per CPU? I am able to do this with my Dual CPU Windows system but not with my Dual CPU Linux system.

When snmpwalk ".1.3.6.1.2.1.25.3.3.1" on my Linux Computer I get this result:

HOST-RESOURCES-MIB::hrProcessorFrwID.768 = OID: SNMPv2-SMI::zeroDotZero
HOST-RESOURCES-MIB::hrProcessorFrwID.769 = OID: SNMPv2-SMI::zeroDotZero


When snmpwalk ".1.3.6.1.2.1.25.3.3.1" on my Windows Computer I get this result:

HOST-RESOURCES-MIB::hrProcessorFrwID.3 = OID: SNMPv2-SMI::zeroDotZero
HOST-RESOURCES-MIB::hrProcessorFrwID.4 = OID: SNMPv2-SMI::zeroDotZero
HOST-RESOURCES-MIB::hrProcessorLoad.3 = INTEGER: 0
HOST-RESOURCES-MIB::hrProcessorLoad.4 = INTEGER: 0

Any Ideas how I can accomplish this for Linux?
phoenix
Posts: 27
Joined: Thu Aug 19, 2004 3:18 pm

Post by phoenix »

I have a recollection that it's a problem with net-snmp, I believe it's unable to do multiple processors on linux.
Regards


Bill
Superfly
Posts: 5
Joined: Mon Feb 20, 2006 9:05 am

Post by Superfly »

FYI I just found this on the Net-SNMP website. Just incase anyone else finds this thread.
What about multi-processor systems?
----------------------------------

Sorry - the CPU statistics (both original percentages, and the
newer raw statistics) both refer to the system as a whole. There
is currently no way to access individual statistics for a particular
processor (except on Solaris systems - see below).

Note that although the Host Resources table includes a hrProcessorTable,
the current implementation suffers from two major flaws. Firstly, it
doesn't currently recognise the presence of multiple processors, and
simply assumes that all systems have precisely one CPU. Secondly, it
doesn't calculate the hrProcessorLoad value correctly, and either returns
a dummy value (based on the load average) or nothing at all.

As of net-snmp version 5.1, the Solaris operating system delivers some
information about multiple CPU's such as speed and type.

Other than that, to monitor a multi-processor system, you're currently
out of luck. We hope to address this in a future release of the agent.
But you've got the source, so you can always have a go yourself :-)
Rabbitt
Posts: 1
Joined: Wed May 03, 2006 12:02 pm
Location: Cambridge, Massachusetts
Contact:

Post by Rabbitt »

Superfly wrote:FYI I just found this on the Net-SNMP website. Just incase anyone else finds this thread.
What about multi-processor systems?
----------------------------------

Sorry - the CPU statistics (both original percentages, and the
newer raw statistics) both refer to the system as a whole. There
is currently no way to access individual statistics for a particular
processor (except on Solaris systems - see below).

[snip]

Fortuntaely, this isn't entirely accurate. On a linux system, you can easily get each processor's ticks from /proc/stat. However, just by doing so, you will be skewing your results - which isn't necessarily all that bad if all your doing is monitoring trend. So, anyway, knowing this, you can create a script to get the results and forward off any requests for those results from Net-SNMP to your script by way of the "PASS" keyword.

example (/etc/snmp/snmpd.conf):

Code: Select all

pass .1.3.6.1.4.1.2021.255 /usr/local/sbin/get_multicpu_loadavg.pl 
the script itself could return something like the following from snmpwalk:

Code: Select all

# for cpu 0
$ snmpwalk -v 1 -c public localhost .1.3.6.1.4.1.2021.255.0 
0.03 0.00 0.00

# for cpu 1
$ snmpwalk -v 1 -c public localhost .1.3.6.1.4.1.2021.255.1
0.03 0.00 0.00
once you have that, you can easily create the data and graph templates in cacti and use the data :-)

HTH!

Cheers!,

--
Carl P. Corliss
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests