enh(plugin): Azure backupitemstatus vm_id filter (#1892)
Fix https://github.com/centreon/centreon-plugins/issues/1890
This commit is contained in:
parent
20dbd338fe
commit
3d34cece23
|
@ -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).
|
||||
|
|
Loading…
Reference in New Issue