[solved] Querying OIDs without an index

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

Moderators: Developers, Moderators

Post Reply
iverona
Posts: 4
Joined: Thu Dec 18, 2014 12:19 pm

[solved] Querying OIDs without an index

Post by iverona »

Hello all,

I looks like indexes are a quite common question but after googling for a long time I've not been able to find a solution. I've a set of oids:

$ snmpwalk -v2c -c vCPESecret 192.168.27.112 1.3.6.1.4.1.119.2.3.237.1 -On
.1.3.6.1.4.1.119.2.3.237.1.1.1.1.0 = INTEGER: operating(3)
.1.3.6.1.4.1.119.2.3.237.1.1.3.1.1.2.1 = INTEGER: 0
.1.3.6.1.4.1.119.2.3.237.1.1.3.1.1.3.1 = INTEGER: 40000

from a proprietary MIB. None of them is an index and I don't know how to query those 3 values. Should I use a Data Query? Create a new Data Input? Multiple data queries, one for each oid?

any help will be really appreciated as I've been trying everything I saw for the whole day with no luck.

Thanks,
Ignacio.
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Re: Querying OIDs without an index

Post by BSOD2600 »

It depends on how complex or simple the OIDs/tables are.

One method is http://docs.cacti.net/howto:data_query_ ... _not_exist
The other would be using a script (I'd recommend php script server) to handle the logic.
iverona
Posts: 4
Joined: Thu Dec 18, 2014 12:19 pm

Re: Querying OIDs without an index

Post by iverona »

BSOD2600,

thanks for your reply. Actually, my index is always 0 for most of the MIBs.

.1.3.6.1.4.1.119.2.3.237.1.1.3.1.1.2.1 = INTEGER: 0
.1.3.6.1.4.1.119.2.3.237.1.1.3.1.1.3.1 = INTEGER: 40000

So, can I somehow fix it and force always 1? I was even thinking on creating a fake value on smpd.conf and returning always 1. I'll try.
iverona
Posts: 4
Joined: Thu Dec 18, 2014 12:19 pm

Re: Querying OIDs without an index

Post by iverona »

Hi,

this is still not working but now I don't know why. This is the result of executing the query in debug mode:

Code: Select all

+ Running data query [10].
+ Found type = '3' [SNMP Query].
+ Found data query XML file at '/usr/share/cacti/site/resource/snmp_queries/ipfe-capacity.xml'
+ XML file parsed ok.
+ <oid_num_indexes> missing in XML file, 'Index Count Changed' emulated by counting oid_index entries
+ Executing SNMP walk for list of indexes @ '.1.3.6.1.4.1.119.2.3.237.1.1.3.1.1.1' Index Count: 0
+ No SNMP data returned
And this is the snmpwalk result:

Code: Select all

$ snmpwalk -v2c -c secret 192.168.1.1 .1.3.6.1.4.1.119.2.3.237.1.1.3.1.1.1 -On
.1.3.6.1.4.1.119.2.3.237.1.1.3.1.1.1.1 = INTEGER: 1
And this is header part of my XML:

Code: Select all

<interface>
        <name>Get IPFE info</name>
        <description>Queries a host for a list of monitorable interfaces</description>
        <oid_index>.1.3.6.1.4.1.119.2.3.237.1.1.3.1.1.1</oid_index>
        <index_order_type>numeric</index_order_type>
        <index_title_format>|chosen_order_field|</index_title_format>
Am I missing something? I've tried to compare this to the interface.xml and looks very similar...

thanks a lot.

PS: I got the "index" by overriding .1.3.6.1.4.1.119.2.3.237.1.1.3.1.1.1.1 in snmpd.conf:

Code: Select all

override .1.3.6.1.4.1.119.2.3.237.1.1.3.1.1.1.1 integer 1
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Re: Querying OIDs without an index

Post by BSOD2600 »

iverona wrote:Actually, my index is always 0 for most of the MIBs.

.1.3.6.1.4.1.119.2.3.237.1.1.3.1.1.2.1 = INTEGER: 0
.1.3.6.1.4.1.119.2.3.237.1.1.3.1.1.3.1 = INTEGER: 40000
you mean it's always 1, right?

Did you try the regex trick in the first link?
iverona
Posts: 4
Joined: Thu Dec 18, 2014 12:19 pm

Re: Querying OIDs without an index

Post by iverona »

Hi!

I ended up creating an SNMP data query for each of the OIDs, and it worked great.

thanks for your support!

Ignacio.
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests