cancel
Showing results for 
Search instead for 
Did you mean: 

Clear Alerts using BEMCLI

InfoSys2
Level 2

We are looking for a way to clear the alerts when running BEMCLI.  We have set it up to respond Ok, but the alerts are still showing in the Backup Exec 2012 GUI.  Anyone know how to do this?  Here is the powershell that we are running.

 

 

Import-module bemcli
Get-BEJob -Name "BackupJob-Full" | 
Start-BEJob -Confirm:$False |
Get-BEAlert -Severity Information |
Clear-BEAlert -Response Ok -Confirm:$False |
Get-BEAlert -Severity Question |
Clear-BEAlert -Response Ok -Confirm:$False |
Get-BEAlert -Severity Warning |
Clear-BEAlert -Response Ok -Confirm:$False |
Get-BEAlert -Severity Error |
Clear-BEAlert -Response Ok -Confirm:$False |
Out-Null
 
Again, This is responding ok to the to them via BEMCLI.  We want to figure out how to get them removed from the GUI so that everything completes..
 
 
1 ACCEPTED SOLUTION

Accepted Solutions

pkh
Moderator
Moderator
   VIP    Certified

1) Why do you need to clear the alerts immediately?  You should take a look at them to see what they say before deleting them.  Otherwise, you might miss something important.  Also, the alerts are unobstrusive, except for a few alerts, like media insert, they do not require any response for the job to continue.

2) You can clear most alerts by setting an auto-response for the alert,  For example, to auto-respond to the media remove alert

3) Lastly, your BEMCLI script is clearing the alerts even before they are issued.  After the job is started, you just clear alerts regardless of whether they exists.  You should wait for the alerts.  Your script should look something like this

 

Do {
 
      Start-Sleep -sec 30
 
      $Alert = Get-BEAlert -Name "BackupJob-Full" -Severity Information
 
   } until ($Alert -ne $Null)
 
Clear-BEAlert -in $MediaInterventionAlert -Response ok -Confirm:$false  

View solution in original post

1 REPLY 1

pkh
Moderator
Moderator
   VIP    Certified

1) Why do you need to clear the alerts immediately?  You should take a look at them to see what they say before deleting them.  Otherwise, you might miss something important.  Also, the alerts are unobstrusive, except for a few alerts, like media insert, they do not require any response for the job to continue.

2) You can clear most alerts by setting an auto-response for the alert,  For example, to auto-respond to the media remove alert

3) Lastly, your BEMCLI script is clearing the alerts even before they are issued.  After the job is started, you just clear alerts regardless of whether they exists.  You should wait for the alerts.  Your script should look something like this

 

Do {
 
      Start-Sleep -sec 30
 
      $Alert = Get-BEAlert -Name "BackupJob-Full" -Severity Information
 
   } until ($Alert -ne $Null)
 
Clear-BEAlert -in $MediaInterventionAlert -Response ok -Confirm:$false