pure SNMP Replacement for SNMP - Get Processor Information

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

Moderators: Moderators, Developers

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

pure SNMP Replacement for SNMP - Get Processor Information

#1 Post by gandalf » Sat Apr 26, 2008 11:14 am

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 1721 times
hrProcessorLoad.xml
The XML file to be placed into ./resource/snmp_queries
(1.06 KiB) Downloaded 2100 times
Bildschirmfoto.png
A screenshot
Bildschirmfoto.png (16.96 KiB) Viewed 24275 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

#2 Post by niobe » Sun Apr 27, 2008 5:22 am

nice :)

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

#3 Post by diablo62 » Tue Apr 29, 2008 4:19 am

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: 22375
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

#4 Post by gandalf » Tue Apr 29, 2008 3:15 pm

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

#5 Post by diablo62 » Wed Apr 30, 2008 2:14 am

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: 22375
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

#6 Post by gandalf » Sun May 04, 2008 2:02 pm

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

#7 Post by diablo62 » Tue May 13, 2008 2:27 am

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: 22375
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

#8 Post by gandalf » Tue May 13, 2008 2:56 pm

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

#9 Post by diablo62 » Wed May 14, 2008 4:52 am

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: 22375
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

#10 Post by gandalf » Thu May 15, 2008 1:19 pm

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

#11 Post by diablo62 » Fri May 16, 2008 8:09 am

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

#12 Post by Savages » Fri May 16, 2008 8:39 am

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

#13 Post by Kro » Fri May 16, 2008 4:03 pm

gandalf, what values should we put here ?
Attachments
nnn.JPG
nnn.JPG (16.88 KiB) Viewed 23170 times

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

#14 Post by gandalf » Sun May 18, 2008 8:32 am

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

#15 Post by Kro » Sun May 18, 2008 3:49 pm

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

Post Reply