typo
This commit is contained in:
parent
c8fbdb4f48
commit
550e28324d
|
@ -29,8 +29,7 @@ use centreon::plugins::templates::catalog_functions qw(catalog_status_threshold)
|
||||||
sub custom_status_output {
|
sub custom_status_output {
|
||||||
my ($self, %options) = @_;
|
my ($self, %options) = @_;
|
||||||
|
|
||||||
my $msg = 'status ' . $self->{result_values}->{status};
|
return 'status ' . $self->{result_values}->{status};
|
||||||
return $msg;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
sub custom_status_calc {
|
sub custom_status_calc {
|
||||||
|
@ -45,7 +44,7 @@ sub set_counters {
|
||||||
|
|
||||||
$self->{maps_counters_type} = [
|
$self->{maps_counters_type} = [
|
||||||
{ name => 'global', type => 0, skipped_code => { -10 => 1 } },
|
{ name => 'global', type => 0, skipped_code => { -10 => 1 } },
|
||||||
{ name => 'host', type => 1, cb_prefix_output => 'prefix_host_output', message_multiple => 'All ESX Hosts are ok' },
|
{ name => 'host', type => 1, cb_prefix_output => 'prefix_host_output', message_multiple => 'All ESX Hosts are ok' }
|
||||||
];
|
];
|
||||||
|
|
||||||
$self->{maps_counters}->{global} = [
|
$self->{maps_counters}->{global} = [
|
||||||
|
@ -54,8 +53,8 @@ sub set_counters {
|
||||||
output_template => '%s VM(s) poweredon',
|
output_template => '%s VM(s) poweredon',
|
||||||
perfdatas => [
|
perfdatas => [
|
||||||
{ label => 'poweredon', value => 'poweredon_absolute', template => '%s',
|
{ label => 'poweredon', value => 'poweredon_absolute', template => '%s',
|
||||||
min => 0, max => 'total_absolute' },
|
min => 0, max => 'total_absolute' }
|
||||||
],
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{ label => 'total-off', nlabel => 'host.vm.poweredoff.current.count', set => {
|
{ label => 'total-off', nlabel => 'host.vm.poweredoff.current.count', set => {
|
||||||
|
@ -63,8 +62,8 @@ sub set_counters {
|
||||||
output_template => '%s VM(s) poweredoff',
|
output_template => '%s VM(s) poweredoff',
|
||||||
perfdatas => [
|
perfdatas => [
|
||||||
{ label => 'poweredoff', value => 'poweredoff_absolute', template => '%s',
|
{ label => 'poweredoff', value => 'poweredoff_absolute', template => '%s',
|
||||||
min => 0, max => 'total_absolute' },
|
min => 0, max => 'total_absolute' }
|
||||||
],
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{ label => 'total-suspended', nlabel => 'host.vm.suspended.current.count', set => {
|
{ label => 'total-suspended', nlabel => 'host.vm.suspended.current.count', set => {
|
||||||
|
@ -72,8 +71,8 @@ sub set_counters {
|
||||||
output_template => '%s VM(s) suspended',
|
output_template => '%s VM(s) suspended',
|
||||||
perfdatas => [
|
perfdatas => [
|
||||||
{ label => 'suspended', value => 'suspended_absolute', template => '%s',
|
{ label => 'suspended', value => 'suspended_absolute', template => '%s',
|
||||||
min => 0, max => 'total_absolute' },
|
min => 0, max => 'total_absolute' }
|
||||||
],
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
@ -84,7 +83,7 @@ sub set_counters {
|
||||||
closure_custom_calc => $self->can('custom_status_calc'),
|
closure_custom_calc => $self->can('custom_status_calc'),
|
||||||
closure_custom_output => $self->can('custom_status_output'),
|
closure_custom_output => $self->can('custom_status_output'),
|
||||||
closure_custom_perfdata => sub { return 0; },
|
closure_custom_perfdata => sub { return 0; },
|
||||||
closure_custom_threshold_check => \&catalog_status_threshold,
|
closure_custom_threshold_check => \&catalog_status_threshold
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{ label => 'on', nlabel => 'host.vm.poweredon.current.count', set => {
|
{ label => 'on', nlabel => 'host.vm.poweredon.current.count', set => {
|
||||||
|
@ -92,8 +91,8 @@ sub set_counters {
|
||||||
output_template => '%s VM(s) poweredon',
|
output_template => '%s VM(s) poweredon',
|
||||||
perfdatas => [
|
perfdatas => [
|
||||||
{ label => 'poweredon', value => 'poweredon_absolute', template => '%s',
|
{ label => 'poweredon', value => 'poweredon_absolute', template => '%s',
|
||||||
min => 0, max => 'total_absolute', label_extra_instance => 1 },
|
min => 0, max => 'total_absolute', label_extra_instance => 1 }
|
||||||
],
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{ label => 'off', nlabel => 'host.vm.poweredoff.current.count', set => {
|
{ label => 'off', nlabel => 'host.vm.poweredoff.current.count', set => {
|
||||||
|
@ -101,8 +100,8 @@ sub set_counters {
|
||||||
output_template => '%s VM(s) poweredoff',
|
output_template => '%s VM(s) poweredoff',
|
||||||
perfdatas => [
|
perfdatas => [
|
||||||
{ label => 'poweredoff', value => 'poweredoff_absolute', template => '%s',
|
{ label => 'poweredoff', value => 'poweredoff_absolute', template => '%s',
|
||||||
min => 0, max => 'total_absolute', label_extra_instance => 1 },
|
min => 0, max => 'total_absolute', label_extra_instance => 1 }
|
||||||
],
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{ label => 'suspended', nlabel => 'host.vm.suspended.current.count', set => {
|
{ label => 'suspended', nlabel => 'host.vm.suspended.current.count', set => {
|
||||||
|
@ -110,10 +109,10 @@ sub set_counters {
|
||||||
output_template => '%s VM(s) suspended',
|
output_template => '%s VM(s) suspended',
|
||||||
perfdatas => [
|
perfdatas => [
|
||||||
{ label => 'suspended', value => 'suspended_absolute', template => '%s',
|
{ label => 'suspended', value => 'suspended_absolute', template => '%s',
|
||||||
min => 0, max => 'total_absolute', label_extra_instance => 1 },
|
min => 0, max => 'total_absolute', label_extra_instance => 1 }
|
||||||
],
|
]
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -153,8 +152,10 @@ sub manage_selection {
|
||||||
|
|
||||||
$self->{global} = { poweredon => 0, poweredoff => 0, suspended => 0, total => 0 };
|
$self->{global} = { poweredon => 0, poweredoff => 0, suspended => 0, total => 0 };
|
||||||
$self->{host} = {};
|
$self->{host} = {};
|
||||||
my $response = $options{custom}->execute(params => $self->{option_results},
|
my $response = $options{custom}->execute(
|
||||||
command => 'countvmhost');
|
params => $self->{option_results},
|
||||||
|
command => 'countvmhost'
|
||||||
|
);
|
||||||
|
|
||||||
foreach my $host_id (keys %{$response->{data}}) {
|
foreach my $host_id (keys %{$response->{data}}) {
|
||||||
my $host_name = $response->{data}->{$host_id}->{name};
|
my $host_name = $response->{data}->{$host_id}->{name};
|
||||||
|
|
Loading…
Reference in New Issue