Fix #2069
This commit is contained in:
parent
018b64c4bc
commit
f156083866
|
@ -33,33 +33,30 @@ sub set_counters {
|
||||||
];
|
];
|
||||||
|
|
||||||
$self->{maps_counters}->{global} = [
|
$self->{maps_counters}->{global} = [
|
||||||
{ label => '1min', set => {
|
{ label => '1min', nlabel => 'cpu.utilization.1m.percentage', set => {
|
||||||
key_values => [ { name => '1min' } ],
|
key_values => [ { name => '1min' } ],
|
||||||
output_template => '1 minute : %.2f %%',
|
output_template => '1 minute: %.2f %%',
|
||||||
perfdatas => [
|
perfdatas => [
|
||||||
{ label => 'cpu_1min', value => '1min', template => '%.2f',
|
{ label => 'cpu_1min', template => '%.2f', min => 0, max => 100, unit => '%' }
|
||||||
min => 0, max => 100, unit => '%' },
|
]
|
||||||
],
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{ label => '5min', set => {
|
{ label => '5min', nlabel => 'cpu.utilization.5m.percentage', set => {
|
||||||
key_values => [ { name => '5min' } ],
|
key_values => [ { name => '5min' } ],
|
||||||
output_template => '5 minutes : %.2f %%',
|
output_template => '5 minutes: %.2f %%',
|
||||||
perfdatas => [
|
perfdatas => [
|
||||||
{ label => 'cpu_5min', value => '5min', template => '%.2f',
|
{ label => 'cpu_5min', template => '%.2f', min => 0, max => 100, unit => '%' }
|
||||||
min => 0, max => 100, unit => '%' },
|
]
|
||||||
],
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{ label => '15min', set => {
|
{ label => '15min', nlabel => 'cpu.utilization.15m.percentage', set => {
|
||||||
key_values => [ { name => '15min' } ],
|
key_values => [ { name => '15min' } ],
|
||||||
output_template => '15 minutes : %.2f %%',
|
output_template => '15 minutes: %.2f %%',
|
||||||
perfdatas => [
|
perfdatas => [
|
||||||
{ label => 'cpu_15min', value => '15min', template => '%.2f',
|
{ label => 'cpu_15min', template => '%.2f', min => 0, max => 100, unit => '%' }
|
||||||
min => 0, max => 100, unit => '%' },
|
]
|
||||||
],
|
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -74,9 +71,8 @@ sub new {
|
||||||
my $self = $class->SUPER::new(package => __PACKAGE__, %options);
|
my $self = $class->SUPER::new(package => __PACKAGE__, %options);
|
||||||
bless $self, $class;
|
bless $self, $class;
|
||||||
|
|
||||||
$options{options}->add_options(arguments =>
|
$options{options}->add_options(arguments => {
|
||||||
{
|
});
|
||||||
});
|
|
||||||
|
|
||||||
return $self;
|
return $self;
|
||||||
}
|
}
|
||||||
|
@ -92,13 +88,18 @@ sub manage_selection {
|
||||||
my $oid_wgSystemCpuUtil1 = '.1.3.6.1.4.1.3097.6.3.77.0';
|
my $oid_wgSystemCpuUtil1 = '.1.3.6.1.4.1.3097.6.3.77.0';
|
||||||
my $oid_wgSystemCpuUtil5 = '.1.3.6.1.4.1.3097.6.3.78.0';
|
my $oid_wgSystemCpuUtil5 = '.1.3.6.1.4.1.3097.6.3.78.0';
|
||||||
my $oid_wgSystemCpuUtil15 = '.1.3.6.1.4.1.3097.6.3.79.0';
|
my $oid_wgSystemCpuUtil15 = '.1.3.6.1.4.1.3097.6.3.79.0';
|
||||||
my $snmp_result = $options{snmp}->get_leef(oids => [
|
my $snmp_result = $options{snmp}->get_leef(
|
||||||
|
oids => [
|
||||||
$oid_wgSystemCpuUtil1, $oid_wgSystemCpuUtil5, $oid_wgSystemCpuUtil15
|
$oid_wgSystemCpuUtil1, $oid_wgSystemCpuUtil5, $oid_wgSystemCpuUtil15
|
||||||
], nothing_quit => 1);
|
],
|
||||||
|
nothing_quit => 1
|
||||||
|
);
|
||||||
|
|
||||||
$self->{global} = { '1min' => $snmp_result->{$oid_wgSystemCpuUtil1} / 100,
|
$self->{global} = {
|
||||||
'5min' => $snmp_result->{$oid_wgSystemCpuUtil5} / 100,
|
'1min' => $snmp_result->{$oid_wgSystemCpuUtil1} / 100,
|
||||||
'15min' => $snmp_result->{$oid_wgSystemCpuUtil15} / 100 };
|
'5min' => $snmp_result->{$oid_wgSystemCpuUtil5} / 100,
|
||||||
|
'15min' => $snmp_result->{$oid_wgSystemCpuUtil15} / 100
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
1;
|
1;
|
||||||
|
@ -114,18 +115,13 @@ Check CPU usages.
|
||||||
=item B<--filter-counters>
|
=item B<--filter-counters>
|
||||||
|
|
||||||
Only display some counters (regexp can be used).
|
Only display some counters (regexp can be used).
|
||||||
Example: --filter-counters='^(1min|5min)$'
|
Example: --filter-counters='^1min|5min$'
|
||||||
|
|
||||||
=item B<--warning-*>
|
=item B<--warning-*> B<--critical-*>
|
||||||
|
|
||||||
Threshold warning.
|
Threshold warning.
|
||||||
Can be: '1min', '5min', '15min'.
|
Can be: '1min', '5min', '15min'.
|
||||||
|
|
||||||
=item B<--critical-*>
|
|
||||||
|
|
||||||
Threshold critical.
|
|
||||||
Can be: '1min', '5min', '15min'.
|
|
||||||
|
|
||||||
=back
|
=back
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
|
@ -30,17 +30,22 @@ sub new {
|
||||||
bless $self, $class;
|
bless $self, $class;
|
||||||
|
|
||||||
$self->{version} = '1.0';
|
$self->{version} = '1.0';
|
||||||
%{$self->{modes}} = (
|
$self->{modes} = {
|
||||||
'cpu' => 'network::watchguard::snmp::mode::cpu',
|
'cpu' => 'network::watchguard::snmp::mode::cpu',
|
||||||
'hardware' => 'snmp_standard::mode::hardwaredevice',
|
'hardware' => 'snmp_standard::mode::hardwaredevice',
|
||||||
'interfaces' => 'snmp_standard::mode::interfaces',
|
'interfaces' => 'snmp_standard::mode::interfaces',
|
||||||
'ipsec-tunnel' => 'network::watchguard::snmp::mode::ipsectunnel',
|
'ipsec-tunnel' => 'network::watchguard::snmp::mode::ipsectunnel',
|
||||||
'list-interfaces' => 'snmp_standard::mode::listinterfaces',
|
'list-interfaces' => 'snmp_standard::mode::listinterfaces',
|
||||||
'list-storages' => 'snmp_standard::mode::liststorages',
|
'list-storages' => 'snmp_standard::mode::liststorages',
|
||||||
|
'load' => 'snmp_standard::mode::loadaverage',
|
||||||
|
'memory' => 'snmp_standard::mode::memory',
|
||||||
'policy-usage' => 'network::watchguard::snmp::mode::policyusage',
|
'policy-usage' => 'network::watchguard::snmp::mode::policyusage',
|
||||||
'storage' => 'snmp_standard::mode::storage',
|
'storage' => 'snmp_standard::mode::storage',
|
||||||
|
'swap' => 'snmp_standard::mode::swap',
|
||||||
'system' => 'network::watchguard::snmp::mode::system',
|
'system' => 'network::watchguard::snmp::mode::system',
|
||||||
);
|
'time' => 'snmp_standard::mode::ntp',
|
||||||
|
'uptime' => 'snmp_standard::mode::uptime'
|
||||||
|
};
|
||||||
|
|
||||||
return $self;
|
return $self;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue