I have on my enviroment Arcserve Backup solution for tape backup, and I, inside it we have a program called ca_qmgr that can return the status of the current backup jobs, I used a vbs script to return the following information:
On this image we have the field "LAST-RESULT" that shows me the status of the jobs like "Finished, failed, cancelled, etc". Bellow I have the VBS script that I'm using:
Dim ObjExec
Dim strFromProc
Set objShell = WScript.CreateObject("WScript.Shell")
Set ObjExec = objShell.Exec("""C:\Program Files (x86)\CA\ARCserve Backup\ca_qmgr.exe"" -list")
strFromProc = ObjExec.StdOut.ReadAll()
WScript.Echo strFromProc
With this I can get the output of the jobs current status, now I need to parse the text of the output and, everytime a job is with status "FAILED" return value "1" to me, and when whatever other status is shown return value "0" to me, anyone have any ideas?
Here is the copied output :
JOB# JOBID STATUS EXEC-TIME JOB-TYPE LAST-RESULT OWNER EXECUTIONHOST DESCRIPTION
----------------------------------------------------------------------------------------------------------
2 0 HOLD 07/09/2019 11:00:00 ROTATION UNAVAILABLE No Owner ICBHOST03 Tarefa de proteΒo do banco de dados
4 67 READY 08/02/2019 06:00:00 BACKUP FINISHEDICB\administrador ICBHOST03 Backup Diario
3 80 READY 08/02/2019 09:00:00 BACKUP FAILED caroot ICBHOST03 Backup Mensal
1 79 READY 08/02/2019 12:00:00 DB-PRUNING FINISHED No Owner ICBHOST03 Tarefa de remoΒo de banco de dados
5 58 READY 08/05/2019 09:00:00 BACKUP FINISHED caroot ICBHOST03 Backup Segunda

@, otherwise there is no notification.JOB# 4seems to break the formatting so you might be better off simply searching for the textFAILEDwith the functioninstr(0,strFromProc,"FAILED",1). - user6811411