cacti icon indicating copy to clipboard operation
cacti copied to clipboard

VALUE/REGEXP or OID/REGEXP does not work with Output values

Open gadzet21 opened this issue 7 years ago • 18 comments

Hello. VALUE/REGEXP or OID/REGEXP does not work with Output values in .xml file.

Jacek

gadzet21 avatar Jan 22 '18 11:01 gadzet21

Please attach your Data Query XML for reference.

cigamit avatar Jan 23 '18 00:01 cigamit

File .xml:

<query>
        <name>Get SNMP memory used</name>
        <description>Get SNMP memory used</description>
        <oid_index>.1.3.6.1.4.1.20858.10.33.1.2.1.2</oid_index>
        <oid_index_parse>OID/REGEXP:^.{33}(.*)</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>
			<ifDescr>
                        <name>Name</name>
                        <method>walk</method>
                        <source>VALUE/REGEXP:^type memory, object memory,.|[,].*$</source>
                        <direction>input</direction>
                        <oid>.1.3.6.1.4.1.20858.10.33.1.2.1.2</oid>
			</ifDescr>
            <ifOperStatus>
                        <name>Status</name>
                        <method>walk</method>
                        <source>value</source>
                        <direction>input</direction>
                        <oid>.1.3.6.1.4.1.20858.10.33.1.2.1.4</oid>
			</ifOperStatus>
			<poolUsed>
                        <name>Memory pool used</name>
                        <method>walk</method>
						<oid>.1.3.6.1.4.1.20858.10.33.1.2.1.2</oid>
                        <source>VALUE/REGEXP:^.*\:.|\D*$</source>
                        <direction>input-output</direction>
             </poolUsed>
        </fields>
</query>

Data query:

