' ' 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=localhost\VEEAMSQL2008R2;Trusted_Connection=Yes;database=VeeamBackup" cnn.Open rs.ActiveConnection = cnn exitcode = 0 txt="" allert() rs.close If txt > "" Then txt = "Error on backup job \n" & 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, repo_name,progress,result,target_host_name FROM [VeeamBackup].[dbo].[ReportJobsView] where latest_result=2" rs.Open strsql , cnn,3,3 Do While Not rs.EOF rad = rs("name") & " : " & rs("repo_name") & " : " & rs("progress") & " : " & rs("target_host_name") & "\n " Set fso = CreateObject("Scripting.FileSystemObject") txt = txt + rad rs.MoveNext Loop exitcode = 2 Exit Function End Function