Looked through a few of the posts. Looks like there was once a plugin to monitor backup exec but the site is no longer there. I don't need all the statistical info. I just want to know did last nights backup pass or fail. What are my best options. Tried to monitor the even log, but I have no way of telling it not to read the entire log. With multiple jobs in the even log this isn't very helpful to know if it passed or not cause I can't just pull the latest one.
Best way to monitor backup exec now?
Votes:
0
7 Replies
Votes:
0
Hi,
thank you for your question.
You can monitor success or fail of Backup Exec with an IMAP sensor as described in this article. Please have a look at this article as well.
prtgplugins.com is external and not related to Paessler, as such we do not really have any control over the same.
Votes:
0
I'd rather not setup another mailbox to manage. I'm trying to do this with a Powershell script. I did a similar thing to monitor our server room temp with prtg. I'm actually reusing that code but I'm having trouble. But although in Powershell it works perfect and my if statement returns true. In prtg It goes all the way to my else statement every time. And if I add exit codes it breaks completely. See example below.
$events=Get-WinEvent -FilterHashTable @{logname='application'; ProviderName="backup Exec"} -MaxEvent 1 -ComputerName Server1 $message=$events | select-object message $result = $message -match "(?s)Backup Exec Alert: (?<content>.*)\n\(Server" $alert=$matches['content'] if ($alert -eq "Job Completed with Exceptions") {Write-host $alert ":Job Completed"} elseif ($alert -eq "Job Failed") {Write-host $alert ":Job Failed"} else {write-host $alert ":Error"}
Created on Oct 4, 2013 12:16:08 PM
Last change on Oct 4, 2013 2:43:31 PM by
Torsten Lindner [Paessler Support]
Votes:
0
And here is the results of the sensor debug. No clue why this works in powershell and not in PRTG.
Get-WinEvent : No events were found that match the specified selection criteria . At C:\Program Files (x86)\PRTG Network Monitor\custom sensors\EXE\Backup Exec M onitor.ps1:1 char:21 + $events=Get-WinEvent <<<< -FilterHashTable @{logname='application'; Provider Name="backup Exec"} -MaxEvent 1 -ComputerName Server1 + CategoryInfo : ObjectNotFound: (:) [Get-WinEvent], Exception + FullyQualifiedErrorId : NoMatchingEventsFound,Microsoft.PowerShell.Comma nds.GetWinEventCommand Cannot index into a null array. At C:\Program Files (x86)\PRTG Network Monitor\custom sensors\EXE\Backup Exec M onitor.ps1:4 char:17 + $alert=$matches[ <<<< 'content'] + CategoryInfo : InvalidOperation: (content:String) [], RuntimeEx ception + FullyQualifiedErrorId : NullArray :Error
Created on Oct 4, 2013 1:22:37 PM
Last change on Oct 4, 2013 2:43:50 PM by
Torsten Lindner [Paessler Support]
Votes:
0
So fixed the permission issue no my script runs fine. But I can't get exit codes to work. Any line that has an exit code no matter the result of the statement true or false it will exit the script. What is wrong with this? Also is there anyway to get this to return the result rather than me manually giving it a string to pass to PRTG?
$events=Get-WinEvent -FilterHashTable @{logname='application'; ProviderName="backup Exec"} -MaxEvent 1 -ComputerName Server1 $message=$events | select-object message $result = $message -match "(?s)Backup Exec Alert: (?<content>.*)\n\(Server" $alert=$matches['content'] if ($alert -eq "Job Completed with Exceptions") {Write-host $alert ":Job Completed"} exit 0 elseif ($alert -eq "Job Failed") {Write-host $alert ":Job Failed"} exit 1 else {write-host $alert ":Error"} exit 1
Created on Oct 4, 2013 2:00:05 PM
Last change on Oct 4, 2013 2:44:10 PM by
Torsten Lindner [Paessler Support]
Votes:
0
Finally figured this out. I'm new to powershell scripting and programming in general. my exit statements needed to be on a separate line. And I setup a variable to give me the message that the query was pulling.... see below. Hope this helps someone.
$events=Get-WinEvent -FilterHashTable @{logname='application'; ProviderName="backup Exec"} -MaxEvent 1 -ComputerName Server1 $message=$events | select-object message $result = $message -match "(?s)Backup Exec Alert: (?<content>.*)\n\(Server" $alert=$matches['content'] $info=[string]$alert+":"+$alert if ($alert -eq "Job Completed with Exceptions") {Write-host $info exit 0} elseif ($alert -eq "Job Failed") {Write-host $info Exit 1} else {write-host $info Exit 1}
Created on Oct 4, 2013 6:48:07 PM
Last change on Oct 7, 2013 5:37:33 AM by
Konstantin Wolff [Paessler Support]
Votes:
0
Thanks for posting the powershell script here for Backupexec, however when i am using the script, I get an Install Warning, any chance you can help me out?
Votes:
0
Thanks for posting! Saved me some time :)
Add comment