Total: 0.02, Delta: 0.02, Executing SNMP walk for list of indexes @ '.1.3.6.1.4.1.20858.10.33.1.2.1.2' Index Count: 7
Total: 0.02, Delta: 0, Index found at OID: '.1.3.6.1.4.1.20858.10.33.1.2.1.2.0' value: 'type memory, object memory, slot 0, instance 0 : 1465280 Kbytes used'
Total: 0.02, Delta: 0, Index found at OID: '.1.3.6.1.4.1.20858.10.33.1.2.1.2.128' value: 'type memory, object memory, slot 1, instance 0 : 1239744 Kbytes used'
Total: 0.02, Delta: 0, Index found at OID: '.1.3.6.1.4.1.20858.10.33.1.2.1.2.768' value: 'type memory, object memory, slot smm, instance 0 : 1110984 Kbytes used'
Total: 0.02, Delta: 0, Index found at OID: '.1.3.6.1.4.1.20858.10.33.1.2.1.2.896' value: 'type memory, object memory, slot 7, instance 0 : 1044180 Kbytes used'
Total: 0.02, Delta: 0, Index found at OID: '.1.3.6.1.4.1.20858.10.33.1.2.1.2.1408' value: 'type memory, object memory, slot 11, instance 0 : 1589440 Kbytes used'
Total: 0.02, Delta: 0, Index found at OID: '.1.3.6.1.4.1.20858.10.33.1.2.1.2.1536' value: 'type memory, object memory, slot 12, instance 0 : 1592640 Kbytes used'
Total: 0.02, Delta: 0, Index found at OID: '.1.3.6.1.4.1.20858.10.33.1.2.1.2.1664' value: 'type memory, object memory, slot 13, instance 0 : 1591680 Kbytes used'
Total: 0.02, Delta: 0, index_parse at OID: '.1.3.6.1.4.1.20858.10.33.1.2.1.2.0' results: '0'
Total: 0.02, Delta: 0, index_parse at OID: '.1.3.6.1.4.1.20858.10.33.1.2.1.2.128' results: '128'
Total: 0.02, Delta: 0, index_parse at OID: '.1.3.6.1.4.1.20858.10.33.1.2.1.2.768' results: '768'
Total: 0.02, Delta: 0, index_parse at OID: '.1.3.6.1.4.1.20858.10.33.1.2.1.2.896' results: '896'
Total: 0.02, Delta: 0, index_parse at OID: '.1.3.6.1.4.1.20858.10.33.1.2.1.2.1408' results: '1408'
Total: 0.02, Delta: 0, index_parse at OID: '.1.3.6.1.4.1.20858.10.33.1.2.1.2.1536' results: '1536'
Total: 0.02, Delta: 0, index_parse at OID: '.1.3.6.1.4.1.20858.10.33.1.2.1.2.1664' results: '1664'
Total: 0.02, Delta: 0, Inserting index data for field 'ifIndex' [value='0']
Total: 0.02, Delta: 0, Inserting index data for field 'ifIndex' [value='128']
Total: 0.02, Delta: 0, Inserting index data for field 'ifIndex' [value='768']
Total: 0.02, Delta: 0, Inserting index data for field 'ifIndex' [value='896']
Total: 0.02, Delta: 0, Inserting index data for field 'ifIndex' [value='1408']
Total: 0.02, Delta: 0, Inserting index data for field 'ifIndex' [value='1536']
Total: 0.02, Delta: 0, Inserting index data for field 'ifIndex' [value='1664']
Click to show Data Query output for field 'ifDescr'
Total: 0.02, Delta: 0, Located input field 'ifDescr' [walk]
Total: 0.05, Delta: 0.02, Executing SNMP walk for data @ '.1.3.6.1.4.1.20858.10.33.1.2.1.2'
Found item [ifDescr='slot 0 (type memory, object memory, slot 0, instance 0 : 1465280 Kbytes used)'] index: 0 [from regexp value parse]
Found item [ifDescr='slot 1 (type memory, object memory, slot 1, instance 0 : 1239744 Kbytes used)'] index: 128 [from regexp value parse]
Found item [ifDescr='slot smm (type memory, object memory, slot smm, instance 0 : 1110984 Kbytes used)'] index: 768 [from regexp value parse]
Found item [ifDescr='slot 7 (type memory, object memory, slot 7, instance 0 : 1044180 Kbytes used)'] index: 896 [from regexp value parse]
Found item [ifDescr='slot 11 (type memory, object memory, slot 11, instance 0 : 1589440 Kbytes used)'] index: 1408 [from regexp value parse]
Found item [ifDescr='slot 12 (type memory, object memory, slot 12, instance 0 : 1592640 Kbytes used)'] index: 1536 [from regexp value parse]
Found item [ifDescr='slot 13 (type memory, object memory, slot 13, instance 0 : 1591680 Kbytes used)'] index: 1664 [from regexp value parse]
Click to show Data Query output for field 'ifOperStatus'
Total: 0.05, Delta: 0, Located input field 'ifOperStatus' [walk]
Total: 0.07, Delta: 0.02, Executing SNMP walk for data @ '.1.3.6.1.4.1.20858.10.33.1.2.1.4'
Found item [ifOperStatus='Up'] index: 0 [from value]
Found item [ifOperStatus='Up'] index: 128 [from value]
Found item [ifOperStatus='Up'] index: 768 [from value]
Found item [ifOperStatus='Up'] index: 896 [from value]
Found item [ifOperStatus='Up'] index: 1408 [from value]
Found item [ifOperStatus='Up'] index: 1536 [from value]
Found item [ifOperStatus='Up'] index: 1664 [from value]
Click to show Data Query output for field 'poolUsed'
Total: 0.07, Delta: 0, Located input field 'poolUsed' [walk]
Total: 0.09, Delta: 0.03, Executing SNMP walk for data @ '.1.3.6.1.4.1.20858.10.33.1.2.1.2'
Found item [poolUsed='1465280 (type memory, object memory, slot 0, instance 0 : 1465280 Kbytes used)'] index: 0 [from regexp value parse]
Found item [poolUsed='1239744 (type memory, object memory, slot 1, instance 0 : 1239744 Kbytes used)'] index: 128 [from regexp value parse]
Found item [poolUsed='1110984 (type memory, object memory, slot smm, instance 0 : 1110984 Kbytes used)'] index: 768 [from regexp value parse]
Found item [poolUsed='1044180 (type memory, object memory, slot 7, instance 0 : 1044180 Kbytes used)'] index: 896 [from regexp value parse]
Found item [poolUsed='1589440 (type memory, object memory, slot 11, instance 0 : 1589440 Kbytes used)'] index: 1408 [from regexp value parse]
Found item [poolUsed='1592640 (type memory, object memory, slot 12, instance 0 : 1592640 Kbytes used)'] index: 1536 [from regexp value parse]
Found item [poolUsed='1591680 (type memory, object memory, slot 13, instance 0 : 1591680 Kbytes used)'] index: 1664 [from regexp value parse]
Total: 0.12, Delta: 0.03, Update data query sort cache complete

