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:backup.azure[azure].last()}>0

 

2.png

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s