I am polling LDP sessions details through below snmp data query, want to capture IP Address from VALUE/REGEXP (direction is kept input for testing purpose)
OID/REGEXP giving below output for LdpLocalIP and LdpRemoteIP
10.117.224.21.0.0.4294901761.10.117.226.15
required first 4 octates ( 10.117.224.21 ) as LdpLocalIP and last 4 octates as LdpRemoteIP (10.117.226.15)
Code: Select all
<query>
<name>Huawei MPLS LDP Sessions</name>
<oid_index>.1.3.6.1.2.1.10.166.4.1.3.3.1.1</oid_index>
<oid_index_parse>OID/REGEXP:.*\.([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3})$</oid_index_parse>
<fields>
<StateLastChange>
<name>LastChange</name>
<method>walk</method>
<source>value</source>
<direction>input</direction>
<oid>.1.3.6.1.2.1.10.166.4.1.3.3.1.1</oid>
</StateLastChange>
<LdpSessionRole>
<name>SessionRole</name>
<method>walk</method>
<source>value</source>
<direction>input</direction>
<oid>.1.3.6.1.2.1.10.166.4.1.3.3.1.3</oid>
</LdpSessionRole>
<LdpLocalIP>
<name>SessionLocal</name>
<method>walk</method>
<source>OID/REGEXP:.1.3.6.1.2.1.10.166.4.1.3.3.1.3.(.*)\.0.0$</source>
<!--<source>VALUE/REGEXP:^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}</source> -->
<source>VALUE/REGEXP:^([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3})</source>
<!--<source>VALUE/REGEXP:^([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})*$</source> -->
<!--<source>OID/REGEXP:^\.?1\.3\.6\.1\.2\.1\.4\.20\.1\.2\.([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}).*</source> -->
<direction>input</direction>
<oid>.1.3.6.1.2.1.10.166.4.1.3.3.1.3</oid>
</LdpLocalIP>
<LdpRemoteIP>
<name>SessionRemote</name>
<method>walk</method>
<source>OID/REGEXP:.1.3.6.1.2.1.10.166.4.1.3.3.1.3.(.*)\.0.0$</source>
<source>VALUE/REGEXP:([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3})$</source>
<direction>input</direction>
<oid>.1.3.6.1.2.1.10.166.4.1.3.3.1.3</oid>
</LdpRemoteIP>
<LdpSessionState>
<name>SessionState</name>
<method>walk</method>
<source>value</source>
<direction>input</direction>
<oid>.1.3.6.1.2.1.10.166.4.1.3.3.1.2</oid>
</LdpSessionState>
</fields>
</query>
and for LdpRemoteIPTotal: 0.270000, Delta: 0.000000, Located input field 'LdpLocalIP' [walk]
Total: 0.330000, Delta: 0.050000, Executing SNMP walk for data @ '.1.3.6.1.2.1.10.166.4.1.3.3.1.3'
Found item [LdpLocalIP='3 (3)'] index: 0.151.0.0 [from regexp value parse]
Found item [LdpLocalIP='3 (3)'] index: 224.22.0.0 [from regexp value parse]
Found item [LdpLocalIP='3 (3)'] index: 226.15.0.0 [from regexp value parse]
Found item [LdpLocalIP='3 (3)'] index: 0.152.0.0 [from regexp value parse]
Found item [LdpLocalIP='3 (3)'] index: 0.113.0.0 [from regexp value parse]
Found item [LdpLocalIP='3 (3)'] index: 0.153.0.0 [from regexp value parse]
Found item [LdpLocalIP='3 (3)'] index: 1.103.0.0 [from regexp value parse]
Found item [LdpLocalIP='3 (3)'] index: 0.154.0.0 [from regexp value parse]
Found item [LdpLocalIP='3 (3)'] index: 0.160.0.0 [from regexp value parse]
Found item [LdpLocalIP='3 (3)'] index: 1.84.0.0 [from regexp value parse]
Found item [LdpLocalIP='3 (3)'] index: 0.161.0.0 [from regexp value parse]
Found item [LdpLocalIP='2 (2)'] index: 224.13.0.0 [from regexp value parse]
Found item [LdpLocalIP='3 (3)'] index: 0.114.0.0 [from regexp value parse]
Found item [LdpLocalIP='3 (3)'] index: 0.88.0.0 [from regexp value parse]
Total: 0.330000, Delta: 0.000000, Located input field 'LdpRemoteIP' [walk]
Total: 0.380000, Delta: 0.050000, Executing SNMP walk for data @ '.1.3.6.1.2.1.10.166.4.1.3.3.1.3'
Found item [LdpRemoteIP='3 (3)'] index: 0.151.0.0 [from regexp value parse]
Found item [LdpRemoteIP='3 (3)'] index: 224.22.0.0 [from regexp value parse]
Found item [LdpRemoteIP='3 (3)'] index: 226.15.0.0 [from regexp value parse]
Found item [LdpRemoteIP='3 (3)'] index: 0.152.0.0 [from regexp value parse]
Found item [LdpRemoteIP='3 (3)'] index: 0.113.0.0 [from regexp value parse]
Found item [LdpRemoteIP='3 (3)'] index: 0.153.0.0 [from regexp value parse]
Found item [LdpRemoteIP='3 (3)'] index: 1.103.0.0 [from regexp value parse]
Found item [LdpRemoteIP='3 (3)'] index: 0.154.0.0 [from regexp value parse]
Found item [LdpRemoteIP='3 (3)'] index: 0.160.0.0 [from regexp value parse]
Found item [LdpRemoteIP='3 (3)'] index: 1.84.0.0 [from regexp value parse]
Found item [LdpRemoteIP='3 (3)'] index: 0.161.0.0 [from regexp value parse]
Found item [LdpRemoteIP='2 (2)'] index: 224.13.0.0 [from regexp value parse]
Found item [LdpRemoteIP='3 (3)'] index: 0.114.0.0 [from regexp value parse]
Found item [LdpRemoteIP='3 (3)'] index: 0.88.0.0 [from regexp value parse]
Cacti: 1.2.11
Redhat: 7
PHP: 7