fix squid snmp

This commit is contained in:
garnier-quentin 2019-06-06 14:10:57 +02:00
parent d6f1925a3d
commit 8289fb146e
1 changed files with 11 additions and 12 deletions

View File

@ -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,
};