11#
2- # Copyright 2024 Centreon (http://www.centreon.com/)
2+ # Copyright 2026-Present Centreon (http://www.centreon.com/)
33#
44# Centreon is a full-fledged industry-strength solution that meets
55# the needs in IT infrastructure and application monitoring for
@@ -27,6 +27,7 @@ use warnings;
2727use centreon::common::powershell::backupexec::jobs;
2828use apps::backup::backupexec::local ::mode::resources::types qw( $job_status $job_substatus $job_type) ;
2929use centreon::plugins::templates::catalog_functions qw( catalog_status_threshold_ng) ;
30+ use centreon::plugins::constants qw( :values :counters) ;
3031use centreon::plugins::misc;
3132use JSON::XS;
3233
@@ -57,9 +58,9 @@ sub custom_long_calc {
5758 $self -> {result_values }-> {type } = $options {new_datas }-> {$self -> {instance } . ' _type' };
5859 $self -> {result_values }-> {isActive } = $options {new_datas }-> {$self -> {instance } . ' _isActive' };
5960
60- return -11 if ($self -> {result_values }-> {isActive } != 1);
61+ return NOT_PROCESSED if ($self -> {result_values }-> {isActive } != 1);
6162
62- return 0 ;
63+ return RUN_OK ;
6364}
6465
6566sub prefix_job_output {
@@ -72,8 +73,8 @@ sub set_counters {
7273 my ($self , %options ) = @_ ;
7374
7475 $self -> {maps_counters_type } = [
75- { name => ' global' , type => 0 },
76- { name => ' jobs' , type => 1 , cb_prefix_output => ' prefix_job_output' , message_multiple => ' All jobs are ok' , skipped_code => { - 11 => 1, - 10 => 1 } }
76+ { name => ' global' , type => COUNTER_TYPE_GLOBAL },
77+ { name => ' jobs' , type => COUNTER_TYPE_INSTANCE , cb_prefix_output => ' prefix_job_output' , message_multiple => ' All jobs are ok' , skipped_code => { NOT_PROCESSED() => 1, NO_VALUE() => 1 } }
7778 ];
7879
7980 $self -> {maps_counters }-> {global } = [
@@ -88,7 +89,7 @@ sub set_counters {
8889 ];
8990
9091 $self -> {maps_counters }-> {jobs } = [
91- { label => ' status' , type => 2 , critical_default => ' not %{status} =~ /succeeded/i' , set => {
92+ { label => ' status' , type => COUNTER_KIND_TEXT , critical_default => ' not %{status} =~ /succeeded/i' , set => {
9293 key_values => [
9394 { name => ' name' }, { name => ' type' },
9495 { name => ' status' }, { name => ' subStatus' },
@@ -99,7 +100,7 @@ sub set_counters {
99100 closure_custom_threshold_check => \&catalog_status_threshold_ng
100101 }
101102 },
102- { label => ' long' , type => 2 , set => {
103+ { label => ' long' , type => COUNTER_KIND_TEXT , set => {
103104 key_values => [
104105 { name => ' name' }, { name => ' type' },
105106 { name => ' status' }, { name => ' subStatus' },
0 commit comments