SCOM Report for Alert Details
Hi I need SCOM community help to generate the alert report from a particular MP every day. The expectation of report is It should display all the alerts individuallyDonald D'souza (http://donald-scom.blogspot.com/)
October 26th, 2012 6:37am

This one works for me...instead of SQL just use your preferred alerts. http://www.scomgod.com/?p=448 #Criteria : All SQL alerts in the NEW State are collected #Output to : File (C:\MaintenanceModeV4\Daily_SQL_SCOM_Alerts.txt) #Fields Selected: Quite a few #Output Format : TXT #Notes : Probably needs more work :) Add-PSSnapin "Microsoft.EnterpriseManagement.OperationsManager.Client" -ErrorVariable errSnapin; Set-Location "OperationsManagerMonitoring::" -ErrorVariable errSnapin; new-managementGroupConnection -ConnectionString:'nyscom01' -ErrorVariable errSnapin; set-location 'RMSSERVERHERE' -ErrorVariable errSnapin; $Alerts_txt = "C:\MaintenanceModeV4\Daily_SQL_SCOM_Alerts.txt"; "Exporting Health service Alerts to txt: " | out-File $Alerts_txt; $AlertCount = get-alert -criteria "ResolutionState=0 AND LastModified >= '$((((Get-Date).ToUniversalTime())).addhours(-24))'" | where-object {$_.MonitoringObjectName -eq "MSSQLSERVER" -or $_.MonitoringObjectName -eq "SQLSERVERAGENT" -or $_.MonitoringObjectName -eq "MsDtsServer" -or $_.MonitoringObjectName -eq "MsDtsServer100"} | measure-object; "The number of Alerts Contain in the file is/are " | out-file $Alerts_txt -append; $AlertCount | out-file $Alerts_txt -append; $AllAlerts=get-alert -criteria "ResolutionState='0' AND LastModified >= '$((((Get-Date).ToUniversalTime())).addhours(-24))'" | where-object {$_.MonitoringObjectName -eq "MSSQLSERVER" -or $_.MonitoringObjectName -eq "SQLSERVERAGENT" -or $_.MonitoringObjectName -eq "MsDtsServer" -or $_.MonitoringObjectName -eq "MsDtsServer100"} | select Id, Name, Description, MonitoringObjectName, MonitoringObjectFullName, ResolutionState, Priority, Severity, Category, TimeRaised, TimeAdded, LastModified, LastModifiedBy, TimeResolutionStateLastModified, Context, MonitoringObjectInMaintenanceMode, MonitoringObjectHealthState, RepeatCount, NetbiosDomainName, PrincipalName, MaintenanceModeLastModified, StateLastModified, Parameters; if($AllAlerts -eq $null){"NO ERRORS WERE DETECTED" | out-file $Alerts_txt -append;} else { ForEach($Alert in $AllAlerts){ "=======================================================================================================================" | out-file $Alerts_txt -append; $Alert | out-file $Alerts_txt -append; }}; "=======================================================================================================================" | out-file $Alerts_txt -append; "This file was created by NetOps" | out-file $Alerts_txt -append; $emailTo = "someone@yourcompany.com"; $emailTo = "someone@somewhere.com"; $emailFrom = "SQL-Backups@somewhere.com"; $subject = "SCOM Report: SQL Alerts"; $body = "This e-mail contains a text attachment that contains all the SQL or Maintenance Plan issues for SQL Servers detected within the last 24 Hours(UTC) by SCOM"; $attachment = New-Object System.Net.Mail.Attachment ArgumentList 'C:\MaintenanceModeV4\Daily_SQL_SCOM_Alerts.txt'; $smtpServer = "yoursmptpserver"; $smtp = new-object Net.Mail.SmtpClient($smtpServer); $message = New-Object System.Net.Mail.MailMessage ArgumentList $emailFrom, $emailTo, $subject, $body; $message.Attachments.Add($attachment); $smtp.Send($message);
Free Windows Admin Tool Kit Click here and download it now
October 27th, 2012 4:14pm

Donald, You definatley want to get the Veeam Extended Generic Report Library. Its Alert Statistics Report allows you to report on ALerts generated from a specific management pack. http://www.veeam.com/extended-generic-report-library.html HTH Walter Chomak | walter@mobieus.com | www.mobieus.com WpC These are just stats though, he wants alerts.
October 27th, 2012 4:17pm

Hi Julia, but it's necessary to mention that powershell cmdlets dont query Datawarehouse, in the case older (more than 7 days if default settings are used) data abount alerts for day is needed.
Free Windows Admin Tool Kit Click here and download it now
October 27th, 2012 5:41pm

Donald, You definatley want to get the Veeam Extended Generic Report Library. Its Alert Statistics Report allows you to report on ALerts generated from a specific management pack. http://www.veeam.com/extended-generic-report-library.html HTH Walter Chomak | walter@mobieus.com | www.mobieus.com WpC
October 28th, 2012 7:19am

You will have to author this yourself, unless a third party has built one and has it for sale or someone made a report like this public for community consumption.Regards, Blake Email: mengotto<at>hotmail.com Blog: http://discussitnow.wordpress.com/ If my response was helpful, please mark it as so, if it answered your question, then please also mark it accordingly. Thank you.
Free Windows Admin Tool Kit Click here and download it now
October 28th, 2012 10:44am

Hi, you should see OperationsManagerDW [OperationsManagerDW].[Alert].[vAlert] RaisedDataTime to specify period of time MonitorAlertInd to determine if it's generated by rule or monitor and with which to join [OperationsManagerDW].[dbo].[vMonitor] or [OperationsManagerDW].[dbo].[vRule] [OperationsManagerDW].[dbo].[vMonitor] or [OperationsManagerDW].[dbo].[vRule] ManagementPackRowId to join [OperationsManagerDW].[dbo].[vManagementPack] where you know what is the Name of Management Pack (ManagementPackSystemName) of the rule or monitor that generated Alert. Then you can filter on different params. It's not a difficult report. Maybe something will help.
October 28th, 2012 11:44am

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

Other recent topics Other recent topics