enh(veeam): create new perfdata (#3004)
This commit is contained in:
parent
f3518f4046
commit
184f9d6075
|
@ -26,7 +26,7 @@ use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
use centreon::common::powershell::veeam::jobstatus;
|
use centreon::common::powershell::veeam::jobstatus;
|
||||||
use apps::backup::veeam::local::mode::resources::types qw($job_type $job_result);
|
use apps::backup::veeam::local::mode::resources::types qw($job_type $job_result);
|
||||||
use centreon::plugins::templates::catalog_functions qw(catalog_status_threshold catalog_status_calc);
|
use centreon::plugins::templates::catalog_functions qw(catalog_status_threshold);
|
||||||
use centreon::plugins::misc;
|
use centreon::plugins::misc;
|
||||||
use JSON::XS;
|
use JSON::XS;
|
||||||
|
|
||||||
|
@ -65,7 +65,7 @@ sub set_counters {
|
||||||
];
|
];
|
||||||
|
|
||||||
$self->{maps_counters}->{global} = [
|
$self->{maps_counters}->{global} = [
|
||||||
{ label => 'total', set => {
|
{ label => 'total', nlabel => 'jobs.total.count', set => {
|
||||||
key_values => [ { name => 'total' } ],
|
key_values => [ { name => 'total' } ],
|
||||||
output_template => 'Total Jobs : %s',
|
output_template => 'Total Jobs : %s',
|
||||||
perfdatas => [
|
perfdatas => [
|
||||||
|
@ -78,7 +78,6 @@ sub set_counters {
|
||||||
$self->{maps_counters}->{job} = [
|
$self->{maps_counters}->{job} = [
|
||||||
{ label => 'status', threshold => 0, set => {
|
{ label => 'status', threshold => 0, set => {
|
||||||
key_values => [ { name => 'status' }, { name => 'display' }, { name => 'type' }, { name => 'is_running' } ],
|
key_values => [ { name => 'status' }, { name => 'display' }, { name => 'type' }, { name => 'is_running' } ],
|
||||||
closure_custom_calc => \&catalog_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
|
||||||
|
|
|
@ -26,7 +26,7 @@ use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
use centreon::common::powershell::veeam::tapejobs;
|
use centreon::common::powershell::veeam::tapejobs;
|
||||||
use apps::backup::veeam::local::mode::resources::types qw($job_tape_type $job_tape_result $job_tape_state);
|
use apps::backup::veeam::local::mode::resources::types qw($job_tape_type $job_tape_result $job_tape_state);
|
||||||
use centreon::plugins::templates::catalog_functions qw(catalog_status_threshold);
|
use centreon::plugins::templates::catalog_functions qw(catalog_status_threshold_ng);
|
||||||
use centreon::plugins::misc;
|
use centreon::plugins::misc;
|
||||||
use JSON::XS;
|
use JSON::XS;
|
||||||
|
|
||||||
|
@ -41,6 +41,12 @@ sub custom_status_output {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub prefix_job_output {
|
||||||
|
my ($self, %options) = @_;
|
||||||
|
|
||||||
|
return "Tape job '" . $options{instance_value}->{display} . "' ";
|
||||||
|
}
|
||||||
|
|
||||||
sub set_counters {
|
sub set_counters {
|
||||||
my ($self, %options) = @_;
|
my ($self, %options) = @_;
|
||||||
|
|
||||||
|
@ -61,7 +67,7 @@ sub set_counters {
|
||||||
];
|
];
|
||||||
|
|
||||||
$self->{maps_counters}->{job} = [
|
$self->{maps_counters}->{job} = [
|
||||||
{ label => 'status', threshold => 0, set => {
|
{ label => 'status', type => 2, critical => '%{enabled} == 1 and not %{last_result} =~ /Success|None/i', set => {
|
||||||
key_values => [
|
key_values => [
|
||||||
{ name => 'display' }, { name => 'enabled' },
|
{ name => 'display' }, { name => 'enabled' },
|
||||||
{ name => 'type' }, { name => 'last_result' },
|
{ name => 'type' }, { name => 'last_result' },
|
||||||
|
@ -69,7 +75,7 @@ sub set_counters {
|
||||||
],
|
],
|
||||||
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_ng
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
@ -89,28 +95,12 @@ sub new {
|
||||||
'ps-exec-only' => { name => 'ps_exec_only' },
|
'ps-exec-only' => { name => 'ps_exec_only' },
|
||||||
'ps-display' => { name => 'ps_display' },
|
'ps-display' => { name => 'ps_display' },
|
||||||
'filter-name:s' => { name => 'filter_name' },
|
'filter-name:s' => { name => 'filter_name' },
|
||||||
'filter-type:s' => { name => 'filter_type' },
|
'filter-type:s' => { name => 'filter_type' }
|
||||||
'unknown-status:s' => { name => 'unknown_status', default => '' },
|
|
||||||
'warning-status:s' => { name => 'warning_status', default => '' },
|
|
||||||
'critical-status:s' => { name => 'critical_status', default => '%{enabled} == 1 and not %{last_result} =~ /Success|None/i' }
|
|
||||||
});
|
});
|
||||||
|
|
||||||
return $self;
|
return $self;
|
||||||
}
|
}
|
||||||
|
|
||||||
sub check_options {
|
|
||||||
my ($self, %options) = @_;
|
|
||||||
$self->SUPER::check_options(%options);
|
|
||||||
|
|
||||||
$self->change_macros(macros => ['unknown_status', 'warning_status', 'critical_status']);
|
|
||||||
}
|
|
||||||
|
|
||||||
sub prefix_job_output {
|
|
||||||
my ($self, %options) = @_;
|
|
||||||
|
|
||||||
return "Tape job '" . $options{instance_value}->{display} . "' ";
|
|
||||||
}
|
|
||||||
|
|
||||||
sub manage_selection {
|
sub manage_selection {
|
||||||
my ($self, %options) = @_;
|
my ($self, %options) = @_;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue