enh(plugin): Azure backupitemstatus vm_id filter (#1892)

Fix https://github.com/centreon/centreon-plugins/issues/1890
This commit is contained in:
Thibault S 2020-03-20 11:25:54 +01:00 committed by GitHub
parent 20dbd338fe
commit 3d34cece23
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 0 deletions

View File

@ -111,6 +111,7 @@ sub new {
"vault-name:s" => { name => 'vault_name' },
"resource-group:s" => { name => 'resource_group' },
"filter-name:s" => { name => 'filter_name' },
"filter-vmid:s" => { name => 'filter_vmid' },
"filter-counters:s" => { name => 'filter_counters' },
"warning-status:s" => { name => 'warning_status', default => '' },
"critical-status:s" => { name => 'critical_status', default => '%{precheck_status} ne "Passed" || %{last_backup_status} eq "Failed"' },
@ -149,6 +150,8 @@ sub manage_selection {
foreach my $item (@{$items}) {
next if (defined($self->{option_results}->{filter_name}) && $self->{option_results}->{filter_name} ne ''
&& $item->{properties}->{friendlyName} !~ /$self->{option_results}->{filter_name}/);
next if (defined($self->{option_results}->{filter_vmid}) && $self->{option_results}->{filter_vmid} ne ''
&& $item->{properties}->{virtualMachineId} !~ /$self->{option_results}->{filter_vmid}/);
$self->{items}->{$item->{id}} = {
display => $item->{properties}->{friendlyName},
@ -193,6 +196,10 @@ Set resource group (Required).
Filter item name (Can be a regexp).
=item B<--filter-vmid>
Filter item virtualMachineId (Can be a regexp).
=item B<--filter-counters>
Only display some counters (regexp can be used).