pure SNMP Replacement for SNMP - Get Processor Information

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

Moderators: Developers, Moderators

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

pure SNMP Replacement for SNMP - Get Processor Information

Post by gandalf »

This is a pure (aka FAST) replacement of standard "SNMP - Get Processor Information".
It uses advanced SNMP Data Query XML options to provide not only the data required, but the name of the processor found!
Be prepared, that not all SNMP implementations provide data for this query. Even worse, I encountered some hosts that respond well to query indexing but don't provide the hrProcessorLoad itself.
To verify this, please run snmpwalk against .1.3.6.1.2.1.25.3.3.1.2. If no data found, please update SNMP on the target host!
Reinhard
Attachments
cacti087b_data_query_snmp_-_hrprocessorload.xml
The Data Query to import
Use at least cacti 087b!
(16.01 KiB) Downloaded 1765 times
hrProcessorLoad.xml
The XML file to be placed into ./resource/snmp_queries
(1.06 KiB) Downloaded 2144 times
A screenshot
A screenshot
Bildschirmfoto.png (16.96 KiB) Viewed 25988 times
Last edited by gandalf on Fri Jan 02, 2009 7:14 am, edited 2 times in total.
niobe
Cacti User
Posts: 228
Joined: Mon Mar 10, 2008 6:52 pm
Location: Australia

Post by niobe »

nice :)
diablo62
Posts: 6
Joined: Mon Apr 28, 2008 2:59 am

Post by diablo62 »

I'm a problem at the creation of rra files

In graph mangement i have this :

RRDTool Command:

/usr/bin/rrdtool graph - \
--imgformat=PNG \
--start=-86400 \
--end=-300 \
--title="CAB-S03 - hrProcessorLoad |query_hrProcessorFrwID|" \
--base=1000 \
--height=120 \
--width=500 \
--alt-autoscale-max \
--lower-limit=0 \
--vertical-label="Load" \
--slope-mode \
--font TITLE:12: \
--font AXIS:8: \
--font LEGEND:10: \
--font UNIT:8: \
DEF:a="/var/www/cacti/rra/cab-s03_load_83.rrd":load:AVERAGE \
COMMENT:"CPU\: |query_hrDeviceDescr|\n" \
AREA:a#FF0000FF:"Load" \
GPRINT:a:LAST:"Current\:%8.2lf %s" \
GPRINT:a:AVERAGE:"Average\:%8.2lf %s" \
GPRINT:a:MAX:"Maximum\:%8.2lf %s\n"
RRDTool Says:

ERROR: opening '/var/www/cacti/rra/cab-s03_load_83.rrd': No such file or directory

AND in data sources i have this :

/usr/bin/rrdtool create \
/var/www/cacti/rra/cab-s03_load_83.rrd \
--step 300 \
DS:load:GAUGE:600:0:120 \
RRA:AVERAGE:0.5:1:500 \
RRA:AVERAGE:0.5:1:600 \
RRA:AVERAGE:0.5:6:700 \
RRA:AVERAGE:0.5:24:775 \
RRA:AVERAGE:0.5:288:797 \
RRA:MAX:0.5:1:500 \
RRA:MAX:0.5:1:600 \
RRA:MAX:0.5:6:700 \
RRA:MAX:0.5:24:775 \
RRA:MAX:0.5:288:797 \

Cactiuser have all rights and i have chmod 777 -r on rra, log and ressources directory.

Please help me :)
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Did you run the snmpwalk against the OID given in my first post? Please post results
Reinhard
diablo62
Posts: 6
Joined: Mon Apr 28, 2008 2:59 am

Post by diablo62 »

I've

HOST-RESOURCES-MIB::hrProcessorLoad.3 = INTEGER: 0
HOST-RESOURCES-MIB::hrProcessorLoad.4 = INTEGER: 0

I think it's good. No ?
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Hmm, please try .1.3.6.1.2.1.25.3.3 now and post the whole stuff
Reinhard
diablo62
Posts: 6
Joined: Mon Apr 28, 2008 2:59 am

Post by diablo62 »

I'm sorry, i have been on holiday

for oid .1.3.6.1.2.1.25.3.3
I have :
snmpwalk 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

Cacti graph debug mode

RRDTool Command:

/usr/bin/rrdtool graph - \
--imgformat=PNG \
--start=-86400 \
--end=-300 \
--title="CAB-S03 - hrProcessorLoad |query_hrProcessorFrwID|" \
--base=1000 \
--height=120 \
--width=500 \
--alt-autoscale-max \
--lower-limit=0 \
--vertical-label="Load" \
--slope-mode \
--font TITLE:12: \
--font AXIS:8: \
--font LEGEND:10: \
--font UNIT:8: \
DEF:a="/var/www/cacti/rra/cab-s03_load_83.rrd":load:AVERAGE \
COMMENT:"CPU\: |query_hrDeviceDescr|\n" \
AREA:a#FF0000FF:"Load" \
GPRINT:a:LAST:"Current\:%8.2lf %s" \
GPRINT:a:AVERAGE:"Average\:%8.2lf %s" \
GPRINT:a:MAX:"Maximum\:%8.2lf %s\n"
RRDTool Says:

ERROR: opening '/var/www/cacti/rra/cab-s03_load_83.rrd': No such file or directory
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Is this the only graph for that device? What is the devices status (from device list)? Are you running cmd.php or spine?
Reinhard
diablo62
Posts: 6
Joined: Mon Apr 28, 2008 2:59 am

Post by diablo62 »

I have only one graph for this device and i use cmd.php
I don't know it does'nt want to create the rrd file
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

You didn't answer to the question about the hosts's status. I fear it is either down or undefined. This is normally a hint for a problem with downed device detection for that host. Please select SNMP as downed device detectionmethod and retry
Reinhard
diablo62
Posts: 6
Joined: Mon Apr 28, 2008 2:59 am

Post by diablo62 »

I ve check all device are up i have delete graph and data sources but it's the same problem it can't create the rrd file but he have all right (777) on the directory
Savages
Posts: 1
Joined: Fri May 16, 2008 8:33 am

Post by Savages »

i did not import the scripts yet, but i was wondering. I have the following output on a SNMP-walk, system is a Compaq dx2300 running Windows XP:

Code: Select all

snmpwalk -v2c -c <community> <ipadres> .1.3.6.1.2.1.25.3.3
HOST-RESOURCES-MIB::hrProcessorFrwID.6 = OID: SNMPv2-SMI::zeroDotZero
HOST-RESOURCES-MIB::hrProcessorFrwID.7 = OID: SNMPv2-SMI::zeroDotZero
HOST-RESOURCES-MIB::hrProcessorLoad.6 = INTEGER: 0
HOST-RESOURCES-MIB::hrProcessorLoad.7 = INTEGER: 0
ssorLoad.7 = INTEGER: 0
Is this enough output to be usefull?
Kro
Posts: 38
Joined: Thu Mar 27, 2008 11:39 am

Post by Kro »

gandalf, what values should we put here ?
Attachments
nnn.JPG
nnn.JPG (16.88 KiB) Viewed 24883 times
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

How did you get to that page? It is not supposed to pop up anywhere
Reinhard
Kro
Posts: 38
Joined: Thu Mar 27, 2008 11:39 am

Post by Kro »

Just after I had clicked on create button.
Attachments
graph_templates.JPG
graph_templates.JPG (24.33 KiB) Viewed 24789 times
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests