Monitoring Azure Backup Jobs with Zabbix

Posted: September 18, 2018 in Windows Server

This approach uses filtering Event Viewer for entries created by Azure Backup software.

zabbix.ps1

cls
$a=Get-WinEvent -FilterHashtable @{LogName = "CloudBackup"; StartTime = Get-Date -UFormat "%m/%d/%Y"} -MaxEvents 1 | sort-object TimeCeated | FT -HideTableHeaders -property Message | Out-String
   
Switch ($a)
{
{$_ -match 'The backup operation has completed'} { $result = 0}
{$_ -match 'Storage quota is within limits.'} { $result = 0}
{$_ -match 'The backup operation has started.'} { $result = 0}
{$_ -match ''} { $result = 0}
{$_ -match '-vv'} { $result = 0}
else {$result=1}
}
$result
cd "C:\Program Files\Zabbix Agent\bin\win64"
.\zabbix_sender.exe -z zabbix_server -p 10051 -s zabbix_host -c "C:\Program Files\Zabbix Agent\conf\zabbix_agentd.win.conf" -k backup.azure[azure] -o $result -vv
Create scheduled task to send data to zabbix on regular interval.
1.PNG

Program/script:C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe

Add argument:-file “C:\Program Files\Zabbix Agent\zabbix.ps1”

Start in (optional) C:\Program Files\Zabbix Agent

2.PNG

Create Item:

Type:zabbix trapper

1

Trigger will fire off if result is > 0

{zabbix_host:key.last()}>0
{zabbix_host:backup.azure[azure].last()}>0

2.png

Comments
  1. Eduardo Mansano says:

    Hello, how are you ?
    I tried to follow your tutorial to monitor Azure Backup backup through Zabbix 4.2.4.
    I created the power shell script and is returning the following message:
    0
    zabbix_sender.exe [16916]: DEBUG: answer [{“response”: “success”, “info”: “processed: 0; failed: 1; total: 1; seconds spent: 0.000020”}]
    Response from “xxxxxxx:10051”: “processed: 0; failed: 1; total: 1; seconds spent: 0.000020”
    sent: 1; skipped: 0; total: 1

    PS C: \ Program Files \ Zabbix Agent>

    I created a new template called Azure Backup, created the item and triguer, and associated it with a host, but is not giving me any information from backup jobs, could you give me a light?

    Thanks

    Like

Leave a comment