[solved] SNMP data query with "fake" index

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

Moderators: Developers, Moderators

Post Reply
laerg
Posts: 19
Joined: Sat Jul 02, 2005 7:12 pm

[solved] SNMP data query with "fake" index

Post by laerg »

'lo all,

I'm trying to create a "fake" index, based on OID last digit ...

snmpwalk -v 2c -c public myhost:1161 .1.2.3.4.1.12.700
.iso.2.3.4.1.12.700.1 = STRING: "blah1"
.iso.2.3.4.1.12.700.2 = STRING: "blah2"
.iso.2.3.4.1.12.700.3 = STRING: "blah3"
.iso.2.3.4.1.12.700.4 = STRING: "blah4"
.iso.2.3.4.1.12.700.5 = STRING: "blah5"
.iso.2.3.4.1.12.700.6 = STRING: "blah6"
.iso.2.3.4.1.12.700.7 = STRING: "blah7"
.iso.2.3.4.1.12.700.8 = STRING: "blah8"
.iso.2.3.4.1.12.700.9 = STRING: "blah9"
.iso.2.3.4.1.12.700.10 = STRING: "blah10"
.iso.2.3.4.1.12.700.11 = STRING: "blah11"
End of MIB

I've created snmp XML as per documentation (I think)
/www/resource/snmp_queries/jboss_webservice.xml

<jboss_webservice>
<name>Get jBoss WS metrics</name>
<description>Query jBossWS mbean for WebSerice statistics</description>
<oid_index>.1.2.3.4.1.12.700</oid_index>
<oid_index_parse>OID/REGEXP:.*\.([0-9]{1,2})$</oid_index_parse>
<index_order>objectName</index_order>
<index_order_type>numeric</index_order_type>
<index_title_format>|chosen_order_field|</index_title_format>
<fields>

<objectName>
<name>objectName</name>
<method>walk</method>
<source>index</source>
<direction>input</direction>
<oid>.1.2.3.4.1.12.700</oid>
</objectName>
...

when adding this data query to device I ran the manual snmpwalk on, it shows :
Data Query Debug Information
+ Running data query [16].
+ Found type = '3' [snmp query].
+ Found data query XML file at '/www/resource/snmp_queries/jboss_webservices.xml'
+ XML file parsed ok.
+ Executing SNMP walk for list of indexes @ '.1.2.3.4.1.12.700'
+ No SNMP data returned
+ Found data query XML file at '/www/resource/snmp_queries/jboss_webservices.xml'
+ Found data query XML file at '/www/resource/snmp_queries/jboss_webservices.xml'
+ Found data query XML file at '/www/resource/snmp_queries/jboss_webservices.xml'

I checked the REGEXP in test php script, it does return last digit of OID, which is exactly what I need for index, but in CACTI it shows no results. What am I missing ?

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

Post by gandalf »

Please see http://docs.cacti.net/manual:087:3a_adv ... alkthrough for a walkthrough.
My first bet is to remove the regexp, as it is not needed
Reinhard
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

After trying gandalf's advice, then try changing the following in the XML:

<objectName>
<name>objectName</name>
<source>index</source>
<direction>input</direction>
</objectName>
laerg
Posts: 19
Joined: Sat Jul 02, 2005 7:12 pm

Post by laerg »

Hya,

I have tried without REGEXP but same result :(

I followed instructions from http://docs.cacti.net/howto:data_query_ ... _not_exist

I had also read the "data query walk-through" before because this is not first time I've created custom snmp queries ... have searched the forum extensively, leaving me more confused than before.

Doens't the "OID/REGEXP oid_index_parse" attach the digit as index value to each base OID when snmpwalking ? ( 700.1 701.1 702.1 ... 700.2 701.2 702.2 ... )

snmpwalk -v 2c -c public myhost:1161 .1.2.3.4.1.12.700
.iso.2.3.4.1.12.700.1 = STRING: "blah blah"
.iso.2.3.4.1.12.700.2 = STRING: "bleh bleh"
...
snmpwalk -v 2c -c public myhost:1161 .1.2.3.4.1.12.701
iso.2.3.4.1.12.701.1 = Gauge32: 5751
iso.2.3.4.1.12.701.2 = Gauge32: 6542
...

snmpwalk -v 2c -c public myhost:1161 .1.2.3.4.1.12.703
iso.2.3.4.1.12.703.1 = INTEGER: 5
iso.2.3.4.1.12.703.2 = INTEGER: 12
iso.2.3.4.1.12.703.3 = INTEGER: 1
iso.2.3.4.1.12.703.4 = INTEGER: 0
iso.2.3.4.1.12.703.5 = INTEGER: 0
iso.2.3.4.1.12.703.6 = INTEGER: 9
iso.2.3.4.1.12.703.7 = INTEGER: 0
iso.2.3.4.1.12.703.8 = INTEGER: 50
iso.2.3.4.1.12.703.9 = INTEGER: 0
iso.2.3.4.1.12.703.10 = INTEGER: 0
iso.2.3.4.1.12.703.11 = INTEGER: 1
End of MIB

Here's the current snmp_queries XML ...

Code: Select all

<interface>
        <name>Get WS metrics</name>
        <description>Query WS statistics</description>
        <oid_index>.1.2.3.4.1.12.700</oid_index>
        <oid_index_parse>OID/REGEXP:.*\.([0-9]*)$</oid_index_parse>
        <index_order>wsIndex</index_order>
        <index_order_type>numeric</index_order_type>

        <fields>
                <wsIndex>
                        <name>wsIndex</name>
                        <source>index</source>
                        <direction>input</direction>
                </wsIndex>
                <minTime>
                        <name>WS min. time</name>
                        <method>walk</method>
                        <source>value</source>
                        <direction>output</direction>
                        <oid>.1.2.3.4.1.12.701</oid>
                </minTime>
                <processingTime>
                        <name>WS processing time</name>
                        <method>walk</method>
                        <source>value</source>
                        <direction>output</direction>
                        <oid>.1.2.3.4.1.12.702</oid>
                </processingTime>
                <requestCount>
                        <name>WS request count</name>
                        <method>walk</method>
                        <source>value</source>
                        <direction>output</direction>
                        <oid>.1.2.3.4.1.12.703</oid>
                </requestCount>
                <maxTime>
                        <name>WS max. time</name>
                        <method>walk</method>
                        <source>value</source>
                        <direction>output</direction>
                        <oid>.1.2.3.4.1.12.704</oid>
                </maxTime>
                <errorCount>
                        <name>WS error count</name>
                        <method>walk</method>
                        <source>value</source>
                        <direction>output</direction>
                        <oid>.1.2.3.4.1.12.705</oid>
                </errorCount>
        </fields>
</interface>
thnx for your time :)

