From 513c2d0fcedd0e855d049dc8896d8ee6040dd366 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Thu, 6 Jun 2019 14:10:57 +0200 Subject: [PATCH] fix squid snmp --- .../apps/squid/snmp/mode/protocolstats.pm | 23 +++++++++---------- 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/centreon-plugins/apps/squid/snmp/mode/protocolstats.pm b/centreon-plugins/apps/squid/snmp/mode/protocolstats.pm index 16df25af3..6019459df 100644 --- a/centreon-plugins/apps/squid/snmp/mode/protocolstats.pm +++ b/centreon-plugins/apps/squid/snmp/mode/protocolstats.pm @@ -45,7 +45,7 @@ sub set_counters { $self->{maps_counters_type} = [ { name => 'global_http', type => 0, , cb_prefix_output => 'prefix_http_output', skipped_code => { -10 => 1 } }, - { name => 'global_icq', type => 0, , cb_prefix_output => 'prefix_icq_output', skipped_code => { -10 => 1 } }, + { name => 'global_icp', type => 0, , cb_prefix_output => 'prefix_icp_output', skipped_code => { -10 => 1 } }, { name => 'global', type => 0, , cb_prefix_output => 'prefix_server_output', skipped_code => { -10 => 1 } } ]; @@ -90,23 +90,23 @@ sub set_counters { }, ]; - $self->{maps_counters}->{global_icq} = [ - { label => 'icq-traffic-in', set => { + $self->{maps_counters}->{global_icp} = [ + { label => 'icp-traffic-in', set => { key_values => [ { name => 'cacheIcpKbRecv', diff => 1 } ], output_template => 'traffic in : %s %s/s', per_second => 1, output_change_bytes => 2, perfdatas => [ - { label => 'icq_traffic_in', value => 'cacheIcpKbRecv_per_second', template => '%s', + { label => 'icp_traffic_in', value => 'cacheIcpKbRecv_per_second', template => '%s', min => 0, unit => 'b/s' }, ], } }, - { label => 'icq-traffic-out', set => { + { label => 'icp-traffic-out', set => { key_values => [ { name => 'cacheIcpKbSent', diff => 1 } ], output_template => 'traffic Out : %s %s/s', per_second => 1, output_change_bytes => 2, perfdatas => [ - { label => 'icq_traffic_out', value => 'cacheIcpKbSent_per_second', template => '%s', + { label => 'icp_traffic_out', value => 'cacheIcpKbSent_per_second', template => '%s', min => 0, unit => 'b/s' }, ], } @@ -152,10 +152,10 @@ sub prefix_http_output { return "HTTP "; } -sub prefix_icq_output { +sub prefix_icp_output { my ($self, %options) = @_; - return "ICQ "; + return "ICP "; } sub prefix_server_output { @@ -170,9 +170,8 @@ sub new { bless $self, $class; $self->{version} = '1.0'; - $options{options}->add_options(arguments => - { - }); + $options{options}->add_options(arguments => { + }); return $self; } @@ -203,7 +202,7 @@ sub manage_selection { cacheHttpInKb => $snmp_result->{$oids{cacheHttpInKb}} * 1024 * 8, cacheHttpOutKb => $snmp_result->{$oids{cacheHttpOutKb}} * 1024 * 8, }; - $self->{global_icq} = { + $self->{global_icp} = { cacheIcpKbSent => $snmp_result->{$oids{cacheIcpKbSent}} * 1024 * 8, cacheIcpKbRecv => $snmp_result->{$oids{cacheIcpKbRecv}} * 1024 * 8, };