We for many years have used a VBS script in conjunction with our Centreon monitoring solution to let us know if the Veeam jobs have been successful, but since the move to PostGreSQL we are unable to use it anymore.
The script we use is this:
Code: Select all
'
' Nagios Plugn for reading BackupExec's error log
' It is intended to use with NSClient++
'
' To reset the alerts, accnolage the alerts in BackupExec
'
' Author: Nils Cronstedt
' Email: nils.cronstedt[at]gmail[dot]com
' Created on: 2010-05-15
Dim rad,txt,dag,alert,status
Set cnn = CreateObject("ADODB.Connection")
Set Rs = CreateObject("ADODB.Recordset")
cnn.ConnectionString = "driver={SQL Server};server=VEEAM\VEEAMSQL2016;Trusted_Connection=Yes;database=VeeamBackup"
cnn.Open
rs.ActiveConnection = cnn
exitcode = 0
txt=""
allert()
rs.close
If txt > "" Then
txt = "Error in Backup or Replication Job " & txt & " | "
else
txt = "OK"
exitcode=0
End If
wscript.echo(txt)
wscript.quit exitcode
Function allert()
Const ForReading = 1, ForWriting = 2, ForAppending = 8
Const TristateUseDefault = -2, TristateTrue = -1, TristateFalse = 0
strsql = "SELECT name FROM [dbo].[Bjobs] where latest_result=1"
rs.Open strsql , cnn,3,3
Do While Not rs.EOF
rad = rs("name") & ", "
Set fso = CreateObject("Scripting.FileSystemObject")
txt = txt + rad
rs.MoveNext
Loop
exitcode = 2
Exit Function
End Function
Code: Select all
cnn.ConnectionString = "driver={SQL Server};server=VEEAM\VEEAMSQL2016;Trusted_Connection=Yes;database=VeeamBackup"
Thanks,
Anthony