Ad Widget

Collapse

Monitoring Windows 2008, 2008R2, 2012 server backups

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • RedShift
    Junior Member
    • Sep 2009
    • 13

    #1

    Monitoring Windows 2008, 2008R2, 2012 server backups

    * This method is based on active checks. This means the monitored computer will contact the Zabbix server on its own to report the backup status. Make sure your infrastructure is set up to work with active checks!
    * It works with the Windows task scheduler. When certain events occur in the backup log, this gets sent to Zabbix server using zabbix_sender.


    1) Install the AgentTrapper.WindowsBackup template (ZabbixTemplate - AgentTrapper.WindowsBackup.xml)

    This will create a template named "AgentTrapper.WindowsBackup". In this template there are two items:

    * winbackup.status (Backup status): this can be either "Running" or "Finished successfully"
    * winbackup.lasterror (Last backup, anomoly occurred on):
    -> Value is 0: no errors have occurred since last backup has been started
    -> Value is a date: the date and time when a warning or error has occurred.
    -> This item is reset to 0 every time a new backup starts.

    There are three triggers:
    * A backup anomoly was logged during the last backup: goes off when a warning or error occurred during the last backup
    * A backup has completed successfully: goes off when a backup has been completed successfully (informational).
    * No backup status reported in last 48 hours: goes off when the winbackup.status hasn't been updated in the last 48 hours. If you're not making daily backups, you might want to adjust this threshold.


    2) Installing the scheduled tasks

    I've exported the scheduled tasks to XML files so you can use the task scheduler to import them. There are three scheduled tasks to be added:

    * ZabbixAgent_BackupStarted.xml
    -> Runs when a backup starts
    -> Sets the winbackup.status item to "Running".
    -> Resets the winbackup.lasterror key to "0".

    * ZabbixAgent_BackupCompleted.xml
    -> Runs when a backup has finished successfully
    -> This task sets the winbackup.status item to "Finished successfully"

    * ZabbixAgent_BackupAttention.xml
    -> Runs when a warning, error or critical error occurs
    -> This task sets the winbackup.lasterror to the current date and time

    IMPORTANT
    You will have to modify the XML files yourself before you import them. More specifically, the paths to zabbix_sender and its configuration file has to be adjusted to your situation. The XML files were made for my setups so adjust as

    necessary.

    Open the XML files and look at the <Actions> section:

    Code:
      <Actions Context="Author">
        <Exec>
          <Command>cmd.exe</Command>
          <Arguments>/E:ON /C ""%ProgramFiles%\Zabbix\Agent\zabbix_sender" -c %ProgramData%\Zabbix\Agent\zabbix_agentd.conf -k winbackup.lasterror -o "%Date% %Time%""</Arguments>
        </Exec>
      </Actions>
    If your zabbix_sender was installed under D:\ and your configfile D:\zabbix_agent.conf, you'd put in this:

    Code:
      <Actions Context="Author">
        <Exec>
          <Command>cmd.exe</Command>
          <Arguments>/E:ON /C ""D:\zabbix_sender" -c D:\zabbix_agent.conf -k winbackup.lasterror -o "%Date% %Time%""</Arguments>
        </Exec>
      </Actions>
    Please pay careful attention to these commands and triple check the quoting is correct!

    3) Link your template to your host and test

    That should be it.
    Attached Files
  • TheFixer
    Junior Member
    • Jan 2014
    • 2

    #2
    Ok, what am I doing wrong....

    Followed the instructions, the only change I made was in the Zabbix template, and I changed the type from Trapper to Zabbix agent (Active) as all the servers I scan are setup in Active mode.

    The completion notification and running notification work work (I get "Backup Completed Successfully" and "Backup Running") however....

    The Events are coming back to the Zabbix server as Problems, and also even if a backup completes successfully (No Errors) I will still get an anomaly notification.

    Any ideas?

    Comment

    • mulbzh
      Senior Member
      • Nov 2014
      • 115

      #3
      it seems good, just be careful of commands path
      Last edited by mulbzh; 24-11-2014, 17:51.

      Comment

      • devilkin
        Junior Member
        • Jan 2015
        • 5

        #4
        Originally posted by TheFixer
        Ok, what am I doing wrong....

        Followed the instructions, the only change I made was in the Zabbix template, and I changed the type from Trapper to Zabbix agent (Active) as all the servers I scan are setup in Active mode.

        The completion notification and running notification work work (I get "Backup Completed Successfully" and "Backup Running") however....

        The Events are coming back to the Zabbix server as Problems, and also even if a backup completes successfully (No Errors) I will still get an anomaly notification.

        Any ideas?

        Sorry to resurrect and old thread,

        I encountered the same issue that you are having and made a small change to the template given here.

        This is what I did:
        • Edited the trigger A backup has completed successfully
        • Changed the expression to {AgentTrapper.WindowsBackup:winbackup.status.str(R unning)}=1


        This way it will fire the trigger (and create a problem event) when the backup starts and not when it completes successfully. Once the backup completes and returns "successfull" the trigger will fail, the problem state will go away and you will see green in the dash/overview

        Comment

        • cesaralvaro
          Junior Member
          • Nov 2013
          • 2

          #5
          Restart tread

          Hi all!
          Sorry for restart tread.
          In my case i receive only ( No backup status reported in last 48 hours).
          But the last backup sucefully have make in less 24 hours.
          Sorry for my english.

          Comment

          • devilkin
            Junior Member
            • Jan 2015
            • 5

            #6
            Give this a try. I based the trigger possibilities on the template in this thread but rewrote the monitoring to use active checks to read the server event logs. So you dont need to do any of the scheduled tasks.

            If your zabbix agent is set correctly to do active checks all you need is to assign this template to your host.

            You can edit the template name, its currently set to the naming convention for my company.
            Attached Files

            Comment

            • vrosansys
              Junior Member
              • Jun 2016
              • 4

              #7
              Originally posted by devilkin
              Give this a try. I based the trigger possibilities on the template in this thread but rewrote the monitoring to use active checks to read the server event logs. So you dont need to do any of the scheduled tasks.

              If your zabbix agent is set correctly to do active checks all you need is to assign this template to your host.

              You can edit the template name, its currently set to the naming convention for my company.
              Good, thanks it's worked for me!

              Comment

              • devilkin
                Junior Member
                • Jan 2015
                • 5

                #8
                EDIT: ignore this
                Last edited by devilkin; 25-10-2016, 23:35. Reason: posted a reply that doesnt work.......

                Comment

                • devilkin
                  Junior Member
                  • Jan 2015
                  • 5

                  #9
                  New version

                  I picked up a problem on my template where in some occasions it doesnt report on a failure. Basically what happens is even after a failure windows still writes a non-critical log to say completed so this caused my solution to think everything is fine.

                  The new version checks the last 2 log entries for the keyword "failed" and also a dependency to not have this trigger fire if a backup is currently in progress (in which case there will also be two log entries in a row without "failure")
                  Attached Files

                  Comment

                  • Gijs007
                    Member
                    • Oct 2017
                    • 40

                    #10
                    I'm using this script and it works great for monitoring backups.

                    I've noticed that the backup is running trigger is only triggered at the start of the backup. Is it possible to make it last while the backup is running or add a delay before it "untriggers"?

                    Comment

                    Working...