/*Top 50 alert generating rules and monitors in last 7 days, sorted by alert + repeat count.*/ USE OperationsManagerDW SELECT TOP (50) Alerts.AlertName, SUM(1) AS ‘Alert Instances’, SUM(Alerts.RepeatCount + 1) AS ‘Alert + Repeat Count’, CASE Alerts.MonitorAlertInd WHEN 1 THEN vMonitor.MonitorDefaultName WHEN 0 THEN vRule.RuleDefaultName ELSE ‘Not found’ END AS ‘Rule or Monitor Name’,…
Number of unit monitor state changes per day for last 28 days
/*Number of unit monitor state changes per day for last 28 days.*/ USE OperationsManagerDW SELECT CONVERT(VARCHAR(10), DateTime, 101) AS Date, COUNT(*) AS ‘State Changes’ FROM State.vStateRaw INNER JOIN vManagedEntityMonitor ON State.vStateRaw.ManagedEntityMonitorRowId = vManagedEntityMonitor.ManagedEntityMonitorRowId INNER JOIN vMonitor ON vManagedEntityMonitor.MonitorRowId = vMonitor.MonitorRowId INNER JOIN vMonitorManagementPackVersion ON vManagedEntityMonitor.MonitorRowId = vMonitorManagementPackVersion.MonitorRowId INNER JOIN vManagementPack ON…
Number of state change events per day for last 28 days
/*Number of state change events per day for last 28 days.*/ USE OperationsManagerDW SELECT CONVERT(VARCHAR(10), DateTime, 101) AS Date, COUNT(*) AS ‘State Changes’ FROM State.vStateRaw WHERE (DateTime BETWEEN DATEADD(day, – 27, GETDATE()) AND GETDATE()) GROUP BY CONVERT(VARCHAR(10), DateTime, 101) ORDER BY Date DESC Back to SQL queries main menu
Get BASE class properties (if any)
Get BASE class properties (if any) foreach ($base in Get-MonitoringClass | where {$_.name -eq "class_name"}) {get-monitoringclass | where {$_.id -eq $base.base.id} | foreach-object {$_.getMonitoringProperties()} | ft -auto parentElement,name} main menu
Get BASE class
Get BASE class foreach ($base in Get-MonitoringClass | where {$_.name -eq "class_name"}) {get-monitoringclass | where {$_.id -eq $base.base.id} | select-object name} main menu
Event data, views and grooming
Every day I have a number of fleeting thoughts that I hope every Operations Manager administrator knows. With all the emerging blogs about Operations Manager over the past year offering up a wealth of knowledge, sometimes I assume the majority of these fleeting thoughts are common knowledge. I’m going to stop assuming, and start writing….
Command Shell Tab Expansion Delay
A few months ago, after re-installing my workstation operating system and getting all my applications and tools loaded, I fire up Operations Manager Command Shell. Since I use the tab expansion function frequently, I noticed immediately that for some odd reason the Command Shell would paused for ~30 seconds every time I used the tab…
Table size and record count
This was initially published by Kevin, and Steve added row count. I just changed the column names and posted it here for easy access to customers I work with. Anytime I engage in a tuning effort or a case where there are database issues, I first ask customers to run all queries on the main…
Monitor the operations database grooming procedure (v2)
UPDATE: Monitoring the operational database grooming procedure is now included in the SCOM management pack since version 6.1.7672.0. I will keep this post up as an example of how to create a monitor based on a script that queries a database. Okay, so it’s only been two days since I posted the original monitor. But,…
Group members (DW)
/* Return Health Service instances hosting one or more instances contained in system.group */ USE OperationsManagerDW SELECT vManagedEntity.DisplayName AS Computer FROM vManagedEntity INNER JOIN vManagedEntityType ON vManagedEntity.ManagedEntityTypeRowId = vManagedEntityType.ManagedEntityTypeRowId WHERE (vManagedEntity.TopLevelHostManagedEntityRowId IN (SELECT DISTINCT ME1.TopLevelHostManagedEntityRowId FROM vManagedEntity AS ME2 INNER JOIN vRelationship ON ME2.ManagedEntityRowId = vRelationship.SourceManagedEntityRowId INNER JOIN vManagedEntity AS…