See www.zabbix.com for the official Zabbix site.
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.
Install the AgentTrapper.WindowsBackup template
Import Media: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, anomaly 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 anomaly 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.
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:
- Runs when a backup starts
- Sets the winbackup.status item to "Running".
- Resets the winbackup.lasterror key to "0".
- Runs when a backup has finished successfully
- This task sets the winbackup.status item to "Finished successfully"
- Runs when a warning, error or critical error occurs
- This task sets the winbackup.lasterror to the current date and time
Open the XML files and look at the <Actions> section:
<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:
<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!
Link your template to your host and test
That should be it.