Hi
I using zabbix compose version 6.4.6
I have jobs with backup of database on SMSS and i want make on dashboard something like table with name of database and status ("backup done" or "problem") and i don't know how to do it. Someone do something like this please help.
EDIT.1
I wrote this but in zabbix in output get "SQL query returned empty result." but in SMSS I get 1 or 0
DECLARE @job_result INT
-- Pobierz wynik ostatniego uruchomienia jobu
SELECT TOP 1 @job_result = run_status
FROM msdb.dbo.sysjobs j
INNER JOIN msdb.dbo.sysjobhistory h ON j.job_id = h.job_id
WHERE j.name = 'backup_test.Subplan_1'
ORDER BY h.run_date DESC, h.run_duration DESC;
-- Wypisz wynik (1 oznacza sukces, 0 oznacza niepowodzenie)
IF @job_result = 1
PRINT '1'
ELSE
PRINT '0';
I using zabbix compose version 6.4.6
I have jobs with backup of database on SMSS and i want make on dashboard something like table with name of database and status ("backup done" or "problem") and i don't know how to do it. Someone do something like this please help.
EDIT.1
I wrote this but in zabbix in output get "SQL query returned empty result." but in SMSS I get 1 or 0
DECLARE @job_result INT
-- Pobierz wynik ostatniego uruchomienia jobu
SELECT TOP 1 @job_result = run_status
FROM msdb.dbo.sysjobs j
INNER JOIN msdb.dbo.sysjobhistory h ON j.job_id = h.job_id
WHERE j.name = 'backup_test.Subplan_1'
ORDER BY h.run_date DESC, h.run_duration DESC;
-- Wypisz wynik (1 oznacza sukces, 0 oznacza niepowodzenie)
IF @job_result = 1
PRINT '1'
ELSE
PRINT '0';
Comment