Skip to content

Commit 0f19c9a

Browse files
author
Blake Drumm
committed
Upload SCOM Data Collector Queries.
1 parent 5274eb4 commit 0f19c9a

File tree

99 files changed

+1560
-5
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

99 files changed

+1560
-5
lines changed

.vs/slnx.sqlite

8 KB
Binary file not shown.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
select ManagedEntityTypeSystemName, DiscoverySystemName, count(*) As 'Changes'
2+
from
3+
(select distinct
4+
MP.ManagementPackSystemName,
5+
MET.ManagedEntityTypeSystemName,
6+
PropertySystemName,
7+
D.DiscoverySystemName, D.DiscoveryDefaultName,
8+
MET1.ManagedEntityTypeSystemName As 'TargetTypeSystemName', MET1.ManagedEntityTypeDefaultName 'TargetTypeDefaultName',
9+
ME.Path, ME.Name,
10+
C.OldValue, C.NewValue, C.ChangeDateTime
11+
from dbo.vManagedEntityPropertyChange C
12+
inner join dbo.vManagedEntity ME on ME.ManagedEntityRowId=C.ManagedEntityRowId
13+
inner join dbo.vManagedEntityTypeProperty METP on METP.PropertyGuid=C.PropertyGuid
14+
inner join dbo.vManagedEntityType MET on MET.ManagedEntityTypeRowId=ME.ManagedEntityTypeRowId
15+
inner join dbo.vManagementPack MP on MP.ManagementPackRowId=MET.ManagementPackRowId
16+
inner join dbo.vManagementPackVersion MPV on MPV.ManagementPackRowId=MP.ManagementPackRowId
17+
left join dbo.vDiscoveryManagementPackVersion DMP on DMP.ManagementPackVersionRowId=MPV.ManagementPackVersionRowId
18+
AND CAST(DefinitionXml.query('data(/Discovery/DiscoveryTypes/DiscoveryClass/@TypeID)') AS nvarchar(max)) like '%'+MET.ManagedEntityTypeSystemName+'%'
19+
left join dbo.vManagedEntityType MET1 on MET1.ManagedEntityTypeRowId=DMP.TargetManagedEntityTypeRowId
20+
left join dbo.vDiscovery D on D.DiscoveryRowId=DMP.DiscoveryRowId
21+
where ChangeDateTime > dateadd(hh,-24,getutcdate())
22+
) As #T
23+
group by ManagedEntityTypeSystemName, DiscoverySystemName
24+
order by count(*) DESC
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
select distinct
2+
ME.Path,
3+
ME.Name,
4+
MET.ManagedEntityTypeSystemName,
5+
PropertySystemName,
6+
C.OldValue,
7+
C.NewValue,
8+
C.ChangeDateTime,
9+
MP.ManagementPackSystemName,
10+
D.DiscoverySystemName,
11+
D.DiscoveryDefaultName,
12+
MET1.ManagedEntityTypeSystemName As 'TargetTypeSystemName',
13+
MET1.ManagedEntityTypeDefaultName 'TargetTypeDefaultName'
14+
from dbo.vManagedEntityPropertyChange C
15+
inner join dbo.vManagedEntity ME on ME.ManagedEntityRowId=C.ManagedEntityRowId
16+
inner join dbo.vManagedEntityTypeProperty METP on METP.PropertyGuid=C.PropertyGuid
17+
inner join dbo.vManagedEntityType MET on MET.ManagedEntityTypeRowId=ME.ManagedEntityTypeRowId
18+
inner join dbo.vManagementPack MP on MP.ManagementPackRowId=MET.ManagementPackRowId
19+
inner join dbo.vManagementPackVersion MPV on MPV.ManagementPackRowId=MP.ManagementPackRowId
20+
left join dbo.vDiscoveryManagementPackVersion DMP on DMP.ManagementPackVersionRowId=MPV.ManagementPackVersionRowId
21+
AND CAST(DefinitionXml.query('data(/Discovery/DiscoveryTypes/DiscoveryClass/@TypeID)') AS nvarchar(max)) like '%'+MET.ManagedEntityTypeSystemName+'%'
22+
left join dbo.vManagedEntityType MET1 on MET1.ManagedEntityTypeRowId=DMP.TargetManagedEntityTypeRowId
23+
left join dbo.vDiscovery D on D.DiscoveryRowId=DMP.DiscoveryRowId
24+
where ChangeDateTime > dateadd(hh,-24,getutcdate())
25+
ORDER BY ChangeDateTime DESC
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
SELECT ds.DatasetDefaultName,
2+
sdah.AggregationDateTime,
3+
sdah.AggregationTypeId,
4+
sdah.FirstAggregationStartDateTime,
5+
sdah.FirstAggregationDurationSeconds,
6+
sdah.LastAggregationStartDateTime,
7+
sdah.LastAggregationDurationSeconds,
8+
sdah.DirtyInd,
9+
sdah.DataLastReceivedDateTime,
10+
sdah.AggregationCount
11+
FROM StandardDatasetAggregationHistory sdah
12+
JOIN Dataset ds ON sdah.DatasetId = ds.DatasetId
13+
ORDER BY StandardDatasetAggregationHistoryRowId DESC
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
WITH AggregationInfo AS (
2+
SELECT
3+
AggregationType = CASE
4+
WHEN AggregationTypeId = 0 THEN 'Raw'
5+
WHEN AggregationTypeId = 20 THEN 'Hourly'
6+
WHEN AggregationTypeId = 30 THEN 'Daily'
7+
ELSE NULL
8+
END
9+
,AggregationTypeId
10+
,MIN(AggregationDateTime) as 'TimeUTC_NextToAggregate'
11+
,COUNT(AggregationDateTime) as 'Count_OutstandingAggregations'
12+
,DatasetId
13+
FROM StandardDatasetAggregationHistory
14+
WHERE LastAggregationDurationSeconds IS NULL
15+
GROUP BY DatasetId, AggregationTypeId
16+
)
17+
SELECT
18+
SDS.SchemaName
19+
,AI.AggregationType
20+
,AI.TimeUTC_NextToAggregate
21+
,Count_OutstandingAggregations
22+
,SDA.MaxDataAgeDays
23+
,SDA.LastGroomingDateTime
24+
,SDS.DebugLevel
25+
,AI.DataSetId
26+
FROM StandardDataSet AS SDS WITH(NOLOCK)
27+
JOIN AggregationInfo AS AI WITH(NOLOCK) ON SDS.DatasetId = AI.DatasetId
28+
JOIN dbo.StandardDatasetAggregation AS SDA WITH(NOLOCK) ON SDA.DatasetId = SDS.DatasetId AND SDA.AggregationTypeID = AI.AggregationTypeID
29+
ORDER BY SchemaName DESC

0 commit comments

Comments
 (0)