How to get all alerts prasent in scom for each windows computer?

Hi all,

I am new to scom. I am able to get all alerts from scom. but requirement is how to get alert present for particular windows machine.

Console.WriteLine("Displaying alert data...");
            MonitoringClassCriteria classcriteria=new MonitoringClassCriteria(@"$Target/Host/Property[Type=""Windows!Microsoft.Windows.Computer""]/NetworkName$");
            MonitoringAlertCriteria alertCriteria = new MonitoringAlertCriteria("Severity ==" + (int)ManagementPackAlertSeverity.Information + " OR Severity==" + (int)ManagementPackAlertSeverity.Error + "OR Severity==" + (int)ManagementPackAlertSeverity.Warning + "OR Severity==" + (int)ManagementPackAlertSeverity.MatchMonitorHealth);
   
           ReadOnlyCollection<MonitoringAlert> alerts = mg.GetMonitoringAlerts(



             if (alerts.Count > 0)
             {

                 foreach (MonitoringAlert alert in alerts)
                 {

                     Console.WriteLine("*******************alerts*********************");
                     Console.WriteLine("Name: " + alert.Name);
                     Console.WriteLine("Description: " + alert.Description);
                     Console.WriteLine("Severity: " + alert.Severity.ToString());
                     Console.WriteLine("Resolution state: " + alert.ResolutionState.ToString());
 }
             }
             else
             {
                 Console.WriteLine("No alerts found.");

             }

July 23rd, 2015 7:02am

Hi Sir,

We can use "get-scomalert" to query the specific computer's alerts:

 get-scomalert | ?{$_.netbioscomputername -eq " ComputerName"}

Best Regards,

El

Free Windows Admin Tool Kit Click here and download it now
July 29th, 2015 2:57am

Hi,

Use the below query and specify the fullname/Path and you can get all alerts for a desired windows computer.

SELECT AlertName, AlertDescription, RaisedDateTime
  FROM [OperationsManagerDW].[Alert].[vAlert] where ManagedEntityRowId IN
(SELECT  [ManagedEntityRowId]
FROM [OperationsManagerDW].[dbo].[vManagedEntity] where FullName  like '%%' 
and RaisedDateTime between '2013-01-01 06:09:15.027' and '2013-01-04 13:09:15.027')

Courtesy: Kevin Holman

July 30th, 2015 10:45am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics