# check Backup Exec Active Alerts # # This script will check for the active alerts with severity Warning or Error # tested on BE2014 # It use NSClient++ to execute the ps1 script on the Backupexec server. # # # load BackupExec Management Command Line Interface Import-Module BEMCLI # read number of errors and warnings from BackupExec Alerts $errors = @(Get-BEAlert -Severity Error).Count $warnings = @(Get-BEAlert -Severity warning).Count # reset nagios error level (if for whatever reason this is not 0) $nagiosstatus = "0" # If there are warnings, set the nagios error level to 1 and show number of warnings if ($warnings -ne "0") { write-host "Alerts with warning :" $warnings $nagiosstatus = "1" } else { } # If there are errors, set the nagios error level to 2 and show number of errors if ($errors -ne "0") { write-host "Alerts with error :" $errors $nagiosstatus = "2" } else { } exit $Nagiosstatus