Fix #1446
This commit is contained in:
parent
222e784221
commit
f78273797c
|
@ -91,6 +91,7 @@ sub custom_dcmetrics_perfdata {
|
||||||
if (scalar(keys %{$self->{instance_mode}->{datacenter}}) > 1) {
|
if (scalar(keys %{$self->{instance_mode}->{datacenter}}) > 1) {
|
||||||
$extra_label .= '_' . $self->{result_values}->{name};
|
$extra_label .= '_' . $self->{result_values}->{name};
|
||||||
}
|
}
|
||||||
|
|
||||||
$self->{output}->perfdata_add(label => 'alarm_' . $self->{result_values}->{label_ref} . $extra_label,
|
$self->{output}->perfdata_add(label => 'alarm_' . $self->{result_values}->{label_ref} . $extra_label,
|
||||||
value => $self->{result_values}->{alarm_value},
|
value => $self->{result_values}->{alarm_value},
|
||||||
min => 0);
|
min => 0);
|
||||||
|
@ -153,6 +154,7 @@ sub set_counters {
|
||||||
{ label => 'alarm-warning', threshold => 0, set => {
|
{ label => 'alarm-warning', threshold => 0, set => {
|
||||||
key_values => [ { name => 'name' } ],
|
key_values => [ { name => 'name' } ],
|
||||||
output_template => '',
|
output_template => '',
|
||||||
|
closure_custom_threshold_check => sub { return 'ok' },
|
||||||
closure_custom_calc => $self->can('custom_dcmetrics_calc'), closure_custom_calc_extra_options => { label_ref => 'warning' },
|
closure_custom_calc => $self->can('custom_dcmetrics_calc'), closure_custom_calc_extra_options => { label_ref => 'warning' },
|
||||||
closure_custom_perfdata => $self->can('custom_dcmetrics_perfdata'),
|
closure_custom_perfdata => $self->can('custom_dcmetrics_perfdata'),
|
||||||
}
|
}
|
||||||
|
@ -160,6 +162,7 @@ sub set_counters {
|
||||||
{ label => 'alarm-critical', threshold => 0, set => {
|
{ label => 'alarm-critical', threshold => 0, set => {
|
||||||
key_values => [ { name => 'name' } ],
|
key_values => [ { name => 'name' } ],
|
||||||
output_template => '',
|
output_template => '',
|
||||||
|
closure_custom_threshold_check => sub { return 'ok' },
|
||||||
closure_custom_calc => $self->can('custom_dcmetrics_calc'), closure_custom_calc_extra_options => { label_ref => 'critical' },
|
closure_custom_calc => $self->can('custom_dcmetrics_calc'), closure_custom_calc_extra_options => { label_ref => 'critical' },
|
||||||
closure_custom_perfdata => $self->can('custom_dcmetrics_perfdata'),
|
closure_custom_perfdata => $self->can('custom_dcmetrics_perfdata'),
|
||||||
}
|
}
|
||||||
|
@ -192,8 +195,7 @@ sub new {
|
||||||
bless $self, $class;
|
bless $self, $class;
|
||||||
|
|
||||||
$self->{version} = '1.0';
|
$self->{version} = '1.0';
|
||||||
$options{options}->add_options(arguments =>
|
$options{options}->add_options(arguments => {
|
||||||
{
|
|
||||||
"datacenter:s" => { name => 'datacenter' },
|
"datacenter:s" => { name => 'datacenter' },
|
||||||
"filter" => { name => 'filter' },
|
"filter" => { name => 'filter' },
|
||||||
"filter-time:s" => { name => 'filter_time', },
|
"filter-time:s" => { name => 'filter_time', },
|
||||||
|
|
Loading…
Reference in New Issue