Hello,
we are using Zabbix to monitor MS SQL instances. I wanted to make an additional trigger to get notified about failed SQL user logins. However, we are monitoring multiple SQL instances at single servers, therefore alerts based on MS Event Viewer won't point to right instance (Zabbix host/client).
I was thinking about adding such query to MSSQL by ODBC template to query DB e.g. each 5 minutes for failed logins, however I'm not entirely sure how to add it to Zabbix template? Or maybe there's better way e.g. to get notification on event?
DECLARE @StartDate DATETIME, @EndDate DATETIME;
SET @EndDate = GETDATE();
SET @StartDate = DATEADD(MINUTE, -5, @EndDate);
EXEC xp_readerrorlog 0, 1, N'Login failed for user', NULL, @StartDate, @EndDate, N'asc';
(can't upload image with sample output)
Comment