Files
cacti/lib
gadzet21 537c500bb4 Adding a new method for use in xml files: value_parse_index (#5009)
* Adding a new method for use in xml files: value_parse_index

Add a new definition in xml files: value_parse_index
* What introduces the change:
- we add a new definition in xml files: <value_parse_index>

* What do we gain:
- we optimize the list of returned data by the method: "Get SNMP Data"
- we can better match the list in data query with what we want to see
- fewer records in the host_snmp_cache table
- we will increase the speed of returned data:
  - get method: for slow devices or a slow connection, a large list of returned data, only a few of which we care about
  - walk method: for fast devices and links

* Example:
<interface>
<name>Get SNMP Interfaces - CMTS Upstream</name>
<description>Queries a host for a list of interfaces for CMTS, only Upstreams</description>
<oid_index>.1.3.6.1.2.1.2.2.1.3</oid_index>
<value_index_parse>VALUE/REGEXP:129|205</value_index_parse>
<oid_index_parse>OID/REGEXP:.*\.([0-9]+)$</oid_index_parse>
<index_order>ifIndex</index_order>
<index_order_type>numeric</index_order_type>
<index_title_format>|chosen_order_field|</index_title_format>

<fields>
<ifIndex>
	<name>Index</name>
	<source>index</source>
	<direction>input</direction>
</ifIndex>
<ifType>
<name>Type</name>
	<method>walk</method>
	<source>value</source>
	<direction>input</direction>
	<oid>.1.3.6.1.2.1.2.2.1.3</oid>
</ifType>
<ifInOctets>
	<name>Bytes In</name>
	<method>walk</method>
	<source>value</source>
	<direction>output</direction>
	<oid>.1.3.6.1.2.1.2.2.1.10</oid>
</ifInOctets>
</fields>
</interface>
It will only show us a list of upstream interfaces.

You can also like this:
<oid_index>.1.3.6.1.2.1.2.2.1.8</oid_index>
<value_index_parse>VALUE/REGEXP:1</value_index_parse>
It will only show the interfaces in the up status.

The new definition works for the methods: get and walk.

CMTS devices can have many interfaces (e.g. cbr 130,000 interfaces), a user who wants to reduce the number of entries can use this definition.

In my cacti there are over 30 million records in the host_snmp_cache table, this change will reduce that amount.

* ChangeLog Update for pull requests Cacti#5009

Adding a new method for use in xml files: value_parse_index
<value_parse_index>VALUE/REGEXP:</value_parse_index>
2022-11-16 13:26:31 -05:00
..
2022-11-06 18:19:52 -05:00
2022-11-06 18:19:52 -05:00
2022-02-06 17:16:20 -05:00
2022-11-06 18:19:52 -05:00
2022-11-07 08:33:17 -05:00
2022-02-06 17:16:20 -05:00
2022-11-13 15:09:30 -05:00
2022-02-06 17:16:20 -05:00
2022-02-06 17:16:20 -05:00
2022-07-19 22:52:17 -04:00
2022-07-05 19:52:53 -04:00
2022-02-06 17:16:20 -05:00
2017-08-12 23:56:08 -04:00
2022-11-02 14:18:59 -04:00
2022-02-06 17:16:20 -05:00
2022-11-13 14:09:51 -05:00
2022-11-06 18:19:52 -05:00
2022-11-07 21:20:36 -05:00
2022-05-01 12:57:22 +01:00
2022-02-06 17:16:20 -05:00
2022-02-06 17:16:20 -05:00