Ad Widget

Collapse

Good way for monitoring "Symantec Backup Exec"

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • MarkusL
    Member
    • Nov 2008
    • 41

    #1

    Good way for monitoring "Symantec Backup Exec"

    Hi All!

    As I mentioned in my last thread (http://www.zabbix.com/forum/showthread.php?t=11445 I wanted to show you, how we monitor our Backup-Exec-Results of daily backup.

    So, here we go :-)

    First, I want to present you a screenshot of the result in zabbix:
    We also monitor the services of backup exec, but I don´t want to discuss this, because its to simple,... (service_state[service])
    We will focus on the Backup-Job-Results.




    Here is how it starts:
    - Notice: we are working with german systems, for english systems you have to reconfigure the batchjob to fit your language!

    - First you have to be sure, Backup Exec will log in .txt; go to Extras -> Optionen -> Auftragsprotokoll
    - set the information-type to "Nur Kurz-Info"
    - set the protocol-type to textfile
    - under the config-lines you see the path, where BE will store the logs!

    OK, we are now done in Backup Exec.

    Lets create the Batchjob for our Windows-Server.

    the batch-file (again for german systems!!)
    The only thing you have to do here is to check, if the path to the log-files is ok.
    And, very important, you must have the tools grep and cut from the linux-tools for windows (http://unxutils.sourceforge.net)

    Code:
    @echo off
    
    set logs=C:\Programme\Symantec\Backup Exec\Data
    
    for /f "delims=" %%i in ('dir /B /Od /A-d "%logs%\*.txt"') do set file=%%i
    
    goto %1
    
    :Backupjob-Name
    
    type "%logs%\%file%" | grep Auftragsname | cut -f2-50 -d" "
    goto EOF
    
    
    :Backupjob-Start
    
    for /f "tokens=2 delims=," %%i in ('type "%logs%\%file%" ^| grep "Auftrag gestartet am"') do set start=%%i
    for /f "tokens=1 delims=." %%i in ('echo %start%') do set day=%%i
    for /f "tokens=2 delims= " %%i in ('echo %start%') do set month=%%i
    for /f "tokens=3 delims= " %%i in ('echo %start%') do set year=%%i
    for /f "tokens=5 delims= " %%i in ('echo %start%') do set starttime=%%i
    
    if %day%==1 set daynumeric=01
    if %day%==2 set daynumeric=02
    if %day%==3 set daynumeric=03
    if %day%==4 set daynumeric=04
    if %day%==5 set daynumeric=05
    if %day%==6 set daynumeric=06
    if %day%==7 set daynumeric=07
    if %day%==8 set daynumeric=08
    if %day%==9 set daynumeric=09
    if %day%==10 set daynumeric=10
    if %day%==11 set daynumeric=11
    if %day%==12 set daynumeric=12
    if %day%==13 set daynumeric=13
    if %day%==14 set daynumeric=14
    if %day%==15 set daynumeric=15
    if %day%==16 set daynumeric=16
    if %day%==17 set daynumeric=17
    if %day%==18 set daynumeric=18
    if %day%==19 set daynumeric=19
    if %day%==20 set daynumeric=20
    if %day%==21 set daynumeric=21
    if %day%==22 set daynumeric=22
    if %day%==23 set daynumeric=23
    if %day%==24 set daynumeric=24
    if %day%==25 set daynumeric=25
    if %day%==26 set daynumeric=26
    if %day%==27 set daynumeric=27
    if %day%==28 set daynumeric=28
    if %day%==29 set daynumeric=29
    if %day%==30 set daynumeric=30
    if %day%==31 set daynumeric=31
    
    if %month%==Januar set monthnumeric=01
    if %month%==Februar set monthnumeric=02
    if %month%==M„rz set monthnumeric=03
    if %month%==April set monthnumeric=04
    if %month%==Mai set monthnumeric=05
    if %month%==Juni set monthnumeric=06
    if %month%==Juli set monthnumeric=07
    if %month%==August set monthnumeric=08
    if %month%==September set monthnumeric=09
    if %month%==Oktober set monthnumeric=10
    if %month%==November set monthnumeric=11
    if %month%==Dezember set monthnumeric=12
    
    set logdate=%daynumeric%.%monthnumeric%.%year%
    echo %logdate%, %starttime%
    goto EOF
    
    
    :Backupjob-Ende
    
    for /f "tokens=2 delims=," %%i in ('type "%logs%\%file%" ^| grep "Auftrag beendet am"') do set start=%%i
    for /f "tokens=1 delims=." %%i in ('echo %start%') do set day=%%i
    for /f "tokens=2 delims= " %%i in ('echo %start%') do set month=%%i
    for /f "tokens=3 delims= " %%i in ('echo %start%') do set year=%%i
    for /f "tokens=5 delims= " %%i in ('echo %start%') do set starttime=%%i
    
    if %day%==1 set daynumeric=01
    if %day%==2 set daynumeric=02
    if %day%==3 set daynumeric=03
    if %day%==4 set daynumeric=04
    if %day%==5 set daynumeric=05
    if %day%==6 set daynumeric=06
    if %day%==7 set daynumeric=07
    if %day%==8 set daynumeric=08
    if %day%==9 set daynumeric=09
    if %day%==10 set daynumeric=10
    if %day%==11 set daynumeric=11
    if %day%==12 set daynumeric=12
    if %day%==13 set daynumeric=13
    if %day%==14 set daynumeric=14
    if %day%==15 set daynumeric=15
    if %day%==16 set daynumeric=16
    if %day%==17 set daynumeric=17
    if %day%==18 set daynumeric=18
    if %day%==19 set daynumeric=19
    if %day%==20 set daynumeric=20
    if %day%==21 set daynumeric=21
    if %day%==22 set daynumeric=22
    if %day%==23 set daynumeric=23
    if %day%==24 set daynumeric=24
    if %day%==25 set daynumeric=25
    if %day%==26 set daynumeric=26
    if %day%==27 set daynumeric=27
    if %day%==28 set daynumeric=28
    if %day%==29 set daynumeric=29
    if %day%==30 set daynumeric=30
    if %day%==31 set daynumeric=31
    
    if %month%==Januar set monthnumeric=01
    if %month%==Februar set monthnumeric=02
    if %month%==M„rz set monthnumeric=03
    if %month%==April set monthnumeric=04
    if %month%==Mai set monthnumeric=05
    if %month%==Juni set monthnumeric=06
    if %month%==Juli set monthnumeric=07
    if %month%==August set monthnumeric=08
    if %month%==September set monthnumeric=09
    if %month%==Oktober set monthnumeric=10
    if %month%==November set monthnumeric=11
    if %month%==Dezember set monthnumeric=12
    
    set logdate=%daynumeric%.%monthnumeric%.%year%
    echo %logdate%, %starttime%
    goto EOF
    
    
    :Backupjob-Result
    
    REM Information
    REM Erfolgreich 	--> 0
    REM Fehlgeschlagen 	--> 1
    REM Abgebrochen		--> 2
    REM other		--> X
    
    for /f "tokens=2 delims= " %%i in ('type "%logs%\%file%" ^| grep Abschlussstatus') do set result=%%i
    if "%result%"=="Erfolgreich" (@echo 0 && goto EOF) else (goto next1)
    :next1
    if "%result%"=="Fehlgeschlagen" (@echo 1 && goto EOF) else (goto next2)
    :next2
    if "%result%"=="Abgebrochen," (@echo 2 && goto EOF) else (@echo X)
    goto EOF
    
    
    
    :Backupjob-Error
    
    for /f "tokens=2 delims= " %%i in ('type "%logs%\%file%" ^| grep Abschlussstatus') do set result=%%i
    if %result%==Erfolgreich (@echo - && goto EOF) else (goto next2)
    :next2
    for /f "tokens=2 delims=:" %%i in ('type "%logs%\%file%" ^| grep "ltiger Fehler"') do echo %%i
    goto EOF
    
    
    
    :Backupjob-Error-Category
    
    for /f "tokens=2 delims= " %%i in ('type "%logs%\%file%" ^| grep Abschlussstatus') do set result=%%i
    if %result%==Erfolgreich (@echo - && goto EOF) else (goto next)
    :next
    for /f "tokens=2 delims=:" %%i in ('type "%logs%\%file%" ^| grep "ltige Fehlerkategorie"') do echo %%i
    goto EOF
    
    
    :Backupjob-Error-Info
    
    for /f "tokens=2 delims= " %%i in ('type "%logs%\%file%" ^| grep Abschlussstatus') do set result=%%i
    if %result%==Erfolgreich (@echo - && goto EOF) else (goto next)
    :next
    for /f "tokens=11 delims= " %%i in ('type "%logs%\%file%" ^| grep "tzliche Informationen zu diesem Fehler"') do echo %%i
    goto EOF
    
    :EOF
    Now we have to configure our zabbixagent.conf like this (be free to use other paths )
    Code:
    UserParameter=backupexecname[*],C:\Programme\zabbix\backupexeccheck.cmd Backupjob-$1
    UserParameter=backupexecstart[*],C:\Programme\zabbix\backupexeccheck.cmd Backupjob-$1
    UserParameter=backupexecend[*],C:\Programme\zabbix\backupexeccheck.cmd Backupjob-$1
    UserParameter=backupexecresult[*],C:\Programme\zabbix\backupexeccheck.cmd Backupjob-$1
    UserParameter=backupexecerror[*],C:\Programme\zabbix\backupexeccheck.cmd Backupjob-$1
    UserParameter=backupexecerrorcat[*],C:\Programme\zabbix\backupexeccheck.cmd Backupjob-$1
    UserParameter=backupexecerrorinfo[*],C:\Programme\zabbix\backupexeccheck.cmd Backupjob-$1
    Last step is zabbix-items.
    Sorry, but my template is not ready now (triggers missing), so I will present you the items directly in text here:

    we need 7 Items
    - all items Zabbix Agent / Character / Update interval 10800 (every 3 hours) / history 30 days / trends 60 days
    - all the same name: BackupExec Job-$1
    - the keys: backupexecname[Name],
    backupexecresult[Result], backupexecstart[Start], backupexecend[Ende], backupexecerror[Error], backupexecerrorcat[Error-Category], backupexecerrorinfo[Error-Info]
    - for backupexecresult[Result] you need a map, that looks like this (0->success, 1->failed, 2->aborted, X->unknown)


    Well, we are done :-)


    I hope you enjoy the new way of monitoring Backup Exec.
    It´s a really fine way, because you don´t need Eventlog or other stuff, just concentrate on simple textfiles and getting data out of :-)

    By the way: in the same way, we monitor Acronis True Image and Trend Micro Worry-Free-Suites,...



    Kind regards,

    Markus.
  • kyi
    Member
    • Jun 2005
    • 64

    #2
    Nice 1,

    can you put the XML for TrendMicro into the wiki?

    Comment

    • MarkusL
      Member
      • Nov 2008
      • 41

      #3
      Hi!

      OK, please don´t get me wrong, but our scripts are really hard work. So I just wanted to give the community a peace of "how-to", not the whole cake,...

      You find all you need in our script to monitor Trend Micro, too. All you need is to cut and grep the right infos out of the ofcscan.ini.


      Back to Backup Exec.
      I just modified our mainscript a little.

      Here is the actual release:

      Code:
      @echo off
      
      set logs=C:\Programme\Symantec\Backup Exec\Data
      
      for /f "delims=" %%i in ('dir /B /Od /A-d "%logs%\*.txt"') do set file=%%i
      
      goto %1
      
      REM ====================================================================================================
      :Backupjob-Name
      REM ====================================================================================================
      
      type "%logs%\%file%" | grep Auftragsname | cut -f2-50 -d" "
      goto EOF
      
      
      
      REM ====================================================================================================
      :Backupjob-Start
      REM ====================================================================================================
      
      for /f "tokens=2 delims=," %%i in ('type "%logs%\%file%" ^| grep "Auftrag gestartet am"') do set start=%%i
      for /f "tokens=1 delims=." %%i in ('echo %start%') do set day=%%i
      for /f "tokens=2 delims= " %%i in ('echo %start%') do set month=%%i
      for /f "tokens=3 delims= " %%i in ('echo %start%') do set year=%%i
      for /f "tokens=5 delims= " %%i in ('echo %start%') do set starttime=%%i
      
      if %day%==1 set daynumeric=01
      if %day%==2 set daynumeric=02
      if %day%==3 set daynumeric=03
      if %day%==4 set daynumeric=04
      if %day%==5 set daynumeric=05
      if %day%==6 set daynumeric=06
      if %day%==7 set daynumeric=07
      if %day%==8 set daynumeric=08
      if %day%==9 set daynumeric=09
      if %day%==10 set daynumeric=10
      if %day%==11 set daynumeric=11
      if %day%==12 set daynumeric=12
      if %day%==13 set daynumeric=13
      if %day%==14 set daynumeric=14
      if %day%==15 set daynumeric=15
      if %day%==16 set daynumeric=16
      if %day%==17 set daynumeric=17
      if %day%==18 set daynumeric=18
      if %day%==19 set daynumeric=19
      if %day%==20 set daynumeric=20
      if %day%==21 set daynumeric=21
      if %day%==22 set daynumeric=22
      if %day%==23 set daynumeric=23
      if %day%==24 set daynumeric=24
      if %day%==25 set daynumeric=25
      if %day%==26 set daynumeric=26
      if %day%==27 set daynumeric=27
      if %day%==28 set daynumeric=28
      if %day%==29 set daynumeric=29
      if %day%==30 set daynumeric=30
      if %day%==31 set daynumeric=31
      
      if %month%==Januar set monthnumeric=01
      if %month%==Februar set monthnumeric=02
      if %month%==M„rz set monthnumeric=03
      if %month%==April set monthnumeric=04
      if %month%==Mai set monthnumeric=05
      if %month%==Juni set monthnumeric=06
      if %month%==Juli set monthnumeric=07
      if %month%==August set monthnumeric=08
      if %month%==September set monthnumeric=09
      if %month%==Oktober set monthnumeric=10
      if %month%==November set monthnumeric=11
      if %month%==Dezember set monthnumeric=12
      
      set logdate=%daynumeric%.%monthnumeric%.%year%
      echo %logdate%, %starttime%
      goto EOF
      
      
      
      REM ====================================================================================================
      :Backupjob-Ende
      REM ====================================================================================================
      
      for /f "tokens=2 delims=," %%i in ('type "%logs%\%file%" ^| grep "Auftrag beendet am"') do set start=%%i
      for /f "tokens=1 delims=." %%i in ('echo %start%') do set day=%%i
      for /f "tokens=2 delims= " %%i in ('echo %start%') do set month=%%i
      for /f "tokens=3 delims= " %%i in ('echo %start%') do set year=%%i
      for /f "tokens=5 delims= " %%i in ('echo %start%') do set starttime=%%i
      
      if %day%==1 set daynumeric=01
      if %day%==2 set daynumeric=02
      if %day%==3 set daynumeric=03
      if %day%==4 set daynumeric=04
      if %day%==5 set daynumeric=05
      if %day%==6 set daynumeric=06
      if %day%==7 set daynumeric=07
      if %day%==8 set daynumeric=08
      if %day%==9 set daynumeric=09
      if %day%==10 set daynumeric=10
      if %day%==11 set daynumeric=11
      if %day%==12 set daynumeric=12
      if %day%==13 set daynumeric=13
      if %day%==14 set daynumeric=14
      if %day%==15 set daynumeric=15
      if %day%==16 set daynumeric=16
      if %day%==17 set daynumeric=17
      if %day%==18 set daynumeric=18
      if %day%==19 set daynumeric=19
      if %day%==20 set daynumeric=20
      if %day%==21 set daynumeric=21
      if %day%==22 set daynumeric=22
      if %day%==23 set daynumeric=23
      if %day%==24 set daynumeric=24
      if %day%==25 set daynumeric=25
      if %day%==26 set daynumeric=26
      if %day%==27 set daynumeric=27
      if %day%==28 set daynumeric=28
      if %day%==29 set daynumeric=29
      if %day%==30 set daynumeric=30
      if %day%==31 set daynumeric=31
      
      if %month%==Januar set monthnumeric=01
      if %month%==Februar set monthnumeric=02
      if %month%==M„rz set monthnumeric=03
      if %month%==April set monthnumeric=04
      if %month%==Mai set monthnumeric=05
      if %month%==Juni set monthnumeric=06
      if %month%==Juli set monthnumeric=07
      if %month%==August set monthnumeric=08
      if %month%==September set monthnumeric=09
      if %month%==Oktober set monthnumeric=10
      if %month%==November set monthnumeric=11
      if %month%==Dezember set monthnumeric=12
      
      set logdate=%daynumeric%.%monthnumeric%.%year%
      echo %logdate%, %starttime%
      goto EOF
      
      
      REM ====================================================================================================
      :Backupjob-Result
      REM ====================================================================================================
      
      REM Information
      REM Erfolgreich 	--> 0
      REM Fehlgeschlagen 	--> 1
      REM Abgebrochen		--> 2
      REM other		--> X
      
      for /f "tokens=2 delims= " %%i in ('type "%logs%\%file%" ^| grep Abschlussstatus') do set result=%%i
      if "%result%"=="Erfolgreich" (@echo 0 && goto EOF) else (goto next1)
      :next1
      if "%result%"=="Fehlgeschlagen" (@echo 1 && goto EOF) else (goto next2)
      :next2
      if "%result%"=="Abgebrochen" (@echo 2 && goto EOF) else (@echo X)
      goto EOF
      
      
      
      REM ====================================================================================================
      :Backupjob-Error
      REM ====================================================================================================
      
      for /f "tokens=2 delims= " %%i in ('type "%logs%\%file%" ^| grep Abschlussstatus') do set result=%%i
      if %result%==Erfolgreich (@echo - && goto EOF) else (goto next)
      :next
      if %result%==Abgebrochen (@echo Vom Benutzer abgebrochen && goto EOF) else (goto next)
      :next
      for /f "tokens=2 delims=:" %%i in ('type "%logs%\%file%" ^| grep "ltiger Fehler"') do echo %%i
      goto EOF
      
      
      
      REM ====================================================================================================
      :Backupjob-Error-Category
      REM ====================================================================================================
      
      for /f "tokens=2 delims= " %%i in ('type "%logs%\%file%" ^| grep Abschlussstatus') do set result=%%i
      if %result%==Erfolgreich (@echo - && goto EOF) else (goto next)
      :next
      if %result%==Abgebrochen (@echo - && goto EOF) else (goto next)
      :next
      for /f "tokens=2 delims=:" %%i in ('type "%logs%\%file%" ^| grep "ltige Fehlerkategorie"') do echo %%i
      goto EOF
      
      
      
      REM ====================================================================================================
      :Backupjob-Error-Info
      REM ====================================================================================================
      
      for /f "tokens=2 delims= " %%i in ('type "%logs%\%file%" ^| grep Abschlussstatus') do set result=%%i
      if %result%==Erfolgreich (@echo - && goto EOF) else (goto next)
      :next
      if %result%==Abgebrochen (@echo - && goto EOF) else (goto next)
      :next
      for /f "tokens=11 delims= " %%i in ('type "%logs%\%file%" ^| grep "tzliche Informationen zu diesem Fehler"') do echo %%i
      goto EOF
      
      :EOF

      Comment

      Working...