Data query : Unable to get index from table

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

Moderators: Developers, Moderators

Post Reply
Aristide
Posts: 7
Joined: Mon Dec 12, 2011 2:27 am

Data query : Unable to get index from table

Post by Aristide »

Hello,

I'm trying to make a SNMP indexed data query using the xml file fot the followinf table :
#snmptable -Cb -v 1 -c public myhost LIEBERT-GP-PDU-MIB::lgpPduPsLineTable
SNMP table: LIEBERT-GP-PDU-MIB::lgpPduPsLineTable

Id Line EpLNTenths EpLN Ec EcHundredths EcThrshldUndrAlarm EcThrshldOvrWarn EcThrshldOvrAlarm EcAvailBeforeAlarm EcUsedBeforeAlarm EpLL EpLLTenths EcAvailBeforeAlarmHundredths
1 phase1 2293 0.1 Volts-AC-RMS 229 Volts-AC-RMS 1 0.1 Amps-AC-RMS 18 0.01 Amps-AC-RMS 0 Percent 75 Percent 80 Percent 126 0.1 Amps-AC-RMS 11 0.1 Percent ? ? 1262 0.01 Amps-AC-RMS
1 phase1 2286 0.1 Volts-AC-RMS 228 Volts-AC-RMS 0 0.1 Amps-AC-RMS 0 0.01 Amps-AC-RMS 0 Percent 75 Percent 80 Percent 128 0.1 Amps-AC-RMS 0 0.1 Percent ? ? 1280 0.01 Amps-AC-RMS

I can't see any index for this table as described in many examples on the wikis .... So I can't
populate the <oid_index></oid_index> within the xml file :-(

Do I miss something ?
If not, what would be the way to retrieve fields from the table ? Script query ? Ask the vendor to be compliant ....
Because I could see indexes on its MIB but they are "not-accessible".

Thanks,
Aristide
User avatar
Linegod
Developer
Posts: 1626
Joined: Thu Feb 20, 2003 10:16 am
Location: Canada
Contact:

Re: Data query : Unable to get index from table

Post by Linegod »

What about 1.3.6.1.4.1.476.1.42.3.8.20.1.5 ?

Description is "This is an internal index representing a unique identifier for
each PDU represented by this agent. The value is assigned
by the agent."

As a note, providing the numerical OID is easier to trouble shoot then the descriptive OID.
--
Live fast, die young
You're sucking up my bandwidth.

J.P. Pasnak,CD
CCNA, LPIC-1
http://www.warpedsystems.sk.ca
Aristide
Posts: 7
Joined: Mon Dec 12, 2011 2:27 am

Re: Data query : Unable to get index from table

Post by Aristide »

Hi Linegod,

Here is the xml output for a snmpwalk for the oid asked :
1.3.6.1.4.1.476.1.42.3.8.20.1.5

I used the OID as an index for the query
<query>
<name>Sensors</name>
<description> Query host for power usage</description>
<oid_index>.1.3.6.1.4.1.476.1.42.3.8.20.1.5</oid_index>
<oid_order_type>numeric</oid_order_type>
<index_title_format>|chosen_order_field|</index_title_format>
<fields>
<tempCIndex>
<name>Index</name>
<method>walk</method>
<source>value</source>
<direction>input</direction>
<oid>.1.3.6.1.4.1.476.1.42.3.8.60.15.1.70</oid>
</tempCIndex>
</fields>
</query>

And here is the output :
+ Running data query [11].
+ Found type = '3' [SNMP Query].
+ Found data query XML file at '/var/www/html/cacti/resource/snmp_queries/liebert-pdu-power.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.476.1.42.3.8.20.1.5' Index Count: 2
+ Index found at OID: '1.3.6.1.4.1.476.1.42.3.8.20.1.5.1' value: '1'
+ Index found at OID: '1.3.6.1.4.1.476.1.42.3.8.20.1.5.2' value: '2'
+ Located input field 'tempCIndex' [walk]
+ Executing SNMP walk for data @ '.1.3.6.1.4.1.476.1.42.3.8.60.15.1.70'

As a result/status in Cacti there is no items and no rows found.

I'm expecting those results:
# snmpwalk -v 1 -c public myhost 1.3.6.1.4.1.476.1.42.3.8.60.15.1.70
LIEBERT-GP-PDU-MIB::lgpPduAuxMeasTempDegC.1.1.1 = INTEGER: 285 0.1 degrees Celsius
LIEBERT-GP-PDU-MIB::lgpPduAuxMeasTempDegC.1.3.1 = INTEGER: 256 0.1 degrees Celsius
LIEBERT-GP-PDU-MIB::lgpPduAuxMeasTempDegC.1.4.1 = INTEGER: 255 0.1 degrees Celsius

Cheers
Attachments
mpx.xml.gz
mpx.xml is the output of a snmpwalk for
the oid 1.3.6.1.4.1.476.1.42.3.8.20.1.5
(25.16 KiB) Downloaded 93 times
User avatar
Linegod
Developer
Posts: 1626
Joined: Thu Feb 20, 2003 10:16 am
Location: Canada
Contact:

Re: Data query : Unable to get index from table

Post by Linegod »

Give the output for:

Code: Select all

snmpwalk -v 1 -c public myhost 1.3.6.1.4.1.476.1.42.3.8.60.15.1.70 -On
(Turn off the resolution, it makes things unclear).
--
Live fast, die young
You're sucking up my bandwidth.

J.P. Pasnak,CD
CCNA, LPIC-1
http://www.warpedsystems.sk.ca
Aristide
Posts: 7
Joined: Mon Dec 12, 2011 2:27 am

Re: Data query : Unable to get index from table

Post by Aristide »

Here we go :

.1.3.6.1.4.1.476.1.42.3.8.60.15.1.70.1.1.1 = INTEGER: 287 0.1 degrees Celsius
.1.3.6.1.4.1.476.1.42.3.8.60.15.1.70.1.3.1 = INTEGER: 258 0.1 degrees Celsius
.1.3.6.1.4.1.476.1.42.3.8.60.15.1.70.1.4.1 = INTEGER: 255 0.1 degrees Celsius
Aristide
Posts: 7
Joined: Mon Dec 12, 2011 2:27 am

Re: Data query : Unable to get index from table

Post by Aristide »

LineToGod is broken :-(

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

Re: Data query : Unable to get index from table

Post by gandalf »

Lately, we had some issues parsing mixed "number/strings" results. So you are requested to use latest code (aka 087i for cacti+spine).
To verify, if that is the issue, it would help to
- first change the XML for the field in question from <direction>output to <direction>input
- then perform a verbose query that should show the results

Do not forget to revert that change afterwards.
You may find some more hints at 2nd link of my sig. This will show you, what cmd.php/spine sees, when polling
R.
User avatar
Linegod
Developer
Posts: 1626
Joined: Thu Feb 20, 2003 10:16 am
Location: Canada
Contact:

Re: Data query : Unable to get index from table

Post by Linegod »

.1.3.6.1.4.1.476.1.42.3.8.20.1.5 should be defined as your input as well, and 1.3.6.1.4.1.476.1.42.3.8.60.15.1.70 should be defined as an output.

What is the model of this unit? I may have one to test against.
--
Live fast, die young
You're sucking up my bandwidth.

J.P. Pasnak,CD
CCNA, LPIC-1
http://www.warpedsystems.sk.ca
Aristide
Posts: 7
Joined: Mon Dec 12, 2011 2:27 am

Re: Data query : Unable to get index from table

Post by Aristide »

Hi,
The model is a Liebert MPX PDU, the latest MIB is available there :
http://www.emersonnetworkpower.com/en-U ... loads.aspx

I don't think I could use a data query based on indexes as there are not accessible :-( damned.
I guess I should run a script instead.

Best
Aristide
noname
Cacti Guru User
Posts: 1566
Joined: Thu Aug 05, 2010 2:04 am
Location: Japan

Re: Data query : Unable to get index from table

Post by noname »

For example:

Code: Select all

<query>
<name>LIEBERT-GP-PDU-MIB - lgpPduAuxMeasTempDegC</name>
<description>LIEBERT-GP-PDU-MIB - lgpPduAuxMeasTempDegC</description>
<oid_index>.1.3.6.1.4.1.476.1.42.3.8.60.15.1.70</oid_index>
<oid_index_parse>OID/REGEXP:.*\.([0-9]+\.[0-9]+\.[0-9]+)$</oid_index_parse>
<index_order>TempIndex</index_order>
<index_order_type>numeric</index_order_type>
<index_title_format>|chosen_order_field|</index_title_format>
<fields>
        <TempIndex>
                <name>TempIndex</name>
                <source>index</source>
                <direction>input</direction>
        </TempIndex>
        <debug_lgpPduAuxMeasTempDegC>
                <name>lgpPduAuxMeasTempDegC (for debugging)</name>
                <method>walk</method>
                <source>VALUE/REGEXP:([0-9]+) 0.1 degrees Celsius</source>
                <direction>input</direction>
                <oid>.1.3.6.1.4.1.476.1.42.3.8.60.15.1.70</oid>
        </debug_lgpPduAuxMeasTempDegC>
        <lgpPduAuxMeasTempDegC>
                <name>lgpPduAuxMeasTempDegC</name>
                <method>walk</method>
                <source>VALUE/REGEXP:([0-9]+) 0.1 degrees Celsius</source>
                <direction>output</direction>
                <oid>.1.3.6.1.4.1.476.1.42.3.8.60.15.1.70</oid>
        </lgpPduAuxMeasTempDegC>
</fields>
</query>
Verbose Query:
XML file parsed ok.
Executing SNMP walk for list of indexes @ '.1.3.6.1.4.1.476.1.42.3.8.60.15.1.70'
Index found at OID: '.1.3.6.1.4.1.476.1.42.3.8.60.15.1.70.1.1.1' value: '287 0.1 degrees Celsius'
Index found at OID: '.1.3.6.1.4.1.476.1.42.3.8.60.15.1.70.1.3.1' value: '258 0.1 degrees Celsius'
Index found at OID: '.1.3.6.1.4.1.476.1.42.3.8.60.15.1.70.1.4.1' value: '255 0.1 degrees Celsius'
index_parse at OID: '.1.3.6.1.4.1.476.1.42.3.8.60.15.1.70.1.1.1' results: '1.1.1'
index_parse at OID: '.1.3.6.1.4.1.476.1.42.3.8.60.15.1.70.1.3.1' results: '1.3.1'
index_parse at OID: '.1.3.6.1.4.1.476.1.42.3.8.60.15.1.70.1.4.1' results: '1.4.1'
Inserting index data for field 'TempIndex' [value='1.1.1']
Inserting index data for field 'TempIndex' [value='1.3.1']
Inserting index data for field 'TempIndex' [value='1.4.1']
Located input field 'debug_lgpPduAuxMeasTempDegC' [walk]
Executing SNMP walk for data @ '.1.3.6.1.4.1.476.1.42.3.8.60.15.1.70'
Found item [debug_lgpPduAuxMeasTempDegC='287'] index: 1.1.1 [from regexp value parse]
Found item [debug_lgpPduAuxMeasTempDegC='258'] index: 1.3.1 [from regexp value parse]
Found item [debug_lgpPduAuxMeasTempDegC='255'] index: 1.4.1 [from regexp value parse]
See also:
- Data Query Templates : SNMP Index does not exist
- SNMP Data Query Walkthrough : VALUE/REGEXP in Action
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest