Getting Partial Result error using XML SNMP query

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

Moderators: Developers, Moderators

User avatar
TheWitness
Developer
Posts: 17047
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

For some reason, you index is incorrect:

Code: Select all

.1.3.6.1.4.1.9600.1.1.1.1.3.iso.3.6.1.4.1.9600.1.1.1.1.1.2.83.58
You will notice that your snmpget appears to start out

Code: Select all

.1.3.6.1.4.1.9600.1.1.1.1.3
Followed by ".iso", which is ".1". So:

Code: Select all

.iso.3.6.1.4.1.9600.1.1.1...
Again you are doubling things for some reason. The index is ending up being the entire OID and not just the end of it.

TheWitness
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
User avatar
thisted
Cacti User
Posts: 69
Joined: Fri Apr 15, 2005 10:11 am
Location: Bay City, MI
Contact:

Post by thisted »

I understand that the oid's I'm querying for are incorrect, which is why I'm getting the partial results errors. What I don't understand is why the oid's are not correct. Why isn't it parsing them the correct way? Instead of querying for:

.1.3.6.1.4.1.9600.1.1.1.1.3.iso.3.6.1.4.1.9600.1.1.1.1.1.2.83.58
it should be querying for
.1.3.6.1.4.1.9600.1.1.1.1.1.3.2.83.58
or so you can see it clearer
.1.3.6.1.4.1.9600.1.1.1.1.3.iso.3.6.1.4.1.9600.1.1.1.1.1.2.83.58

Maybe having a getif screenshot of the diskinstance would help?
Attachments
GetIf2.GIF
GetIf2.GIF (34.28 KiB) Viewed 2026 times
raX
Lead Developer
Posts: 2243
Joined: Sat Oct 13, 2001 7:00 pm
Location: Carlisle, PA
Contact:

Post by raX »

Would it be possible to get read-only SNMP access to this device? It is possible that there is something simple like a regex typo that could be corrected easily with direct SNMP access. Feel free to send me an email if necessary.

-Ian
wally.nl
Posts: 8
Joined: Tue Jun 14, 2005 9:40 am
Contact:

Having the same problem...[edit] progress ?

Post by wally.nl »

Hi,

I'm having the exact same problem (0.8.6d I think, i'm just a user not the cacti system's admin).

SNMP cache:
Host: email, SNMP Query: win32 - test
Index: SNMPv2-SMI::enterprises.9600.1.2.61.1.1.4.48.32.67.58, Field Name: infInstance, Field Value: 0 C:
OID: .1.3.6.1.4.1.9600.1.2.61.1.1.SNMPv2-SMI::enterprises.9600.1.2.61.1.1.4.48.32.67.58
Host: email, SNMP Query: win32 - test
Index: SNMPv2-SMI::enterprises.9600.1.2.61.1.1.4.49.32.68.58, Field Name: infInstance, Field Value: 1 D:
OID: .1.3.6.1.4.1.9600.1.2.61.1.1.SNMPv2-SMI::enterprises.9600.1.2.61.1.1.4.49.32.68.58
Host: email, SNMP Query: win32 - test
Index: SNMPv2-SMI::enterprises.9600.1.2.61.1.1.4.50.32.70.58, Field Name: infInstance, Field Value: 2 F:
OID: .1.3.6.1.4.1.9600.1.2.61.1.1.SNMPv2-SMI::enterprises.9600.1.2.61.1.1.4.50.32.70.58
Host: email, SNMP Query: win32 - test
Index: SNMPv2-SMI::enterprises.9600.1.2.61.1.1.6.95.84.111.116.97.1, Field Name: infInstance, Field Value: _Total
OID: .1.3.6.1.4.1.9600.1.2.61.1.1.SNMPv2-SMI::enterprises.9600.1.2.61.1.1.6.95.84.111.116.97.108
Just to be sure...the <oid_index_parse> regexp should just return the part you consider the index so the red part in this sample, right ?

SNMPv2-SMI::enterprises.9600.1.2.61.1.1.4.48.32.67.58 = STRING: "0 C:"
SNMPv2-SMI::enterprises.9600.1.2.61.1.1.4.49.32.68.58 = STRING: "1 D:"
SNMPv2-SMI::enterprises.9600.1.2.61.1.1.4.50.32.70.58 = STRING: "2 F:"
SNMPv2-SMI::enterprises.9600.1.2.61.1.1.6.95.84.111.116.97.108 = STRING: "_Total"

If so, I'd love to try this regexp:

(?<=\.9600\.1\.2\.61\.1\.1)(\.[0-9]{1,3})*

Which imho should just return the following indexes:

.4.48.32.67.58
.4.49.32.68.58
.4.50.32.70.58
.6.95.84.111.116.97.108

But if I insert it I get these nasty messages (verbose query)
Warning: Variable passed to each() is not an array or object in /var/www/html/cacti/lib/data_query.php on line 490

Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/cacti/lib/data_query.php:490)

in /var/www/html/cacti/host.php on line 75
So either the "positive lookbehind" I use in my regexp is not implemented or the xml parser gets confused by the <= that is used in the regexp.