LOG:

2018/01/23 09:45:02 - SPINE: Poller[1] Device[c100G-WroclaGadow-1_env_memory] TH[1] Graphs[172.18.71.10 - slot 1 - Memory Used, 172.18.71.10 - slot 1 - Memory Used] DS[347] SNMP: v2: 172.18.71.10, dsname: mem_used, oid: .1.3.6.1.4.1.20858.10.33.1.2.1.2.128, value: U
2018/01/23 09:45:02 - SPINE: Poller[1] WARNING: Invalid Response, Device[c100G-WroclaGadow-1_env_memory] TH[1] Graphs[172.18.71.10 - slot 1 - Memory Used, 172.18.71.10 - slot 1 - Memory Used] DS[347] SNMP: v2: 172.18.71.10, dsname: mem_used, oid: .1.3.6.1.4.1.20858.10.33.1.2.1.2.128, value: type memory, object memory, slot 1, instance 0 : 1239744
2018/01/23 09:45:02 - SPINE: Poller[1] Device[c100G-WroclaGadow-1_env_memory] TH[1] Graphs[172.18.71.10 - slot 0 - Memory Used, 172.18.71.10 - slot 0 - Memory Used] DS[346] SNMP: v2: 172.18.71.10, dsname: mem_used, oid: .1.3.6.1.4.1.20858.10.33.1.2.1.2.0, value: U
2018/01/23 09:45:02 - SPINE: Poller[1] WARNING: Invalid Response, Device[c100G-WroclaGadow-1_env_memory] TH[1] Graphs[172.18.71.10 - slot 0 - Memory Used, 172.18.71.10 - slot 0 - Memory Used] DS[346] SNMP: v2: 172.18.71.10, dsname: mem_used, oid: .1.3.6.1.4.1.20858.10.33.1.2.1.2.0, value: type memory, object memory, slot 0, instance 0 : 1465344

Graph - data query data-query-graph

gadzet21 avatar Jan 23 '18 09:01 gadzet21

You meant 'input-output' right?

cigamit avatar Jan 24 '18 13:01 cigamit

Upload the xml file. Also, a screen capture of the verbose reindex will help.

cigamit avatar Jan 24 '18 13:01 cigamit

<source>VALUE/REGEXP:^.*\:.|\D*$</source> <direction>input-output</direction> or <source>VALUE/REGEXP:^.*\:.|\D*$</source> <direction>output</direction> gives the same result. Whatever is after the word "VALUE/REGEXP:" gives the same result (value).

In log: SPINE: Poller[1] WARNING: Invalid Response, Device[c100G-WroclaGadow-1_env_memory] TH[1] Graphs[172.18.71.10 - slot 1 - Memory Used, 172.18.71.10 - slot 1 - Memory Used] DS[347] SNMP: v2: 172.18.71.10, dsname: mem_used, oid: .1.3.6.1.4.1.20858.10.33.1.2.1.2.128, value: type memory, object memory, slot 1, instance 0 : 1239808 Should be - value: 1239808

