mirror of
https://github.com/centreon/centreon-plugins.git
synced 2025-07-28 08:04:36 +02:00
fix(veeam): patch edge case on empty JSON with Veeam tape-jobs mode (#3280)
This commit is contained in:
parent
5f6505004c
commit
c16166a868
@ -161,6 +161,11 @@ sub manage_selection {
|
|||||||
$self->{output}->output_add(long_msg => "skipping job '" . $job->{name} . "': no matching filter type.", debug => 1);
|
$self->{output}->output_add(long_msg => "skipping job '" . $job->{name} . "': no matching filter type.", debug => 1);
|
||||||
next;
|
next;
|
||||||
}
|
}
|
||||||
|
# Sometimes we may get such JSON: [{"lastResult":null,"name":null,"lastState":null,"type":null,"enabled":null}]
|
||||||
|
if (!defined($job->{name})) {
|
||||||
|
$self->{output}->output_add(long_msg => "skipping nulled job (empty json)", debug => 1);
|
||||||
|
next;
|
||||||
|
}
|
||||||
|
|
||||||
$self->{job}->{ $job->{name} } = {
|
$self->{job}->{ $job->{name} } = {
|
||||||
display => $job->{name},
|
display => $job->{name},
|
||||||
@ -170,6 +175,11 @@ sub manage_selection {
|
|||||||
last_state => $job_tape_state->{ $job->{lastState} }
|
last_state => $job_tape_state->{ $job->{lastState} }
|
||||||
};
|
};
|
||||||
$self->{global}->{total}++;
|
$self->{global}->{total}++;
|
||||||
|
|
||||||
|
if (scalar(keys %{$self->{job}}) <= 0) {
|
||||||
|
$self->{output}->add_option_msg(short_msg => "No tape jobs found. Review filters. More infos with --debug option");
|
||||||
|
$self->{output}->option_exit();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user