Can't get |query_field_name| variables to display

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

Moderators: Developers, Moderators

Post Reply
acominoli
Posts: 3
Joined: Tue Nov 13, 2012 10:07 am

Can't get |query_field_name| variables to display

Post by acominoli »

I set up a data query and the values return correctly. But when I create a Comment item in a graph and specify Model: |pduModel| it shows exactly as typed to the left. It does not substitute the actual query variable.
XML file:
<interface>
<name>Get APC7900 Info</name>
<index_order_type>numeric</index_order_type>
<oid_index>.1.3.6.1.4.1.318.1.1.12.1</oid_index>

<fields>
<pduModel>
<name>Model</name>
<method>walk</method>
<source>value</source>
<direction>input</direction>
<oid>.1.3.6.1.4.1.318.1.1.12.1.5</oid>
</pduModel>
<pduSerial>
<name>Serial Number</name>
<method>walk</method>
<source>value</source>
<direction>input</direction>
<oid>.1.3.6.1.4.1.318.1.1.12.1.6</oid>
</pduSerial>
<pduFirmware>
<name>Firmware</name>
<method>walk</method>
<source>value</source>
<direction>input</direction>
<oid>.1.3.6.1.4.1.318.1.1.12.1.3</oid>
</pduFirmware>


</fields>
</interface>

Verbose query results:
+ Running data query [13].
+ Found type = '3' [SNMP Query].
+ Found data query XML file at 'C:/inetpub/wwwroot/cacti/resource/snmp_queries/AP7900-Info.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.318.1.1.12.1' Index Count: 18
+ Index found at OID: '1.3.6.1.4.1.318.1.1.12.1.1.0' value: 'GHC-SPDU'
+ Index found at OID: '1.3.6.1.4.1.318.1.1.12.1.2.0' value: 'B2'
+ Index found at OID: '1.3.6.1.4.1.318.1.1.12.1.3.0' value: 'v3.7.0'
+ Index found at OID: '1.3.6.1.4.1.318.1.1.12.1.4.0' value: '04/30/2009'
+ Index found at OID: '1.3.6.1.4.1.318.1.1.12.1.5.0' value: 'AP7900'
+ Index found at OID: '1.3.6.1.4.1.318.1.1.12.1.6.0' value: 'ZA0918003498'
+ Index found at OID: '1.3.6.1.4.1.318.1.1.12.1.7.0' value: '12'
+ Index found at OID: '1.3.6.1.4.1.318.1.1.12.1.8.0' value: '8'
+ Index found at OID: '1.3.6.1.4.1.318.1.1.12.1.9.0' value: '1'
+ Index found at OID: '1.3.6.1.4.1.318.1.1.12.1.10.0' value: '0'
+ Index found at OID: '1.3.6.1.4.1.318.1.1.12.1.11.0' value: '0'
+ Index found at OID: '1.3.6.1.4.1.318.1.1.12.1.12.0' value: '1'
+ Index found at OID: '1.3.6.1.4.1.318.1.1.12.1.13.0' value: '1'
+ Index found at OID: '1.3.6.1.4.1.318.1.1.12.1.14.0' value: '1'
+ Index found at OID: '1.3.6.1.4.1.318.1.1.12.1.15.0' value: '120'
+ Index found at OID: '1.3.6.1.4.1.318.1.1.12.1.16.0' value: '528'
+ Index found at OID: '1.3.6.1.4.1.318.1.1.12.1.17.0' value: '1000'
+ Index found at OID: '1.3.6.1.4.1.318.1.1.12.1.18.0' value: '528'
+ Located input field 'pduModel' [walk]
+ Executing SNMP walk for data @ '.1.3.6.1.4.1.318.1.1.12.1.5'
+ Found item [pduModel='AP7900'] index: 0 [from value]
+ Located input field 'pduSerial' [walk]
+ Executing SNMP walk for data @ '.1.3.6.1.4.1.318.1.1.12.1.6'
+ Found item [pduSerial='ZA0918003498'] index: 0 [from value]
+ Located input field 'pduFirmware' [walk]
+ Executing SNMP walk for data @ '.1.3.6.1.4.1.318.1.1.12.1.3'
+ Found item [pduFirmware='v3.7.0'] index: 0 [from value
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Re: Can't get |query_field_name| variables to display

Post by gandalf »

Please use |query_pduModel| instead
R.
acominoli
Posts: 3
Joined: Tue Nov 13, 2012 10:07 am

Re: Can't get |query_field_name| variables to display

Post by acominoli »

I actually have it that way and that is what shows on the graph i.e. Model: |pduModel|
pduModel.png
pduModel.png (26.44 KiB) Viewed 873 times
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Re: Can't get |query_field_name| variables to display

Post by gandalf »

!) Which version of Cacti are you using, please?
2) Navigate to "System Utilities -> View SNMP Cache and search for the device and the pduModel. Do you find it here?
R.
acominoli
Posts: 3
Joined: Tue Nov 13, 2012 10:07 am

Re: Can't get |query_field_name| variables to display

Post by acominoli »

Yes it shows the following:

Host: GHC-SPDU , SNMP Query: AP7900 - Info
Index: 0 , Field Name: pduModel , Field Value: AP7900
OID: .1.3.6.1.4.1.318.1.1.12.1.5.0

Cacti Version 0.8.8a
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Re: Can't get |query_field_name| variables to display

Post by gandalf »

Ah, got it.
Currently, you are using the last OID part as the index (just as "usually). But in fact, the last part always shows ".0". So, in fact, you should use the last two parts of the OID as the index, e.g. ".1.0", ".2.0", ".3.0" etc.
You will have to use a OID/REGEXP to do so. Search forums for multi-level indexes and/or 1st link of my sig
R.
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests