I need to create a report showing historical data of all events triggered for certain alerts that I have configured. How do I do that?
ahthomas,
To create a report showing historical data of all events triggered for certain alerts:
HTH,
That doesn't work. I can't get anything from my advanced alerts...
Ensure that your Alerts have a Trigger Action to log to the NetPerfMon Event Log. If this isn't set I don't believe it will show the Event if it is only set to send Emails.
Ahh that's it... well the SQL DB logs to the AlertLogs table. Anybody have a proper way to query that for a result? This one isn't working correctly for me...
select ObjectName,Message,LogDateTime from AlertLogwhere LogDateTime >= (GetDate() - 7)and Message='Alert Triggered'and ObjectName like 'someserver%'or ObjectName like 'someserver2%'or ObjectName like 'someserver3%'and LogDateTime >= (GetDate() - 7)order by 3 desc
I censored out server names, but essentially I'm getting results back to 2011 and not all servers are being queried.
I managed to get based on LogDateTime >= (GetDate() - 7)
The following is what I did:
1. Used the following query to confirm if the date is reported correctly: SELECT GETDATE()
2. Ran the following to confirm that earliest date that I should see the from the AlertLog events: SELECT GETDATE() - 7
3. I am not sure if it is the AND and OR in the statements that messed up the querying, but the following is what I used. I also noticed that you used GetDate() twice:
SELECT ObjectName, Message, LogDateTime
FROM AlertLog
WHERE
LogDateTime >= (GetDate() - 7)
AND Message='Alert Triggered'
AND
( ObjectName LIKE 'someserver%'
OR ObjectName LIKE 'someserver1%' )
ORDER BY 3 desc
HTH.