SPINE: Poller[1] WARNING: Invalid Response, Device[c100G-WroclaGadow-1_env_cpu] TH[1] Graphs[172.18.71.10 - 128 - CPU Used, 172.18.71.10 - 128 - CPU Used] DS[349] SNMP: v2: 172.18.71.10, dsname: cpu_used_5min, oid: .1.3.6.1.4.1.20858.10.33.1.1.1.2.128, value: type cpu, object cpu, slot 1, instance 0 : 98 Should be - value: 98

screen1 screen2

cisco_cmts_casa_env_cpu.xml.txt cisco_cmts_casa_env_memory.xml.txt

gadzet21 avatar Jan 24 '18 21:01 gadzet21

Okay, the code in lib/data_query.php looks pretty good. There are some minor formatting issues, but nothing logically wrong in my opinion. I think the problem may be the back slash in the regular expression and that when we read the file, it may be lost somehow. Can you escape that by using a double back slash? Also, put a cacti_log() statement in the re-indexing code around line: 678

cigamit avatar Jan 24 '18 23:01 cigamit

Only that 'input' is OK. 'Output' always the same, on matter what regular expression. Using: VALUE/REGEXP:[a-zA-Z] LOG: ...value: type memory, object memory, slot 1, instance 0 : 1239808 Using: VALUE/REGEXP:[0-9] LOG: ...value: type memory, object memory, slot 1, instance 0 : 1239808

I used between line 678 in file data_query.php:

cacti_log($value);
$modified_value = preg_replace('/' . $matches[1] . '/', "\\1", $value);
cacti_log($modified_value);

And: VALUE/REGEXP:[0-9], input-output

LOG:

2018/01/25 14:40:03 - CMDPHP type memory, object memory, slot , instance : Kbytes used
2018/01/25 14:40:03 - CMDPHP type memory, object memory, slot 13, instance 0 : 1591552 Kbytes used
2018/01/25 14:40:03 - CMDPHP type memory, object memory, slot , instance : Kbytes used
2018/01/25 14:40:03 - CMDPHP type memory, object memory, slot 12, instance 0 : 1592640 Kbytes used

For: VALUE/REGEXP:[0-9], output LOG empty.

gadzet21 avatar Jan 25 '18 13:01 gadzet21

I switch Poller type to cmd.php

<source>VALUE/REGEXP:[^0-9]</source>
<direction>output</direction>

LOG:

2018/01/25 15:40:02 - POLLER: Poller[1] Time: 0.2136 s, Poller: , Theads: N/A, Devices: 1
2018/01/25 15:40:02 - POLLER: Poller[1] WARNING: Invalid Response(s), Errors[2] Device[c100G-WroclaGadow-1_env_memory] Thread[1] Graphs[172.18.71.10 - slot 0 - Memory Used, 172.18.71.10 - slot 0 - Memory Used] Graphs[172.18.71.10 - slot 1 - Memory Used, 172.18.71.10 - slot 1 - Memory Used] DS[346, 347]
2018/01/25 15:40:02 - POLLER: Poller[1] Device[c100G-WroclaGadow-1_env_memory] Graphs[172.18.71.10 - slot 1 - Memory Used, 172.18.71.10 - slot 1 - Memory Used] DS[347] SNMP: v2: 172.18.71.10, dsname: mem_used, oid: .1.3.6.1.4.1.20858.10.33.1.2.1.2.128, output: U
2018/01/25 15:40:02 - POLLER: Poller[1] Device[c100G-WroclaGadow-1_env_memory] Graphs[172.18.71.10 - slot 1 - Memory Used, 172.18.71.10 - slot 1 - Memory Used] DS[347] WARNING: Result from SNMP not valid. Partial Result: type memory, object
2018/01/25 15:40:02 - POLLER: Poller[1] Device[c100G-WroclaGadow-1_env_memory] Graphs[172.18.71.10 - slot 0 - Memory Used, 172.18.71.10 - slot 0 - Memory Used] DS[346] SNMP: v2: 172.18.71.10, dsname: mem_used, oid: .1.3.6.1.4.1.20858.10.33.1.2.1.2.0, output: U
2018/01/25 15:40:02 - POLLER: Poller[1] Device[c100G-WroclaGadow-1_env_memory] Graphs[172.18.71.10 - slot 0 - Memory Used, 172.18.71.10 - slot 0 - Memory Used] DS[346] WARNING: Result from SNMP not valid. Partial Result: type memory, object
2018/01/25 15:40:02 - POLLER: Poller[1] ASSERT: '896=' failed. Recaching host '172.18.71.10', data query #13
2018/01/25 15:40:02 - POLLER: Poller[1] Device[c100G-WroclaGadow-1_env_memory] RECACHE DQ[13] OID: .1.3.6.1.4.1.20858.10.33.1.2.1.2, output:
2018/01/25 15:40:02 - POLLER: Poller[1] Device[c100G-WroclaGadow-1_env_memory] RECACHE: Processing 1 items in the auto reindex cache for '172.18.71.10'.
2018/01/25 15:40:02 - POLLER: Poller[1] Device[c100G-WroclaGadow-1_env_memory] STATUS: Device '172.18.71.10' is UP.

