Data query regexp problem
Moderators: Developers, Moderators
Data query regexp problem
I have the oid
and .1.3.6.1.4.1.15181.101.1.4.4.1.6
snmpwalk .1.3.6.1.4.1.15181.101.1.4.4.1.6
SNMPv2-SMI::enterprises.15181.101.1.4.4.1.6.1.1 = Counter32: 3
SNMPv2-SMI::enterprises.15181.101.1.4.4.1.6.1.2 = Counter32: 5
SNMPv2-SMI::enterprises.15181.101.1.4.4.1.6.1.3 = Counter32: 7
SNMPv2-SMI::enterprises.15181.101.1.4.4.1.6.2.1 = Counter32: 1
SNMPv2-SMI::enterprises.15181.101.1.4.4.1.6.2.2 = Counter32: 3
SNMPv2-SMI::enterprises.15181.101.1.4.4.1.6.2.3 = Counter32: 9
SNMPv2-SMI::enterprises.15181.101.1.4.4.1.6.3.1 = Counter32: 1
SNMPv2-SMI::enterprises.15181.101.1.4.4.1.6.3.2 = Counter32: 2
SNMPv2-SMI::enterprises.15181.101.1.4.4.1.6.3.3 = Counter32: 5
SNMPv2-SMI::enterprises.15181.101.1.4.4.1.6.3.4 = Counter32: 7
SNMPv2-SMI::enterprises.15181.101.1.4.4.1.6.3.5 = Counter32: 3
SNMPv2-SMI::enterprises.15181.101.1.4.4.1.6.3.6 = Counter32: 6
SNMPv2-SMI::enterprises.15181.101.1.4.4.1.6.4.1 = Counter32: 6
SNMPv2-SMI::enterprises.15181.101.1.4.4.1.6.4.2 = Counter32: 2
SNMPv2-SMI::enterprises.15181.101.1.4.4.1.6.4.3 = Counter32: 4
SNMPv2-SMI::enterprises.15181.101.1.4.4.1.6.4.4 = Counter32: 7
SNMPv2-SMI::enterprises.15181.101.1.4.4.1.6.4.5 = Counter32: 1
SNMPv2-SMI::enterprises.15181.101.1.4.4.1.6.4.6 = Counter32: 5
SNMPv2-SMI::enterprises.15181.101.1.4.4.1.6.4.7 = Counter32: 5
SNMPv2-SMI::enterprises.15181.101.1.4.4.1.6.4.8 = Counter32: 8
My task is to get values which equal in the last .1
(example:
SNMPv2-SMI::enterprises.15181.101.1.4.4.1.6.1.1 = Counter32: 3
SNMPv2-SMI::enterprises.15181.101.1.4.4.1.6.2.1 = Counter32: 1
SNMPv2-SMI::enterprises.15181.101.1.4.4.1.6.3.1 = Counter32: 1
SNMPv2-SMI::enterprises.15181.101.1.4.4.1.6.4.1 = Counter32: 6 )
I wrote data-query
<interface>
<name>test</name>
<oid_index>.1.3.6.1.4.1.15181.101.1.4.4.1.2</oid_index>
<oid_index_parse>OID/REGEXP:.1.3.6.1.4.1.15181.101.1.4.4.1.6.([0-9].[1])</oid_index_parse>
<index_order>Index</index_order>
<index_order_type>numeric</index_order_type>
<fields>
<Index>
<name>Index</name>
<source>index</source>
<direction>input</direction>
</Index>
<Value1>
<name>Value1</name>
<method>walk</method>
<source>value</source>
<direction>input</direction>
<oid>.1.3.6.1.4.1.15181.101.1.4.4.1.6</oid>
</Value1>
</fields>
</interface>
But regexp do not work. Help please.
and .1.3.6.1.4.1.15181.101.1.4.4.1.6
snmpwalk .1.3.6.1.4.1.15181.101.1.4.4.1.6
SNMPv2-SMI::enterprises.15181.101.1.4.4.1.6.1.1 = Counter32: 3
SNMPv2-SMI::enterprises.15181.101.1.4.4.1.6.1.2 = Counter32: 5
SNMPv2-SMI::enterprises.15181.101.1.4.4.1.6.1.3 = Counter32: 7
SNMPv2-SMI::enterprises.15181.101.1.4.4.1.6.2.1 = Counter32: 1
SNMPv2-SMI::enterprises.15181.101.1.4.4.1.6.2.2 = Counter32: 3
SNMPv2-SMI::enterprises.15181.101.1.4.4.1.6.2.3 = Counter32: 9
SNMPv2-SMI::enterprises.15181.101.1.4.4.1.6.3.1 = Counter32: 1
SNMPv2-SMI::enterprises.15181.101.1.4.4.1.6.3.2 = Counter32: 2
SNMPv2-SMI::enterprises.15181.101.1.4.4.1.6.3.3 = Counter32: 5
SNMPv2-SMI::enterprises.15181.101.1.4.4.1.6.3.4 = Counter32: 7
SNMPv2-SMI::enterprises.15181.101.1.4.4.1.6.3.5 = Counter32: 3
SNMPv2-SMI::enterprises.15181.101.1.4.4.1.6.3.6 = Counter32: 6
SNMPv2-SMI::enterprises.15181.101.1.4.4.1.6.4.1 = Counter32: 6
SNMPv2-SMI::enterprises.15181.101.1.4.4.1.6.4.2 = Counter32: 2
SNMPv2-SMI::enterprises.15181.101.1.4.4.1.6.4.3 = Counter32: 4
SNMPv2-SMI::enterprises.15181.101.1.4.4.1.6.4.4 = Counter32: 7
SNMPv2-SMI::enterprises.15181.101.1.4.4.1.6.4.5 = Counter32: 1
SNMPv2-SMI::enterprises.15181.101.1.4.4.1.6.4.6 = Counter32: 5
SNMPv2-SMI::enterprises.15181.101.1.4.4.1.6.4.7 = Counter32: 5
SNMPv2-SMI::enterprises.15181.101.1.4.4.1.6.4.8 = Counter32: 8
My task is to get values which equal in the last .1
(example:
SNMPv2-SMI::enterprises.15181.101.1.4.4.1.6.1.1 = Counter32: 3
SNMPv2-SMI::enterprises.15181.101.1.4.4.1.6.2.1 = Counter32: 1
SNMPv2-SMI::enterprises.15181.101.1.4.4.1.6.3.1 = Counter32: 1
SNMPv2-SMI::enterprises.15181.101.1.4.4.1.6.4.1 = Counter32: 6 )
I wrote data-query
<interface>
<name>test</name>
<oid_index>.1.3.6.1.4.1.15181.101.1.4.4.1.2</oid_index>
<oid_index_parse>OID/REGEXP:.1.3.6.1.4.1.15181.101.1.4.4.1.6.([0-9].[1])</oid_index_parse>
<index_order>Index</index_order>
<index_order_type>numeric</index_order_type>
<fields>
<Index>
<name>Index</name>
<source>index</source>
<direction>input</direction>
</Index>
<Value1>
<name>Value1</name>
<method>walk</method>
<source>value</source>
<direction>input</direction>
<oid>.1.3.6.1.4.1.15181.101.1.4.4.1.6</oid>
</Value1>
</fields>
</interface>
But regexp do not work. Help please.
read http://docs.cacti.net/manual:087
try something like...
<oid_index>.1.3.6.1.4.1.15181.101.1.4.4.1.6</oid_index>
<oid_index_parse>OID/REGEXP:.*\.([0-9][1])$</oid_index_parse>
try something like...
<oid_index>.1.3.6.1.4.1.15181.101.1.4.4.1.6</oid_index>
<oid_index_parse>OID/REGEXP:.*\.([0-9][1])$</oid_index_parse>
| Scripts: Monitor processes | RFC1213 MIB | DOCSIS Stats | Dell PowerEdge | Speedfan | APC UPS | DOCSIS CMTS | 3ware | Motorola Canopy |
| Guides: Windows Install | [HOWTO] Debug Windows NTFS permission problems |
| Tools: Windows All-in-one Installer |
I am sorry for an error, but the offered variant also does not work.
<interface>
<name>IQ</name>
<oid_index>.1.3.6.1.4.1.15181.101.1.4.4.1.2</oid_index>
<oid_index_parse>OID/REGEXP:.*\.([0-9][1])$</oid_index_parse>
<index_order>Index</index_order>
<index_order_type>numeric</index_order_type>
<fields>
<Index>
<name>Index</name>
<source>index</source>
<direction>input</direction>
</Index>
<iq_mdi_total_loss>
<name>iq_mdi_total_loss</name>
<method>walk</method>
<source>value</source>
<direction>output</direction>
<oid>.1.3.6.1.4.1.15181.101.1.4.4.1.6</oid>
</iq_mdi_total_loss>
</fields>
</interface>
Result in attachment/
<interface>
<name>IQ</name>
<oid_index>.1.3.6.1.4.1.15181.101.1.4.4.1.2</oid_index>
<oid_index_parse>OID/REGEXP:.*\.([0-9][1])$</oid_index_parse>
<index_order>Index</index_order>
<index_order_type>numeric</index_order_type>
<fields>
<Index>
<name>Index</name>
<source>index</source>
<direction>input</direction>
</Index>
<iq_mdi_total_loss>
<name>iq_mdi_total_loss</name>
<method>walk</method>
<source>value</source>
<direction>output</direction>
<oid>.1.3.6.1.4.1.15181.101.1.4.4.1.6</oid>
</iq_mdi_total_loss>
</fields>
</interface>
Result in attachment/
- Attachments
-
- result.txt
- Result
- (355.39 KiB) Downloaded 105 times
Have you got some other OID (i.e. name for these counters or something), that full table has only .1 OID suffix?
If this table exists, you can use it as index and turn on method=get for .1.3.6.1.4.1.15181.101.1.4.4.1.2 effectively removing other counters from view.
Hiding index items on some logic condition is bad practice.
If this table exists, you can use it as index and turn on method=get for .1.3.6.1.4.1.15181.101.1.4.4.1.2 effectively removing other counters from view.
Hiding index items on some logic condition is bad practice.
In attachment.
- Attachments
-
- iq.xml
- XML
- (1.17 KiB) Downloaded 108 times
-
- result.txt
- Result
- (3.82 KiB) Downloaded 114 times
Who is online
Users browsing this forum: No registered users and 4 guests