Chat now with support
Chat with Support

Spotlight on SQL Server Enterprise 11.7 - Release Notes

Query alarm data

Querying alarm data is the same as querying other data stored in the repository. Alarm data is stored in a statistic class called ‘alarms’.

Figure 1: Sample T-SQL statement that can be used to retrieve alarm data. Required parameters: monitored object name, start and end times.

select

sp.timecollected,

max(case when sn.statistic_name = 'severity' then sp.raw_value end) as 'severity',

max(case when sn.statistic_name = 'text' then sp.raw_value end) as 'text',

max(case when sn.statistic_name = 'rule' then sp.raw_value end) as 'rule',

max(case when sn.statistic_name = 'action' then sp.raw_value end) as 'action',

max(case when sn.statistic_name = 'key' then sp.raw_value end) as 'key',

max(case when sn.statistic_name = 'raw text' then sp.raw_value end) as 'raw text'

from

spotlight_perfdata sp

join spotlight_stat_classes sc on sp.statistic_class_id = sc.statistic_class_id

join spotlight_stat_names sn on sp.statistic_name_id = sn.statistic_name_id

join spotlight_monitored_objects so on sp.monitored_object_id = so.monitored_object_id

where

sc.statistic_class_name = 'alarms'

and so.monitored_object_name = 'Windows01_SQLServer789_sqlserver'

and sp.timecollected between '2009-09-08' and '2009-09-17'

group by

sp.timecollected, sp.statistic_key_id

order by

sp.timecollected

Figure 2: T-SQL statement results

Related Documents

The document was helpful.

Select Rating

I easily found the information I needed.

Select Rating