Configuring SNMP interface filters
You can configure one or more interface filters per device type.
About this task
To configure one or more interface filters, complete the following steps:
Procedure
- Ensure that the Entity agent is enabled. You can enable the Entity agent in the Discovery Configuration GUI.
-
Back up and edit the following file:
NCHOME/etc/precision/DiscoSnmpHelperFilters.DOMAIN_NAME.cfg
-
Specify an insert in the
snmpHelper.instanceFilter
table. You can use the examples given later in this procedure or copy another example insert from this documentation. -
Give this filter a name. Locate the value of
m_FilterName
and give the filter a descriptive name, enclosed in double quotes. -
Configure which devices should have this interface filter applied to them by
defining a device filter. Locate the value of
m_DeviceFilter
and define a filter, enclosed in double quotes. You can use any Object Identifiers (OIDs) to construct the filter. Use Object Query Language (OQL) syntax.The filter must be in the following form:
For example, the following are all valid filters:mibVariableName expression values
[ optional_Boolean_operator expression optional_Boolean_operator .. ]// Apply the interface filter to only a specific type of device sysObjectID = '1.3.6.1.4.1.4874.1.1.1.1.3'
// More complex example of the above sysObjectID = '1.3.6.1.4.1.4874.1.1.1.1.3' OR sysDescr LIKE 'ERX-1440'
// Apply the interface filter only to devices in certain locations sysLocation in ( 'location1', 'location2' ) //Apply the interface filter to all types of device. sysObjectID != '' -
Define the SNMP interface filter expression to be applied to the MIB tables.
Only rows that match this filter, that is, for which this expression evaluates
true, are retrieved. Locate the value of
m_InstanceFilter
and define a filter, enclosed in double quotes. You can use any Object Identifiers (OIDs) to construct the filter. Use Object Query Language (OQL) syntax. You can define more than one interface filter per named filter.The filter must be in the following form:
For example, the following are all valid filters:mibVariableName expression values
[ optional_Boolean_operator expression optional_Boolean_operator .. ]// Only interfaces with names like this are returned ifName like 'Gi0'
// This filter is against 2 distinct tables (ifTable and ifXTable)
with the requirement that these share a common index (ifIndex) ifName like 'Gi0' or ifDescr like 'FastEthernet' // Filter out interfaces of these types ifType not in ( 1, 53, 166 ) - Optional:
If you want to filter out information that relates to the same interface in
related MIB tables that are not explicitly defined with the same index, specify
which tables to include using a dependent filter. Copy and
edit a default insert into the
snmpFilter.dependentInstances
table from the NCHOME/etc/precision/DiscoSnmpHelperFilters.DOMAIN_NAME.cfg file or copy an example insert from this documentation.The syntax of the filter is
where MIB_variable_name must exist in MIB_table, and a filter on MIB_table has been defined in the snmpHelper.instanceFilter table.MIB_variable_name in
(eval(list_type,'&MIB_table.MIB_entry')) -
Run the following command to instruct the SNMP helper, ncp_dh_snmp, to re-read
its configuration files:
kill -HUP PID
- You can configure more than one SNMP interface filter in the NCHOME/etc/precision/DiscoSnmpHelperFilters.DOMAIN_NAME.cfg file. If more than one interface filter is configured, a table row that matches any filter is retrieved.
-
If one or more interface filters are configured, ensure that the the
RaiseAlertsForUnknownInterfaces
property in the NCHOME/etc/precision/NcPollerSchema.cfg file is set to0
. This setting ensures that alerts are not raised against interfaces that were not discovered, for example, because they were filtered out of the discovery by interface filters.
Example simple interface filter
The following example retrieves information for interfaces with a name like "Gi0" on a specific kind of device.
insert into snmpHelper.instanceFilter
(
m_FilterName,
m_DeviceFilter,
m_InstanceFilter
)
values
(
"TESTFILTER",
"sysObjectID = '1.3.6.1.4.1.4874.1.1.1.1.3' OR sysDescr LIKE 'ERX-1440'",
"ifName like 'Gi0'"
);