centreon-plugins icon indicating copy to clipboard operation
centreon-plugins copied to clipboard

os::linux::snmp::plugin --mode=tcpcon

Open romsworld opened this issue 6 months ago • 2 comments

Hi,

With this plugin : ./centreon_linux_snmp.pl --plugin=os::linux::snmp::plugin --mode=tcpcon

I have a problem, because rfc4022 send some data, but not corretly format. As the result is not 0, rfc4022 match, but tcp port is not detected.

If I switch rfc 1213 in first, it work.

sub build_connections { my ($self, %options) = @_;

  if ($self->get_from_rfc4022() == 0) {
      $self->get_from_rfc1213();
  }

}

As you can see, first entry is strange.. and it's tcp 10001 that interrest me.

rfc 4022

.1.3.6.1.2.1.6.19.1.7.0.0.9091.0.0.0 = 2 .1.3.6.1.2.1.6.19.1.7.0.0.10001.0.0.0 = 2 .1.3.6.1.2.1.6.19.1.7.0.0.10002.0.0.0 = 2 .1.3.6.1.2.1.6.19.1.7.0.0.47001.0.0.0 = 2 .1.3.6.1.2.1.6.19.1.7.1.4.0.0.0.0.135.1.4.0.0.0.0.0 = 2 .1.3.6.1.2.1.6.19.1.7.1.4.0.0.0.0.3389.1.4.0.0.0.0.0 = 2 .1.3.6.1.2.1.6.19.1.7.1.4.0.0.0.0.49664.1.4.0.0.0.0.0 = 2 .1.3.6.1.2.1.6.19.1.7.1.4.0.0.0.0.49665.1.4.0.0.0.0.0 = 2

rfc1213 iso.3.6.1.2.1.6.13.1.1.0.0.0.0.10001.0.0.0.0.0 = INTEGER: 2 iso.3.6.1.2.1.6.13.1.1.0.0.0.0.10002.0.0.0.0.0 = INTEGER: 2

Is it possible to force rfc1213 in script ??

romsworld avatar Aug 01 '25 13:08 romsworld

Hello :)

In the tcpcon line 95 mode:

    my $oid_tcpConnectionState = '.1.3.6.1.2.1.6.19.1.7';
    my $oid_tcpListenerProcess = '.1.3.6.1.2.1.6.20.1.4';
    my $results = $self->{snmp}->get_multiple_table(
        oids => [ 
            { oid => $oid_tcpConnectionState },
            { oid => $oid_tcpListenerProcess },
        ]
    );
    return 0 if (scalar(keys %{$results->{$oid_tcpConnectionState}}) + scalar(keys %{$results->{$oid_tcpListenerProcess}}) == 0);

From what I understand in your case the $results is empty that leads to a 0 return for get_from_rfc4022()

Is it possible to force rfc1213 in script ??

If rfc4022 fails then it try rfc1213 as you quote it:

if ($self->get_from_rfc4022() == 0) {
      $self->get_from_rfc1213();
  }

To better help you, can you provide us with the plugin command and the output with --debug option set? (you can anonymize all field that needs it)

lucie-tirand avatar Aug 21 '25 09:08 lucie-tirand

Hi, For information, I use this script to check windows server,

I would like to check tcp port 10001 for exemple.

See output with debug :

/usr/lib/centreon/plugins/centreon_linux_snmp.pl --plugin=os::linux::snmp::plugin --mode=tcpcon --hostname=192.168.2.179 --debug OK: Total connections: 54 | 'service_total'=54;;;0; 'con_closeWait'=0;;;0; 'con_synSent'=0;;;0; 'con_finWait1'=0;;;0; 'con_listen'=22;;;0; 'con_closed'=0;;;0; 'con_closing'=0;;;0; 'con_finWait2'=0;;;0; 'con_lastAck'=0;;;0; 'con_established'=54;;;0; 'con_synReceived'=0;;;0; 'con_timeWait'=0;;;0;

.1.3.6.1.2.1.6.19.1.7.0.0.445.0.0.0 = 2 .1.3.6.1.2.1.6.19.1.7.0.0.5985.0.0.0 = 2 .1.3.6.1.2.1.6.19.1.7.0.0.5986.0.0.0 = 2 .1.3.6.1.2.1.6.19.1.7.0.0.9091.0.0.0 = 2 .1.3.6.1.2.1.6.19.1.7.0.0.10001.0.0.0 = 2 .1.3.6.1.2.1.6.19.1.7.0.0.10002.0.0.0 = 2 .1.3.6.1.2.1.6.19.1.7.0.0.47001.0.0.0 = 2 .1.3.6.1.2.1.6.19.1.7.1.4.0.0.0.0.135.1.4.0.0.0.0.0 = 2 .1.3.6.1.2.1.6.19.1.7.1.4.0.0.0.0.3389.1.4.0.0.0.0.0 = 2 .1.3.6.1.2.1.6.19.1.7.1.4.0.0.0.0.49664.1.4.0.0.0.0.0 = 2 .1.3.6.1.2.1.6.19.1.7.1.4.0.0.0.0.49665.1.4.0.0.0.0.0 = 2 .1.3.6.1.2.1.6.19.1.7.1.4.0.0.0.0.49670.1.4.0.0.0.0.0 = 2 .1.3.6.1.2.1.6.19.1.7.1.4.0.0.0.0.49671.1.4.0.0.0.0.0 = 2 .1.3.6.1.2.1.6.19.1.7.1.4.0.0.0.0.49687.1.4.0.0.0.0.0 = 2 .1.3.6.1.2.1.6.19.1.7.1.4.0.0.0.0.49689.1.4.0.0.0.0.0 = 2 .1.3.6.1.2.1.6.19.1.7.1.4.0.0.0.0.49699.1.4.0.0.0.0.0 = 2 .1.3.6.1.2.1.6.19.1.7.1.4.0.0.0.0.49703.1.4.0.0.0.0.0 = 2 .1.3.6.1.2.1.6.19.1.7.1.4.0.0.0.0.49705.1.4.0.0.0.0.0 = 2 .1.3.6.1.2.1.6.19.1.7.1.4.192.168.2.179.49756.1.4.192.168.2.140.1521 = 5 .1.3.6.1.2.1.6.19.1.7.1.4.192.168.2.179.49757.1.4.192.168.2.140.1521 = 5 .1.3.6.1.2.1.6.19.1.7.1.4.192.168.2.179.49760.1.4.192.168.2.140.1521 = 5 .1.3.6.1.2.1.6.19.1.7.1.4.192.168.2.179.49772.1.4.192.168.2.140.1521 = 5 .1.3.6.1.2.1.6.19.1.7.1.4.192.168.2.179.49775.1.4.192.168.2.140.1521 = 5 .1.3.6.1.2.1.6.19.1.7.1.4.192.168.2.179.49787.1.4.192.168.2.140.1521 = 5 .1.3.6.1.2.1.6.19.1.7.1.4.192.168.2.179.49788.1.4.192.168.2.140.1521 = 5 .1.3.6.1.2.1.6.19.1.7.1.4.192.168.2.179.49789.1.4.192.168.2.140.1521 = 5 .1.3.6.1.2.1.6.19.1.7.1.4.192.168.2.179.49790.1.4.192.168.2.140.1521 = 5 .1.3.6.1.2.1.6.19.1.7.1.4.192.168.2.179.49791.1.4.192.168.2.140.1521 = 5 .1.3.6.1.2.1.6.19.1.7.1.4.192.168.2.179.49792.1.4.192.168.2.140.1521 = 5 .1.3.6.1.2.1.6.19.1.7.1.4.192.168.2.179.49793.1.4.192.168.2.140.1521 = 5 .1.3.6.1.2.1.6.19.1.7.1.4.192.168.2.179.49794.1.4.192.168.2.140.1521 = 5 .1.3.6.1.2.1.6.19.1.7.1.4.192.168.2.179.49795.1.4.192.168.2.140.1521 = 5 .1.3.6.1.2.1.6.19.1.7.1.4.192.168.2.179.49796.1.4.192.168.2.140.1521 = 5 .1.3.6.1.2.1.6.19.1.7.1.4.192.168.2.179.49797.1.4.192.168.2.140.1521 = 5 .1.3.6.1.2.1.6.19.1.7.1.4.192.168.2.179.49798.1.4.192.168.2.140.1521 = 5 .1.3.6.1.2.1.6.19.1.7.1.4.192.168.2.179.49799.1.4.192.168.2.140.1521 = 5 .1.3.6.1.2.1.6.19.1.7.1.4.192.168.2.179.49800.1.4.192.168.2.140.1521 = 5 .1.3.6.1.2.1.6.19.1.7.1.4.192.168.2.179.49801.1.4.192.168.2.140.1521 = 5 .1.3.6.1.2.1.6.19.1.7.1.4.192.168.2.179.49802.1.4.192.168.2.140.1521 = 5 .1.3.6.1.2.1.6.19.1.7.1.4.192.168.2.179.49803.1.4.192.168.2.140.1521 = 5 .1.3.6.1.2.1.6.19.1.7.1.4.192.168.2.179.49804.1.4.192.168.2.140.1521 = 5 .1.3.6.1.2.1.6.19.1.7.1.4.192.168.2.179.49805.1.4.192.168.2.140.1521 = 5 .1.3.6.1.2.1.6.19.1.7.1.4.192.168.2.179.49806.1.4.192.168.2.140.1521 = 5 .1.3.6.1.2.1.6.19.1.7.1.4.192.168.2.179.49807.1.4.192.168.2.140.1521 = 5 .1.3.6.1.2.1.6.19.1.7.1.4.192.168.2.179.49808.1.4.192.168.2.140.1521 = 5 .1.3.6.1.2.1.6.19.1.7.1.4.192.168.2.179.49809.1.4.192.168.2.140.1521 = 5 .1.3.6.1.2.1.6.19.1.7.1.4.192.168.2.179.49810.1.4.192.168.2.140.1521 = 5 .1.3.6.1.2.1.6.19.1.7.1.4.192.168.2.179.49811.1.4.192.168.2.140.1521 = 5 .1.3.6.1.2.1.6.19.1.7.1.4.192.168.2.179.49812.1.4.192.168.2.140.1521 = 5 .1.3.6.1.2.1.6.19.1.7.1.4.192.168.2.179.49813.1.4.192.168.2.140.1521 = 5 .1.3.6.1.2.1.6.19.1.7.1.4.192.168.2.179.49814.1.4.192.168.2.140.1521 = 5 .1.3.6.1.2.1.6.19.1.7.1.4.192.168.2.179.49815.1.4.192.168.2.140.1521 = 5 .1.3.6.1.2.1.6.19.1.7.1.4.192.168.2.179.49816.1.4.192.168.2.140.1521 = 5 .1.3.6.1.2.1.6.19.1.7.1.4.192.168.2.179.49817.1.4.192.168.2.140.1521 = 5 .1.3.6.1.2.1.6.19.1.7.1.4.192.168.2.179.49818.1.4.192.168.2.140.1521 = 5 .1.3.6.1.2.1.6.19.1.7.1.4.192.168.2.179.49819.1.4.192.168.2.140.1521 = 5 .1.3.6.1.2.1.6.19.1.7.1.4.192.168.2.179.49820.1.4.192.168.2.140.1521 = 5 .1.3.6.1.2.1.6.19.1.7.1.4.192.168.2.179.49821.1.4.192.168.2.140.1521 = 5 .1.3.6.1.2.1.6.19.1.7.1.4.192.168.2.179.49822.1.4.192.168.2.140.1521 = 5 .1.3.6.1.2.1.6.19.1.7.1.4.192.168.2.179.49823.1.4.192.168.2.140.1521 = 5 .1.3.6.1.2.1.6.19.1.7.1.4.192.168.2.179.49824.1.4.192.168.2.140.1521 = 5 .1.3.6.1.2.1.6.19.1.7.1.4.192.168.2.179.49825.1.4.192.168.2.140.1521 = 5 .1.3.6.1.2.1.6.19.1.7.1.4.192.168.2.179.49826.1.4.192.168.2.140.1521 = 5 .1.3.6.1.2.1.6.19.1.7.1.4.192.168.2.179.58279.1.4.192.168.2.62.445 = 5 .1.3.6.1.2.1.6.19.1.7.1.4.127.0.0.1.49776.1.4.127.0.0.1.49777 = 5 .1.3.6.1.2.1.6.19.1.7.1.4.127.0.0.1.49777.1.4.127.0.0.1.49776 = 5 .1.3.6.1.2.1.6.19.1.7.1.4.127.0.0.1.49778.1.4.127.0.0.1.49779 = 5 .1.3.6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