Template for sql server jobs monitoring.
Uses a powershell script and zabbix_sender, called on zabbix-agent.
Tested on Windows Server 2016, MS SQL Server 2017, Zabbix 5.0.
Based on https://internet-lab.ru/zabbix_template_mssql_2014_jobs, but the solution from this article based on multiple powershell calls, that why CPU load is about 4-5% with long time.
This template has been changed to use zabbix trapper, so all keys (including discovery) are sent using a single call.
- Import zabbix template to zabbix and link it to the windows server host.
- Copy scripts to zabbix agent folder
c:\zabbix\scripts\
. - Copy zabbix agent configuration to
c:\zabbix\zabbix_agentd.conf.d\
. - Also check settings in all copied file: connection string in
mssqljobs.ps1
and other settings inmssqljobs.bat
. - Include agent configuration in
zabbix_agentd.win.conf
Include=c:\zabbix\zabbix_agentd.conf.d\*.conf
- Restart zabbix agent.
- Job Created
- Job Is Enabled
- Job Is Scheduled
- Job Last Run
- Job Last Run Duration
- Job Last Run Status
- Job Last Run Timestamp
- Job Message
- Job Modified
- Job Next Run
- Job Schedule Interval
- Job Schedule Recurrence Factor
- Job Schedule Subday Interval
- Job Schedule Subday Type
- Job Schedule Type
- Job ServerName
- Job Is NOT Enabled
- Job Is NOT Scheduled
- Job Last Run Status NOT Succeeded
- Job Last Run was more than a 1 HOUR ago
- Job Last Run was more than a 2 HOURS ago
- Job Last Run was more than a MONTH ago
- Job Last Run was more than a WEEK ago
- Job Last Run was more than ONE DAY ago
Note: most triggers are created for personal use, you can write your own by analogy.