Graph with 2 independents cpu + average

Templates, scripts for templates, scripts and requests for templates.

Moderators: Developers, Moderators

Post Reply
rafiso
Posts: 20
Joined: Sat Dec 10, 2005 8:54 pm

Graph with 2 independents cpu + average

Post by rafiso »

Hi,

I'm dreaming about a graph with 3 lines for my dual-opteron linux fedora 4:

- cpu 0
- cpu 1
- average of 0 and 1

Does someone already done it ? I can't found a nice way to do that. I need an exemple or tutorials, any help is welcome :)

Thanks !

Best regards,
rafiso
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Moved to Script and Templates.
Reinhard
rafiso
Posts: 20
Joined: Sat Dec 10, 2005 8:54 pm

Post by rafiso »

Does some1 can help me pleeaaaase :) ?
I can see my cpus informations with this command. How can I create a graph for these values ?

Thanks !


# snmpwalk -v1 -cpublic localhost | grep Processor
HOST-RESOURCES-MIB::hrDeviceType.768 = OID: HOST-RESOURCES-TYPES::hrDeviceProcessor
HOST-RESOURCES-MIB::hrDeviceType.769 = OID: HOST-RESOURCES-TYPES::hrDeviceProcessor
HOST-RESOURCES-MIB::hrDeviceDescr.768 = STRING: AuthenticAMD: AMD Opteron(tm) Processor 246
HOST-RESOURCES-MIB::hrDeviceDescr.769 = STRING: AuthenticAMD: AMD Opteron(tm) Processor 246
HOST-RESOURCES-MIB::hrProcessorFrwID.768 = OID: SNMPv2-SMI::zeroDotZero
HOST-RESOURCES-MIB::hrProcessorFrwID.769 = OID: SNMPv2-SMI::zeroDotZero
HOST-RESOURCES-MIB::hrSWRunParameters.23997 = STRING: "Processor"
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Apply the ucd/net SNMP Host template to that device. This includes monitoring the CPU. If you want to extend the CPU Monitor, please have a look at the ucd/net CPU Data Templates as a starting point
Reinhard
rafiso
Posts: 20
Joined: Sat Dec 10, 2005 8:54 pm

Arghhhh

Post by rafiso »

mmhh please please pleeeaaaaase :lol:

Code: Select all

# snmpwalk -v1 -cpublic localhost | grep Processor
HOST-RESOURCES-MIB::hrDeviceType.768 = OID: HOST-RESOURCES-TYPES::hrDeviceProcessor
HOST-RESOURCES-MIB::hrDeviceType.769 = OID: HOST-RESOURCES-TYPES::hrDeviceProcessor
HOST-RESOURCES-MIB::hrDeviceDescr.768 = STRING: AuthenticAMD: AMD Opteron(tm) Processor 246
HOST-RESOURCES-MIB::hrDeviceDescr.769 = STRING: AuthenticAMD: AMD Opteron(tm) Processor 246
HOST-RESOURCES-MIB::hrProcessorFrwID.768 = OID: SNMPv2-SMI::zeroDotZero
HOST-RESOURCES-MIB::hrProcessorFrwID.769 = OID: SNMPv2-SMI::zeroDotZero
HOST-RESOURCES-MIB::hrSWRunParameters.23997 = STRING: "Processor"
That's the only thing I can see from my dual-opteron linux box. I tried a lot of templates and also to create them manually but I can't have something working fine.

Is there a cacti-guru that could help me to have a template for two CPUs on the same graph ?

THANKS YOU :oops:
rafiso
rafiso
Posts: 20
Joined: Sat Dec 10, 2005 8:54 pm

Post by rafiso »

THx now I'm able to see the standard cpu template. Now if someone knows how to create in on graph the 2 lines for each cpu + the average it would be perfect :) I'll pay for it :) !! see topic :
http://forums.cacti.net/viewtopic.php?t=10881

THX !
ehall
Cacti User
Posts: 246
Joined: Fri Dec 09, 2005 3:42 pm

Post by ehall »

Can't do it with net-snmp. They don't provide usage data for each distinct processor.

See the net-snmp FAQ on this subject
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

rafiso wrote:THx now I'm able to see the standard cpu template. Now if someone knows how to create in on graph the 2 lines for each cpu + the average it would be perfect :) I'll pay for it :) !! see topic :
http://forums.cacti.net/viewtopic.php?t=10881

THX !
ehall is correct to point out about some troubles with net-snmp cpu usage. But your original post will be answered:
Implement or use an existing Data Template to generate a data source for each of the cpu readings. Then, please create a Graph Template. Doing so, add at least two graph items referring to the cpu data sources. If you do assign a LINE1 to them, they will be shown on a Graph associated to your host (for more details, please see the last link of my signature).
Building the average can be done by creating a new CDEF (just beneath Graph Management). Select Custom String and enter

Code: Select all

a,b,+,2,/
This will add both data sources (a,b,+) and divide by 2 (2,/) using RPN as described at http://www.rrdtool.org.
Now add a new Graph Item to your Graph template choosing data source NONE, assign a LINE1 and your newly created CDEF. Give it a nice Text Format and you're done. If in doubt, please post a screenshot of your Graph Template
Reinhard
rafiso
Posts: 20
Joined: Sat Dec 10, 2005 8:54 pm

Post by rafiso »

wow . great thx for the help bro. I'll try that if I can do it I'll post the results :) THHHANNKS !!!
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests