mirror of
https://github.com/centreon/centreon-plugins.git
synced 2025-07-25 22:55:15 +02:00
Fix #2012
This commit is contained in:
parent
a373c63f29
commit
e588cd63da
@ -33,7 +33,7 @@ sub new {
|
|||||||
$options{options}->add_options(arguments => {
|
$options{options}->add_options(arguments => {
|
||||||
'warning:s' => { name => 'warning' },
|
'warning:s' => { name => 'warning' },
|
||||||
'critical:s' => { name => 'critical' },
|
'critical:s' => { name => 'critical' },
|
||||||
'units:s' => { name => 'units', default => 'absolute' },
|
'units:s' => { name => 'units', default => 'absolute' }
|
||||||
});
|
});
|
||||||
|
|
||||||
return $self;
|
return $self;
|
||||||
@ -93,6 +93,7 @@ sub run {
|
|||||||
);
|
);
|
||||||
$self->{output}->perfdata_add(
|
$self->{output}->perfdata_add(
|
||||||
label => 'connections', unit => 'con',
|
label => 'connections', unit => 'con',
|
||||||
|
nlabel => 'connections.active.count',
|
||||||
value => $result->{$oid_fwNumCom},
|
value => $result->{$oid_fwNumCom},
|
||||||
warning => $self->{perfdata}->get_perfdata_for_output(label => 'warning', %total_options),
|
warning => $self->{perfdata}->get_perfdata_for_output(label => 'warning', %total_options),
|
||||||
critical => $self->{perfdata}->get_perfdata_for_output(label => 'critical', %total_options),
|
critical => $self->{perfdata}->get_perfdata_for_output(label => 'critical', %total_options),
|
||||||
|
@ -46,38 +46,38 @@ sub set_counters {
|
|||||||
|
|
||||||
$self->{maps_counters_type} = [
|
$self->{maps_counters_type} = [
|
||||||
{ name => 'memory', type => 0, cb_prefix_output => 'prefix_memory_output' },
|
{ name => 'memory', type => 0, cb_prefix_output => 'prefix_memory_output' },
|
||||||
{ name => 'swap', type => 0, cb_prefix_output => 'prefix_swap_output' },
|
{ name => 'swap', type => 0, cb_prefix_output => 'prefix_swap_output', skipped_code => { -10 => 1 } },
|
||||||
{ name => 'malloc', type => 0, skipped_code => { -10 => 1 } },
|
{ name => 'malloc', type => 0, skipped_code => { -10 => 1 } },
|
||||||
];
|
];
|
||||||
|
|
||||||
$self->{maps_counters}->{memory} = [
|
$self->{maps_counters}->{memory} = [
|
||||||
{ label => 'memory', set => {
|
{ label => 'memory', nlabel => 'memory.usage.bytes', set => {
|
||||||
key_values => [ { name => 'prct_used'}, { name => 'used' }, { name => 'free' }, { name => 'total' } ],
|
key_values => [ { name => 'prct_used'}, { name => 'used' }, { name => 'free' }, { name => 'total' } ],
|
||||||
closure_custom_output => $self->can('custom_usage_output'),
|
closure_custom_output => $self->can('custom_usage_output'),
|
||||||
threshold_use => 'prct_used',
|
threshold_use => 'prct_used',
|
||||||
perfdatas => [
|
perfdatas => [
|
||||||
{ label => 'memory', value => 'used', template => '%.2f', threshold_total => 'total', cast_int => 1,
|
{ label => 'memory', value => 'used', template => '%s', threshold_total => 'total', cast_int => 1,
|
||||||
min => 0, max => 'total', unit => 'B' },
|
min => 0, max => 'total', unit => 'B' }
|
||||||
],
|
]
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
$self->{maps_counters}->{swap} = [
|
$self->{maps_counters}->{swap} = [
|
||||||
{ label => 'swap', set => {
|
{ label => 'swap', nlabel => 'swap.usage.bytes', set => {
|
||||||
key_values => [ { name => 'prct_used' }, { name => 'used' }, { name => 'free' }, { name => 'total' } ],
|
key_values => [ { name => 'prct_used' }, { name => 'used' }, { name => 'free' }, { name => 'total' } ],
|
||||||
closure_custom_output => $self->can('custom_usage_output'),
|
closure_custom_output => $self->can('custom_usage_output'),
|
||||||
threshold_use => 'prct_used',
|
threshold_use => 'prct_used',
|
||||||
perfdatas => [
|
perfdatas => [
|
||||||
{ label => 'swap', value => 'used', template => '%.2f', threshold_total => 'total', cast_int => 1,
|
{ label => 'swap', value => 'used', template => '%s', threshold_total => 'total', cast_int => 1,
|
||||||
min => 0, max => 'total', unit => 'B' },
|
min => 0, max => 'total', unit => 'B' }
|
||||||
],
|
]
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
$self->{maps_counters}->{malloc} = [
|
$self->{maps_counters}->{malloc} = [
|
||||||
{ label => 'failed-malloc', set => {
|
{ label => 'failed-malloc', nlabel => 'memory.allocations.failed.persecond', set => {
|
||||||
key_values => [ { name => 'failed_mallocs', per_second => 1 } ],
|
key_values => [ { name => 'failed_mallocs', per_second => 1 } ],
|
||||||
output_template => 'Failed memory allocations %.2f/s',
|
output_template => 'Failed memory allocations %.2f/s',
|
||||||
perfdatas => [
|
perfdatas => [
|
||||||
@ -165,17 +165,12 @@ Check memory, swap usage and failed memory allocations per sec
|
|||||||
=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='^(failed-malloc)$'
|
Example: --filter-counters='failed-malloc'
|
||||||
|
|
||||||
=item B<--warning-*>
|
=item B<--warning-*> B<--critical-*>
|
||||||
|
|
||||||
Threshold warning.
|
Thresholds.
|
||||||
Can be: 'memory', 'swap', 'failed-malloc'
|
Can be: 'memory' (%), 'swap' (%), 'failed-malloc'
|
||||||
|
|
||||||
=item B<--critical-*>
|
|
||||||
|
|
||||||
Threshold critical.
|
|
||||||
Can be: 'memory', 'swap', 'failed-malloc'
|
|
||||||
|
|
||||||
=back
|
=back
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@ sub new {
|
|||||||
bless $self, $class;
|
bless $self, $class;
|
||||||
|
|
||||||
$self->{version} = '0.5';
|
$self->{version} = '0.5';
|
||||||
%{$self->{modes}} = (
|
$self->{modes} = {
|
||||||
'connections' => 'network::checkpoint::snmp::mode::connections',
|
'connections' => 'network::checkpoint::snmp::mode::connections',
|
||||||
'cpu' => 'network::checkpoint::snmp::mode::cpu',
|
'cpu' => 'network::checkpoint::snmp::mode::cpu',
|
||||||
'disk' => 'network::checkpoint::snmp::mode::disk',
|
'disk' => 'network::checkpoint::snmp::mode::disk',
|
||||||
@ -44,7 +44,7 @@ sub new {
|
|||||||
'vpn-status' => 'network::checkpoint::snmp::mode::vpnstatus',
|
'vpn-status' => 'network::checkpoint::snmp::mode::vpnstatus',
|
||||||
'vrrp-status' => 'snmp_standard::mode::vrrp',
|
'vrrp-status' => 'snmp_standard::mode::vrrp',
|
||||||
'vsx' => 'network::checkpoint::snmp::mode::vsx'
|
'vsx' => 'network::checkpoint::snmp::mode::vsx'
|
||||||
);
|
};
|
||||||
|
|
||||||
return $self;
|
return $self;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user