Skip to main content

Hello,

 

I’m trying to use centreon plugins to match one connection on local port 4000 from one known IP address.

 

For this, I need to use “filter-ip” but I cannot manage to get it work.

 

I use the following command:

 

centreon_plugins.pl --plugin os::linux::snmp::plugin --mode tcpcon --hostname host --snmp-version 2 --snmp-community public --service='MyService,,established,4000,,,,,1:1

 

This one works, it returns one established connection:

OK: Service 'LMyService' connections: 1 - Total connections: 8

 

Then I tried to add an IP destination filter to only match my IP address. If I understand correctly, it an inverted filter to exclude everything that is not my IP address.

For the record, when using --debug, I can see the connection I’m trying to match:

.1.3.6.1.2.1.6.19.1.7.2.16.0.0.0.0.0.0.0.0.0.0.255.255.10.x.x.x.4000.2.16.0.0.0.0.0.0.0.0.0.0.255.255.10.y.y.y.54706 = 5  < this is 10.y.y.y

 

So I just tried to modify the command like this:

centreon_plugins.pl --plugin os::linux::snmp::plugin --mode tcpcon --hostname hosts --snmp-version 2 --snmp-community public --service='MyService,,established,4000,,,^(?!10.*)$,,1:1'

 

And I get 0 connection remaining… Any idea what I’m doing wrong ?

 

Best regards

Be the first to reply!

Reply