grtz,
gert
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

Once again, please post the verbose query of the associated data query you added for this device.
laerg
Posts: 19
Joined: Sat Jul 02, 2005 7:12 pm

Post by laerg »

'lo,

I don't know what other debug I can give apart from the one in my original post, it's still the same ...

Data Query Debug Information
+ Running data query [16].
+ Found type = '3' [snmp query].
+ Found data query XML file at '/www/resource/snmp_queries/jboss_webservices.xml'
+ XML file parsed ok.
+ Executing SNMP walk for list of indexes @ '.1.2.3.4.1.12.700'
+ No SNMP data returned
+ Found data query XML file at '/www/resource/snmp_queries/jboss_webservices.xml'
+ Found data query XML file at '/www/resource/snmp_queries/jboss_webservices.xml'
+ Found data query XML file at '/www/resource/snmp_queries/jboss_webservices.xml'

it's really puzzling, i've also tried recreating everything from scratch, data query, data template, datasources, graph template ...
grtz,
gert
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

Oops missed your first post. Shouldn't be posting at 1am...

Anyways, there isn't any reason why I can see why cacti can't collect the information while a manual snmpwalk can. You're sure you've set up that device in cacti to use the port 1161 for snmp?

Maybe that STRING value off of 1.2.3.4.1.12.700 is throwing cacti off for it's parsing. Try switching the oid_index_parse to .1.2.3.4.1.12.701 or something.
laerg
Posts: 19
Joined: Sat Jul 02, 2005 7:12 pm

Post by laerg »

hehe no worries about post again :)

i also tried 701 .. same result ...

I've upped debug logging on device I'm trying to monitor. Now I see error message about "unknown PDU" when doing query via cacti ... does cacti use snmpwalk or snmpbulkwalk when checking indices ? I think might be something with bulk that work different from regular walk ...

grtz,
gert
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

laerg wrote:does cacti use snmpwalk or snmpbulkwalk when checking indices ? I think might be something with bulk that work different from regular walk ...
Well, it really depends on the snmp version required, configured paths for the net-snmp stuff in cacti, OS, and the poller type. A network capture like Wireshark should also help reveal what cacti is doing.

Testing with the net-snmp suite of tools, does the device not respond to the various different types of snmp* commands?
laerg
Posts: 19
Joined: Sat Jul 02, 2005 7:12 pm

Post by laerg »

I'm back from away ...
If I do manual "snmpbulkwalk", the snmp daemon of the queried device responds with " Unsupported PDU command......... 165" ... same error I get when doing "Data Query verbose / debug"

So it must be using snmpbulkwalk than for indices query I guess ? I've also tried running cacti with PHP-snmp enabled, but same result ...

I also tried disabling bulkwalk by setting "The Maximum SNMP OID's Per SNMP Get Request" to "0" ... but still snmpbulkwalk seemed to be used because same PDU error keeps showing up.

any other way to completely disable use of snmpbulkwalk ... I'd like to know befor I start delving in code.

grtz,
gert
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

laerg wrote:So it must be using snmpbulkwalk than for indices query I guess ?
Sounding like it
laerg wrote:I also tried disabling bulkwalk by setting "The Maximum SNMP OID's Per SNMP Get Request" to "0" ... but still snmpbulkwalk seemed to be used because same PDU error keeps showing up.
That only works with the Spine poller.
laerg wrote:any other way to completely disable use of snmpbulkwalk ... I'd like to know befor I start delving in code.
Developers will have a better idea since they're familiar with the code. You've removed the net-snmp snmpbulkwalk path from cacti's settings? Looking over the php snmp functions, it doesn't appear it has a snmpbulkwalk function...

Maybe inquire from the vendor why their device doesn't work with snmpbulkwalk?
laerg
Posts: 19
Joined: Sat Jul 02, 2005 7:12 pm

Post by laerg »

Hy,

I managed to work around any usage of snmpbulkwalks; first had to recompile PHP without SNMP support, thus disabling built-in bulk walks

And than had to point to false "snmpbulkwalk" binary in cacti settings, even though I use "SPINE" poller and "max OIDs ..." was set to "0" ...

now the indeces get found OK (possibly slower yes) and I can move on with my life :)

So I guess that when PHP has SNMP built-in, bulk will always be tried when checking indices ... no way to disable it. And even without SNMP if the path points to working version of "snmpbulkwalk" it uses it, at least with my install of "cacti-0.8.7e / spine-0.8.7e"

Now I will focus on jBoss snmp implementation and why certain PDU's of bulkwalks are not implemented...

thnx for all yer time.
grtz,
gert
Post Reply

Who is online

Users browsing this forum: No registered users and 6 guests