centreon / centreon-plugins

Collection of standard plugins to discover and gather cloud-to-edge metrics and status across your whole IT infrastructure.
https://www.centreon.com
Apache License 2.0
310 stars 274 forks source link

[network::mikrotik::snmp::plugin] Exclude intrefaces by name #2601

Closed Aleksey-Maksimov closed 3 years ago

Aleksey-Maksimov commented 3 years ago

Hello. Mikrotik routers have interfaces that we want to exclude from monitoring by the interface name mask. For example "gre *". Please tell me how to do it correctly.

# ./centreon_plugins.pl --plugin=network::mikrotik::snmp::plugin 
--mode=list-interfaces --snmp-version='2c' --snmp-community='public' --hostname='RT002'

List interfaces:
'sfp-sfpplus1' [speed = ][status = down][id = 1][type = ethernetCsmacd]
'ether8' [speed = 1000][status = up][id = 10][type = ethernetCsmacd]
'vlan5' [speed = 1000][status = up][id = 11][type = l2vlan]
'gre-es01' [speed = 10][status = up][id = 14][type = other]
'gre-es21' [speed = 10][status = up][id = 15][type = other]
'sfp-sfpplus2' [speed = ][status = down][id = 2][type = ethernetCsmacd]
'ether1' [speed = 1000][status = up][id = 3][type = ethernetCsmacd]
'ether2' [speed = ][status = down][id = 4][type = ethernetCsmacd]
'ether3' [speed = ][status = down][id = 5][type = ethernetCsmacd]
'ether4' [speed = ][status = down][id = 6][type = ethernetCsmacd]
'ether5' [speed = ][status = down][id = 7][type = ethernetCsmacd]
'ether6' [speed = ][status = down][id = 8][type = ethernetCsmacd]
'ether7' [speed = 100][status = up][id = 9][type = ethernetCsmacd]
garnier-quentin commented 3 years ago

You can use following options:

--interface='^(?!(gre-.*)$)' --name 
Aleksey-Maksimov commented 3 years ago

Thanks for the quick response. Interestingly, I tried to use the options the other way around. Like --interface --name='^(?!(gre-.*)$)' In my opinion, the description of the options is not obvious :) In any case, the issue has been resolved. Many thanks.