Hello,
I’m facing an issue with a discovery rule in Centreon where the inclusion filter does not seem to work as expected.
Context:
-
I created a discovery rule to include only interfaces with names containing StackPort.
-
My inclusion rule is configured as:
-
Macro:
$name$ -
Regexp:
^StackPort*
-

Expected behavior:
Only interfaces like StackPort1, StackPort2, etc. should be discovered.
Actual behavior:
When I run the discovery command manually, I can see interfaces such as:
'StackPort2' [speed = 160000][status = up][id = 124][type = propVirtual]
However, when I perform a manual scan from the Centreon UI, the inclusion filter does not seem to apply, and other interfaces are still discovered.

Command used to list interfaces in CLI :
sudo -u centreon-engine /usr/lib/centreon/plugins/centreon_cisco_standard_snmp.pl --plugin='network::cisco::standard::snmp::plugin' --mode=list-interfaces --hostname='10.0.0.8' --snmp-version='2c' --snmp-community='public' --disco-show
<?xml version="1.0" encoding="utf-8"?>
<data>
<label interfaceid="1" name="Gi0/0" status="down" total="1000" type="ethernetCsmacd"/>
<label interfaceid="10" name="Gi1/0/2" status="up" total="1000" type="ethernetCsmacd"/>
<label interfaceid="100" name="Gi2/0/33" status="up" total="1000" type="ethernetCsmacd"/>
<label interfaceid="101" name="Gi2/0/34" status="down" total="1000" type="ethernetCsmacd"/>
<label interfaceid="102" name="Gi2/0/35" status="down" total="1000" type="ethernetCsmacd"/>
<label interfaceid="103" name="Gi2/0/36" status="down" total="1000" type="ethernetCsmacd"/>
<label interfaceid="104" name="Gi2/0/37" status="down" total="1000" type="ethernetCsmacd"/>
<label interfaceid="105" name="Gi2/0/38" status="up" total="1000" type="ethernetCsmacd"/>
<label interfaceid="106" name="Gi2/0/39" status="up" total="100" type="ethernetCsmacd"/>
<label interfaceid="107" name="Gi2/0/40" status="down" total="10" type="ethernetCsmacd"/>
<label interfaceid="108" name="Gi2/0/41" status="up" total="1000" type="ethernetCsmacd"/>
<label interfaceid="109" name="Gi2/0/42" status="up" total="1000" type="ethernetCsmacd"/>
<label interfaceid="11" name="Gi1/0/3" status="down" total="1000" type="ethernetCsmacd"/>
<label interfaceid="110" name="Gi2/0/43" status="down" total="1000" type="ethernetCsmacd"/>
<label interfaceid="111" name="Gi2/0/44" status="down" total="1000" type="ethernetCsmacd"/>
<label interfaceid="112" name="Gi2/0/45" status="down" total="1000" type="ethernetCsmacd"/>
<label interfaceid="113" name="Gi2/0/46" status="up" total="1000" type="ethernetCsmacd"/>
<label interfaceid="114" name="Gi2/0/47" status="down" total="1000" type="ethernetCsmacd"/>
<label interfaceid="115" name="Gi2/0/48" status="up" total="10" type="ethernetCsmacd"/>
<label interfaceid="116" name="Gi2/1/1" status="down" total="1000" type="ethernetCsmacd"/>
<label interfaceid="117" name="Gi2/1/2" status="down" total="1000" type="ethernetCsmacd"/>
<label interfaceid="118" name="Gi2/1/3" status="down" total="1000" type="ethernetCsmacd"/>
<label interfaceid="119" name="Gi2/1/4" status="down" total="1000" type="ethernetCsmacd"/>
<label interfaceid="12" name="Gi1/0/4" status="up" total="1000" type="ethernetCsmacd"/>
<label interfaceid="120" name="Te2/1/1" status="down" total="100" type="ethernetCsmacd"/>
<label interfaceid="121" name="Te2/1/2" status="down" total="10000" type="ethernetCsmacd"/>
<label interfaceid="122" name="Te2/1/3" status="up" total="10000" type="ethernetCsmacd"/>
<label interfaceid="123" name="Te2/1/4" status="up" total="1000" type="ethernetCsmacd"/>
<label interfaceid="124" name="StackPort2" status="up" total="160000" type="propVirtual"/>
<label interfaceid="125" name="StackSub-St2-1" status="up" total="80000" type="propVirtual"/>
<label interfaceid="126" name="StackSub-St2-2" status="up" total="80000" type="propVirtual"/>
...Questions:
-
Is my regular expression
^StackPort*correct for matching interfaces likeStackPort2? -
Is there any known limitation or specific behavior with
$name$macros in inclusion rules?
Any help would be appreciated.
