For a few days I'm trying to manipulate the XML file in order to display the result of the OID (string) in the list of ITEMS.
I managed to make the string appear in this list but the RRD file can't be generated. On the other hand if I parse the OID with the REGEX function and return the last value (ex: ".0"), then the RRD is well created.
But for a good use I prefer to appear in the list the string which is more speaking rather than a simple number.
Here is my actual XML file (working) :
Code: Select all
<interface>
<name>Get SNMP Device</name>
<description>Queries Device</description>
<oid_index>.1.3.6.1.4.1.17713.20.2.1.4.2.0</oid_index>
<oid_index_parse>OID/REGEXP:^.{30}(.*)$</oid_index_parse>
<index_order>Index</index_order>
<index_order_type>alphabetic</index_order_type>
<fields>
<Index>
<name>Index</name>
<source>index</source>
<direction>input</direction>
</Index>
<Frequency>
<method>get</method>
<source>VALUE/REGEXP:([0-9]*)</source>
<direction>output</direction>
<oid>.1.3.6.1.4.1.17713.20.2.1.1.4</oid>
</Frequency>
<Rssi>
<method>get</method>
<source>value</source>
<direction>output</direction>
<oid>.1.3.6.1.4.1.17713.20.2.1.1.7.0</oid>
</Rssi>
<CinrR1>
<method>get</method>
<source>value</source>
<direction>output</direction>
<oid>.1.3.6.1.4.1.17713.20.2.1.1.9</oid>
</CinrR1>
<CinrR3>
<method>get</method>
<source>value</source>
<direction>output</direction>
<oid>.1.3.6.1.4.1.17713.20.2.1.1.10.0</oid>
</CinrR3>
</fields>
</interface>
Code: Select all
Total: 0, Delta: 0, Running data query [73].
Total: 0, Delta: 0, Found type = '3' [SNMP Query].
Total: 0, Delta: 0, Found data query XML file at '/usr/local/share/cacti/resource/snmp_queries/telrad7000-radio.xml'
Total: 0, Delta: 0, XML file parsed ok.
Total: 0, Delta: 0, <oid_num_indexes> missing in XML file, 'Index Count Changed' emulated by counting oid_index entries
Total: 0.47, Delta: 0.46, Executing SNMP walk for list of indexes @ '.1.3.6.1.4.1.17713.20.2.1.4.2.0' Index Count: 1
Total: 0.47, Delta: 0, Index found at OID: '.1.3.6.1.4.1.17713.20.2.1.4.2.0' value: 'CPE7000'
Total: 0.47, Delta: 0, index_parse at OID: '.1.3.6.1.4.1.17713.20.2.1.4.2.0' results: '0'
Total: 0.47, Delta: 0, Inserting index data for field 'Index' [value='0']
Total: 0.47, Delta: 0, Update data query sort cache complete
Total: 0.47, Delta: 0, Updated data query index ordering
Total: 0.53, Delta: 0.06, Update re-index cache complete
Total: 0.53, Delta: 0, Update graph data query cache complete
Total: 0.53, Delta: 0, Update data source data query cache complete
Total: 0.53, Delta: 0, Update data query cache complete
Total: 0.54, Delta: 0, Update poller cache from query complete
Total: 0.54, Delta: 0, Automation execute data query complete
Total: 0.54, Delta: 0, Plugin hooks complete
Code: Select all
<interface>
<name>Get SNMP TELRAD</name>
<description>Queries CPE Telrad 7000 - WiMax</description>
<oid_index>.1.3.6.1.4.1.17713.20.2.1.4.2.0</oid_index>
<oid_index_parse>OID/REGEXP:^.{31}(.*)$</oid_index_parse>
<index_order>Index</index_order>
<index_order_type>alphabetic</index_order_type>
<fields>
<Index>
<name>Index</name>
<method>walk</method>
<source>value</source>
<direction>input</direction>
<oid>.1.3.6.1.4.1.17713.20.2.1.4.2.0</oid>
</Index>
<Frequency>
<method>get</method>
<source>VALUE/REGEXP:([0-9]*)</source>
<direction>output</direction>
<oid>.1.3.6.1.4.1.17713.20.2.1.1.4</oid>
</Frequency>
<Rssi>
<method>get</method>
<source>value</source>
<direction>output</direction>
<oid>.1.3.6.1.4.1.17713.20.2.1.1.7.0</oid>
</Rssi>
<CinrR1>
<method>get</method>
<source>value</source>
<direction>output</direction>
<oid>.1.3.6.1.4.1.17713.20.2.1.1.9</oid>
</CinrR1>
<CinrR3>
<method>get</method>
<source>value</source>
<direction>output</direction>
<oid>.1.3.6.1.4.1.17713.20.2.1.1.10.0</oid>
</CinrR3>
</fields>
</interface>
Code: Select all
Total: 0, Delta: 0, Running data query [73].
Total: 0, Delta: 0, Found type = '3' [SNMP Query].
Total: 0, Delta: 0, Found data query XML file at '/usr/local/share/cacti/resource/snmp_queries/telrad7000-radio.xml'
Total: 0, Delta: 0, XML file parsed ok.
Total: 0, Delta: 0, <oid_num_indexes> missing in XML file, 'Index Count Changed' emulated by counting oid_index entries
Total: 0.47, Delta: 0.47, Executing SNMP walk for list of indexes @ '.1.3.6.1.4.1.17713.20.2.1.4.2.0' Index Count: 1
Total: 0.47, Delta: 0, Index found at OID: '.1.3.6.1.4.1.17713.20.2.1.4.2.0' value: 'CPE7000'
Total: 0.47, Delta: 0, index_parse at OID: '.1.3.6.1.4.1.17713.20.2.1.4.2.0' results: ''
Click to show data query output for field 'Index'
Total: 0.47, Delta: 0, Located input field 'Index' [walk]
Total: 0.94, Delta: 0.47, Executing SNMP walk for data @ '.1.3.6.1.4.1.17713.20.2.1.4.2.0'
Found item [Index='CPE7000'] index: [from value]
Total: 0.94, Delta: 0, Update data query sort cache complete
Total: 0.94, Delta: 0, Updated data query index ordering
Total: 1, Delta: 0.06, Update re-index cache complete
Total: 1, Delta: 0, Update graph data query cache complete
Total: 1, Delta: 0, Update data source data query cache complete
Total: 1, Delta: 0, Update data query cache complete
Total: 1.01, Delta: 0, Update poller cache from query complete
Total: 1.01, Delta: 0, Automation execute data query complete
Total: 1.01, Delta: 0, Plugin hooks complete
It's possible to set the items list from string value and get all values from OID in the xml file ? If not, can i set manually the name of the item list ?
Thank you in advance for your help.
BR.