gadzet21 avatar Jan 25 '18 14:01 gadzet21

As I see at output, it responds: spine or cmd.php

/usr/local/spine/bin/spine --first=23 --last=23
SPINE: Using spine config file [/etc/cacti/spine.conf]
SPINE: Version 1.1.31 starting
2018/01/26 13:04:58 - SPINE: Poller[1] NOTE: Spine will support multithread device polling.
2018/01/26 13:04:58 - SPINE: Poller[1] DEBUG: Initial Value of Active Threads is 0
2018/01/26 13:04:58 - SPINE: Poller[1] SPINE: Active Threads is 1, Pending is 1
2018/01/26 13:04:58 - SPINE: Poller[1] DEBUG: In Poller, About to Start Polling of Device for Device ID 23
2018/01/26 13:04:58 - SPINE: Poller[1] Device[23] DEBUG: Entering SNMP Ping
2018/01/26 13:04:58 - SPINE: Poller[1] Device[23] SNMP Result: Device responded to SNMP
2018/01/26 13:04:58 - SPINE: Poller[1] Updating Full System Information Table
2018/01/26 13:04:59 - SPINE: Poller[1] Device[23] TH[1] RECACHE: Processing 1 items in the auto reindex cache for '172.18.71.10'
2018/01/26 13:04:59 - SPINE: Poller[1] Device[23] TH[1] Recache DataQuery[13] OID: .1.3.6.1.4.1.20858.10.33.1.2.1.2, output: Variable has bad type
2018/01/26 13:04:59 - SPINE: Poller[1] Device[23] TH[1] ASSERT: '896' .eq. 'Variable has bad type' failed. Recaching host '172.18.71.10', data query #13
2018/01/26 13:04:59 - SPINE: Poller[1] Device[23] TH[1] NOTE: There are '2' Polling Items for this Device
2018/01/26 13:04:59 - SPINE: Poller[1] WARNING: Invalid Response, Device[23] TH[1] DS[346] SNMP: v2: 172.18.71.10, dsname: mem_used, oid: .1.3.6.1.4.1.20858.10.33.1.2.1.2.0, value: type memory, object memory, slot 0, instance 0 : 1465344
2018/01/26 13:04:59 - SPINE: Poller[1] Device[23] TH[1] DS[346] SNMP: v2: 172.18.71.10, dsname: mem_used, oid: .1.3.6.1.4.1.20858.10.33.1.2.1.2.0, value: U
2018/01/26 13:04:59 - SPINE: Poller[1] WARNING: Invalid Response, Device[23] TH[1] DS[347] SNMP: v2: 172.18.71.10, dsname: mem_used, oid: .1.3.6.1.4.1.20858.10.33.1.2.1.2.128, value: type memory, object memory, slot 1, instance 0 : 1239744
2018/01/26 13:04:59 - SPINE: Poller[1] Device[23] TH[1] DS[347] SNMP: v2: 172.18.71.10, dsname: mem_used, oid: .1.3.6.1.4.1.20858.10.33.1.2.1.2.128, value: U
2018/01/26 13:04:59 - SPINE: Poller[1] Device[23] TH[1] Total Time:  0.17 Seconds
2018/01/26 13:04:59 - SPINE: Poller[1] Device[23] TH[1] DEBUG: HOST COMPLETE: About to Exit Device Polling Thread Function
2018/01/26 13:04:59 - SPINE: Poller[1] DEBUG: The Value of Active Threads is 0 for Device ID 23
2018/01/26 13:04:59 - SPINE: Poller[1] POLLR: Active Threads is 0, Pending is 0
2018/01/26 13:04:59 - SPINE: Poller[1] SPINE: The Final Value of Threads is 0
2018/01/26 13:04:59 - SPINE: Poller[1] Time: 1.0440 s, Threads: 5, Devices: 1

Is it possible to implement VALUE/REGEXP for output in file xml to read it SPINE?

Sorry for my English :)

gadzet21 avatar Jan 26 '18 12:01 gadzet21

Okay, on the input_output, this is my mistake. When supporting input/output, I failed to handle the output part. This will require a bit more work. We will have to include the regular expression in the poller_item table, or to be indicative that the value will be evaluated by poller.php as a regular expression, and then allow those unfiltered values to be saved to the database.

Since it's a bit more work, this will have to be resolved in the 1.2 branch. This means that until 1.2 is formally released, you will have to run half pregnant. Should not be too difficult. If you are okay with that, I will provide some patches for you to test. Your thoughts?

On the input side of your regular expression in the XML file, the backslash needs to be a bit differently when in the XML. I'll have to test is a a bit. But I think if you instead of using \, you use &amp;#92;, the input values should be handled properly. Can you also check that?

cigamit avatar Jan 28 '18 16:01 cigamit

I'm looking forward to have this one as well :D

jpobeda avatar Feb 04 '18 19:02 jpobeda

The only way to do this well is to place the regular expression into the arg2 in the poller_item table. It's not a large amount of work, but will need to be coordinated between Cacti and Spine.

cigamit avatar Feb 05 '18 04:02 cigamit

Hi, Are there any progress in this topic? If it can, then I will be happy to test the patch.

gadzet21 avatar Apr 06 '18 09:04 gadzet21

Hi Everyone,

I ran some tests and I have something to ask and something to confirm

I can confirm

  • output fields in SNMP queries are not impacted by any OID/REGEXP or VALUE/REGEXP manipulation (#1252) this either with cmd.php or spine
  • output fields are not impacted by <rewrite_index> (so to attach an index from the value of another field to compose the OID to query (formerly #1921 ... should I create a new issue or can we follow up that one here too?)

I would like to ask:

  • I tested on some input and input-output fields with VALUE/REGEXP and it's true I am rather new to this function but is it the expected behavior that it filters (so it removes) the matching pattern in the regex from the resulting value? I would expect that it includes the matching pattern but it's just my curiosity on this logic and why...

an example is this one, I played with "interface.xml" ifDescr field:

                <ifDescr>
                        <name>Description</name>
                        <method>walk</method>
                        <source>VALUE/REGEXP:[A-Za-z]</source>
                        <direction>input-output</direction>
                        <oid>.1.3.6.1.2.1.2.2.1.2</oid>
                </ifDescr>

The outcome was the following, all my interfaces description contained in the end only the numeric portion:

Total: 1.190000, Delta: 0.000000, Located input field 'ifDescr' [walk]
Total: 1.550000, Delta: 0.350000, Executing SNMP walk for data @ '.1.3.6.1.2.1.2.2.1.2'
Found item [ifDescr='0/0 (GigabitEthernet0/0)'] index: 1 [from regexp value parse]
Found item [ifDescr='0 (Null0)'] index: 2 [from regexp value parse]
Found item [ifDescr='1/0/1 (GigabitEthernet1/0/1)'] index: 3 [from regexp value parse]
Found item [ifDescr='1/0/2 (GigabitEthernet1/0/2)'] index: 4 [from regexp value parse]
Found item [ifDescr='1/0/3 (GigabitEthernet1/0/3)'] index: 5 [from regexp value parse]
Found item [ifDescr='1/0/4 (GigabitEthernet1/0/4)'] index: 6 [from regexp value parse]
Found item [ifDescr='1/0/5 (GigabitEthernet1/0/5)'] index: 7 [from regexp value parse]
Found item [ifDescr='1/0/6 (GigabitEthernet1/0/6)'] index: 8 [from regexp value parse]
Found item [ifDescr='1/0/7 (GigabitEthernet1/0/7)'] index: 9 [from regexp value parse]
Found item [ifDescr='1/0/8 (GigabitEthernet1/0/8)'] index: 10 [from regexp value parse]
Found item [ifDescr='1/0/9 (GigabitEthernet1/0/9)'] index: 11 [from regexp value parse]
Found item [ifDescr='1/0/10 (GigabitEthernet1/0/10)'] index: 12 [from regexp value parse]


g1augusto avatar Sep 21 '18 23:09 g1augusto

Try putting the match in brackets so it’s a capturing regex

netniV avatar Sep 21 '18 23:09 netniV

Hi @netniV

These are my tests and the outcome, none produced a capturing regex, can you let me know if it's me doing something wrong or there is something not working? (posting this here because I think it's related to the original issue)

Again I was testing with interface.xml ifDescr field

  • Test 1 : VALUE/REGEXP:(Giga)

              <ifDescr>
                      <name>Description</name>
                      <method>walk</method>
                      <source>VALUE/REGEXP:(Giga)</source>
                      <direction>input-output</direction>
                      <oid>.1.3.6.1.2.1.2.2.1.2</oid>
              </ifDescr>
    
  • result :

Total: 1.200000, Delta: 0.000000, Located input field 'ifDescr' [walk]
Total: 1.610000, Delta: 0.400000, Executing SNMP walk for data @ '.1.3.6.1.2.1.2.2.1.2'
Found item [ifDescr='GigabitEthernet0/0 (GigabitEthernet0/0)'] index: 1 [from regexp value parse]
Found item [ifDescr='Null0 (Null0)'] index: 2 [from regexp value parse]
Found item [ifDescr='GigabitEthernet1/0/1 (GigabitEthernet1/0/1)'] index: 3 [from regexp value parse]
Found item [ifDescr='GigabitEthernet1/0/2 (GigabitEthernet1/0/2)'] index: 4 [from regexp value parse]
Found item [ifDescr='GigabitEthernet1/0/3 (GigabitEthernet1/0/3)'] index: 5 [from regexp value parse]
Found item [ifDescr='GigabitEthernet1/0/4 (GigabitEthernet1/0/4)'] index: 6 [from regexp value parse]
Found item [ifDescr='GigabitEthernet1/0/5 (GigabitEthernet1/0/5)'] index: 7 [from regexp value parse]
Found item [ifDescr='GigabitEthernet1/0/6 (GigabitEthernet1/0/6)'] index: 8 [from regexp value parse]
Found item [ifDescr='GigabitEthernet1/0/7 (GigabitEthernet1/0/7)'] index: 9 [from regexp value parse]
Found item [ifDescr='GigabitEthernet1/0/8 (GigabitEthernet1/0/8)'] index: 10 [from regexp value parse]

  • Test 2 : VALUE/REGEXP:[Giga]

              <ifDescr>
                      <name>Description</name>
                      <method>walk</method>
                      <source>VALUE/REGEXP:[Giga]</source>
                      <direction>input-output</direction>
                      <oid>.1.3.6.1.2.1.2.2.1.2</oid>
              </ifDescr>
    
  • result :

Total: 1.180000, Delta: 0.000000, Located input field 'ifDescr' [walk]
Total: 1.540000, Delta: 0.350000, Executing SNMP walk for data @ '.1.3.6.1.2.1.2.2.1.2'
Found item [ifDescr='btEthernet0/0 (GigabitEthernet0/0)'] index: 1 [from regexp value parse]
Found item [ifDescr='Null0 (Null0)'] index: 2 [from regexp value parse]
Found item [ifDescr='btEthernet1/0/1 (GigabitEthernet1/0/1)'] index: 3 [from regexp value parse]
Found item [ifDescr='btEthernet1/0/2 (GigabitEthernet1/0/2)'] index: 4 [from regexp value parse]
Found item [ifDescr='btEthernet1/0/3 (GigabitEthernet1/0/3)'] index: 5 [from regexp value parse]
Found item [ifDescr='btEthernet1/0/4 (GigabitEthernet1/0/4)'] index: 6 [from regexp value parse]
Found item [ifDescr='btEthernet1/0/5 (GigabitEthernet1/0/5)'] index: 7 [from regexp value parse]
Found item [ifDescr='btEthernet1/0/6 (GigabitEthernet1/0/6)'] index: 8 [from regexp value parse]
Found item [ifDescr='btEthernet1/0/7 (GigabitEthernet1/0/7)'] index: 9 [from regexp value parse]
Found item [ifDescr='btEthernet1/0/8 (GigabitEthernet1/0/8)'] index: 10 [from regexp value parse]

g1augusto avatar Sep 22 '18 09:09 g1augusto

And what happens if its on an input field?

netniV avatar Sep 22 '18 10:09 netniV

changed ifDescr to input field, same outcome

            <ifDescr>
                    <name>Description</name>
                    <method>walk</method>
                    <source>VALUE/REGEXP:(Giga)</source>
                    <direction>input</direction>
                    <oid>.1.3.6.1.2.1.2.2.1.2</oid>
            </ifDescr>

result :

Total: 1.110000, Delta: 0.000000, Located input field 'ifDescr' [walk]
Total: 1.460000, Delta: 0.350000, Executing SNMP walk for data @ '.1.3.6.1.2.1.2.2.1.2'
Found item [ifDescr='GigabitEthernet0/0 (GigabitEthernet0/0)'] index: 1 [from regexp value parse]
Found item [ifDescr='Null0 (Null0)'] index: 2 [from regexp value parse]
Found item [ifDescr='GigabitEthernet1/0/1 (GigabitEthernet1/0/1)'] index: 3 [from regexp value parse]
Found item [ifDescr='GigabitEthernet1/0/2 (GigabitEthernet1/0/2)'] index: 4 [from regexp value parse]
Found item [ifDescr='GigabitEthernet1/0/3 (GigabitEthernet1/0/3)'] index: 5 [from regexp value parse]
Found item [ifDescr='GigabitEthernet1/0/4 (GigabitEthernet1/0/4)'] index: 6 [from regexp value parse]
Found item [ifDescr='GigabitEthernet1/0/5 (GigabitEthernet1/0/5)'] index: 7 [from regexp value parse]
Found item [ifDescr='GigabitEthernet1/0/6 (GigabitEthernet1/0/6)'] index: 8 [from regexp value parse]
Found item [ifDescr='GigabitEthernet1/0/7 (GigabitEthernet1/0/7)'] index: 9 [from regexp value parse]
Found item [ifDescr='GigabitEthernet1/0/8 (GigabitEthernet1/0/8)'] index: 10 [from regexp value parse]


g1augusto avatar Sep 22 '18 10:09 g1augusto