I am struggling with setting up a regular expression that ignores the first 14 (.1.3.6.1.4.1.9.9.161.1.4.1.1.3) OIDs and indexes the rest of the fields, this would enable the creation of a variable length index.
*********************
SNMPv2-SMI::enterprises.9.9.161.1.4.1.1.3 {.0.4.86.68.71.72}
SNMPv2-SMI::enterprises.9.9.161.1.4.1.1.3 {.0.5.86.82.80.45.49}
SNMPv2-SMI::enterprises.9.9.161.1.4.1.1.3 {.0.5.86.82.80.45.50}
SNMPv2-SMI::enterprises.9.9.161.1.4.1.1.3 {.0.6.86.83.68.71.72.49}
SNMPv2-SMI::enterprises.9.9.161.1.4.1.1.3 {.0.9.86.82.80.45.49.45.53.53.52}
SNMPv2-SMI::enterprises.9.9.161.1.4.1.1.3 {.0.9.86.82.80.45.50.45.53.53.52}
SNMPv2-SMI::enterprises.9.9.161.1.4.1.1.3 {.0.11.86.83.68.71.72.49.45.66.79.79.77}
** {} means that these are the fields I need in creating my variable length index
********************************
<vservers>
<name>Get vservers Connection Information</name>
<description>Queries a host for a list of configured vservers</description>
<oid_index>.1.3.6.1.4.1.9.9.161.1.4.1.1.3</oid_index>
<oid_index_parse>OID/REGEXP:[^(\.[0-9]{1,3})] {14,0}\* </oid_index_parse>
<index_order>slbVirtualIndex</index_order>
<index_order_type>numeric</index_order_type>
<index_title_format>|chosen_order_field|</index_title_format>
<fields>
<slbVirtualIndex>
<name>Index</name>
<method>walk</method>
<source>value</source>
<direction>input</direction>
<oid>.1.3.6.1.4.1.9.9.161.1.4.1.1.3</oid>
Thanks
Tony
Cacti SNMP query script
Moderators: Developers, Moderators
Your oid_index_parse should look like this:
<oid_index_parse>OID/REGEXP:.*\.161\.1\.4\.1\.1\.3\.(.*)$</oid_index_parse>
or even:
<oid_index_parse>OID/REGEXP:\.1\.3\.6\.1\.4\.1\.9\.9\.161\.1\.4\.1\.1\.3\.(.*)$</oid_index_parse>
Your parse is missing the part in parenthesis, which is the one that cacti will use as an index... and it has the "^" symbol, which indicates the beginning of the OID, inside the loop:
<oid_index_parse>OID/REGEXP:^[\.[0-9]{1,3})] {14,0}\.(.*)$</oid_index_parse>
<oid_index_parse>OID/REGEXP:.*\.161\.1\.4\.1\.1\.3\.(.*)$</oid_index_parse>
or even:
<oid_index_parse>OID/REGEXP:\.1\.3\.6\.1\.4\.1\.9\.9\.161\.1\.4\.1\.1\.3\.(.*)$</oid_index_parse>
Your parse is missing the part in parenthesis, which is the one that cacti will use as an index... and it has the "^" symbol, which indicates the beginning of the OID, inside the loop:
<oid_index_parse>OID/REGEXP:^[\.[0-9]{1,3})] {14,0}\.(.*)$</oid_index_parse>
-
- Posts: 3
- Joined: Fri Mar 17, 2006 9:26 am
Thanks for you input, after a couple of trial and errors, I was able to get it working without any () brackets apart from the (.*) used for matching the variable length fields.
<vservers>
<name>Get vservers Connection Information</name>
<description>Queries a host for a list of configured vservers</description>
<oid_index>.1.3.6.1.4.1.9.9.161.1.4.1.1.3</oid_index>
<oid_index_parse>OID/REGEXP:^\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}(.*)$</oid_index_parse>
<index_order>slbVirtualIndex</index_order>
<index_order_type>numeric</index_order_type>
<index_title_format>|chosen_order_field|</index_title_format>
Thanks
Tony
<vservers>
<name>Get vservers Connection Information</name>
<description>Queries a host for a list of configured vservers</description>
<oid_index>.1.3.6.1.4.1.9.9.161.1.4.1.1.3</oid_index>
<oid_index_parse>OID/REGEXP:^\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}(.*)$</oid_index_parse>
<index_order>slbVirtualIndex</index_order>
<index_order_type>numeric</index_order_type>
<index_title_format>|chosen_order_field|</index_title_format>
Thanks
Tony
Who is online
Users browsing this forum: No registered users and 4 guests