Also tried this one (I know, ugly):

\.4\.[4-5][0-9](\.[0-9]{1,3})*

Which only shouldn't return the _Total (for now I don't care) but that one also doesn't have the expected result.

Like thisted, I hope we'll come to a working solution, this data query stuff is driving me nuts (searching the forum several others as well). Most threads end with a "google on <OID_INDEX_PARSE>" remark after which the threads die, so far I've been unable to find a working solution.

Just to be complete, this is the <xml> I'm trying to get to work:

Code: Select all

<query>
        <name>Win32 Physical Disk Table - SNMP (Informant)</name>
        <description>Using SNMP-Informant Queries for a list of logical disks and their stats</description>
        <oid_index>.1.3.6.1.4.1.9600.1.2.61.1</oid_index>
        <oid_index_parse>OID/REGEXP:^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+\.([0-9\.]+)$</oid_index_parse>
        <index_order>infInstance</index_order>
        <index_order_type>alphabetic</index_order_type>
        <index_title_format>|chosen_order_field|</index_title_format>
        <fields>
                <infInstance>
                        <name>Disk Instance</name>
                        <method>walk</method>
                        <source>value</source>
                        <direction>input</direction>
                        <oid>.1.3.6.1.4.1.9600.1.2.61.1.1</oid>
                </infInstance>
                <infAvgReadQueue>
                        <name>Avg Read Queue</name>
                        <method>walk</method>
                        <source>value</source>
                        <direction>output</direction>
                        <oid>.1.3.6.1.4.1.9600.1.2.61.1.10</oid>
                </infAvgReadQueue>
                <infAvgWriteQueue>
                        <name>Avg Write Queue</name>
                        <method>walk</method>
                        <source>value</source>
                        <direction>output</direction>
                        <oid>.1.3.6.1.4.1.9600.1.2.61.1.11</oid>
                </infAvgWriteQueue>
                <infCurrentQueue>
                        <name>Current Queue</name>
                        <method>walk</method>
                        <source>value</source>
                        <direction>output</direction>
                        <oid>.1.3.6.1.4.1.9600.1.2.61.1.15</oid>
                </infCurrentQueue>
        </fields>
</query>
-------------------
Meanwhile I've came across this thread http://forums.cacti.net/viewtopic.php?t=6779 with a reference to the f5_bigip.xml which made me change the <oid_index_parse> to:

<oid_index_parse>OID/REGEXP:.*\.9600\.1\.2\.61\.1\.1\.([0-9\.]*)$</oid_index_parse>

This looks promising:
+ Running data query [16].
+ Found type = '3' [snmp query].
+ Found data query XML file at '/home/loonv/win32_disk.xml'
+ XML file parsed ok.
+ Executing SNMP walk for list of indexes @ '.1.3.6.1.4.1.9600.1.2.61.1'
+ Located input field 'infInstance' [walk]
+ Executing SNMP walk for data @ '.1.3.6.1.4.1.9600.1.2.61.1.1'
+ Found item [infInstance='0 C:'] index: 4.48.32.67.58 [from value]
+ Found item [infInstance='1 D:'] index: 4.49.32.68.58 [from value]
+ Found item [infInstance='2 F:'] index: 4.50.32.70.58 [from value]
+ Found item [infInstance='_Total'] index: 6.95.84.111.116.97.108 [from value]
+ Found data query XML file at '/home/loonv/win32_disk.xml'
+ Found data query XML file at '/home/loonv/win32_disk.xml'
+ Found data query XML file at '/home/loonv/win32_disk.xml'
The query still doesn't work as I was hoping but I think there is some progress. If I try to graph I get:
Notice: Undefined index: sgg_16 in /var/www/html/cacti/graphs_new.php on line 71

Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/cacti/graphs_new.php:71) in /var/www/html/cacti/graphs_new.php on line 310
But this could be a graph template problem.


Edit1: nasty typo's
Edit2: F5_BIGIP
Stvn
Posts: 11
Joined: Fri Jun 17, 2005 12:27 pm

Post by Stvn »

The reason you are getting the oid parsed twice is because in the <oid_index_parse> part u are grouping the whole OID.

That part is used to get a single number (Index value) from an oid.

eg in an oid as such:

.1.3.6.1.4.1.9.9.66.1.1.1.1.3.Index.Number.Number

You only get it right if you use a regexp as such
.*\.([0-9]+)\.[0-9]+\.[0-9]+$

Note that the 3rd number from last is in Brackets () which designates it as group 1 and data_query.php returns the match to group 1 as the index. If you have the whole OID in Brackets () then the index will become the whole OID again thus:

.1.3.6.1.4.1.9.9.66.1.1.1.1.3.Index.Number.Number.1.3.6.1.4.1.9.9.66.1.1.1.1.3.Index.Number.Number.

Next you need a field namely ifIndex whose <source> is index with the <oid> removed.

Anything else you wish to gather from the list of indexes should use <method> get as <method> walk disregards the indexes you parsed.

Hope this helps

Stvn
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests