Monday, July 11, 2011

SCOM: Use Operations Manager Shell to close multiple Alerts generated by Same Rule

Hi,

When today i login in to my SCOM console I saw approx 134 Active Alerts about Microsoft SQL Job failure. I was about to close these alert but then one thing strike in my mind that lets try to close these alerts using “Operations Manager Shell”. These Alerts are generating from same source and the name of the alert is same to it would not be to hard. So let try.

problem

Our First Step is to find out the Command which can show us Alert in SCOM Shell.

Open “Operations manager shell” and type  Get-Command *alert* , this will search for all SCOM cmdlets which have the word alert (we use wildcard *), and as you know PowerShell cmdlets works on Verb-Noun format  so if we use Get-Alert cmdlets it will shows all alerts.

alert

Let Try Get-Alert

alert-2

Type get-alert in the shell and hit Enter and it shown you all alerts.

Sol-5

Next task is to choose which Alert to Close .. if you look at active Alert in SCOM CONSOLE name of My Alert is “"A SQL job failed to complete successfully"

 problem-1

Now our next step is to find the properties and methods supported by Get-Alert command. To know these we need to use another command Get-Member

member

Yes.. it has name property…Gr8

Sol-2

Now we need to see all alerts whose name match “"A SQL job failed to complete successfully", for filter the output from Get-alert command we pipe (|) the output of Get-Alert command to Where-Object cmdlet.

Get-alert | Where-Object { $_.Name -match "A SQL job failed to complete successfully"}

where 

This will show all alerts whose name matches with "A SQL job failed to complete successfully"

So now our next step is to find a cmdlet which can close these alerts. lets find out..  run the same command

Get-Command *alert*

resolve-alert

So this time we have find Resolve-Alert cmdlet. now we need to join and our cmdlets command using piping . so this should be like this.

get-alert | where-object { $_.Name -match "A SQL job failed to complete successfully"} | Resolve-alert

rr

in Get Alert we are searching for an Alerts | then we are filter then using Name with match to “Sql job Failure | and then we are resolving them.  now type the above command and hit enter. It will take sometime to do this.

When you command run successfully, open SCOM Console and search for same SQL JOB error and you will found nothing :)

Solved-7

 

I hope that it helps someone…

Thanks

Aman Dhally

Friday, July 8, 2011

Mystery of Blank Schedule Email Reports in SCOM

Hi,

After deployment of Reporting Server for SCOM we test the working of Reporting Server by generating few “Windows Generic Reports” manually and they works perfect. So we plan to schedule Reports for a weekly delivery on Emails. So that we can have the statistics of our server weekly.

So when we test schedule email reports in SCOM, but when reports arrives in an email they are with no data completely blank email with link to Reporting Server. Then we investigate on internet and found that this is a knows issue (KB:  http://support.microsoft.com/kb/972821) and we also found  the blog posting on Kevin Holman on the same Issue. (Please visit his blog posting  for more clarifications..click here )

So Lets try.

Step:1

Login to your SQL Reporting Server for SCOM

Navigate to default Reporting Server installation path and navigate to ”Reporting Services\ReportServer\bin”   and Open

ReportingServicesService.exe.config” in notepad.

C:\Program Files\Microsoft SQL Server\MSRS10.MSSQLSERVER\Reporting Services\ReportServer\bin”

2 

 

Step:2

After opening “ReportingServicesService.exe.config”  we need to insert below code in to this file. The main issue is where to insert the Code.

 

To resolve this problem, add the following information to the ReportingServicesService.exe.config file in the ReportServer\bin directory:

<dependentAssembly>
<assemblyIdentity name="Microsoft.ReportingServices.ProcessingCore" publicKeyToken="89845dcd8080cc91" culture="neutral" />
<bindingRedirect oldVersion="9.0.242.0" newVersion="10.0.0.0" />
</dependentAssembly>
<dependentAssembly xmlns="urn:schemas-microsoft-com:asm.v1">
<assemblyIdentity name="Microsoft.ReportingServices.ProcessingCore" publicKeyToken="89845dcd8080cc91" culture="neutral" />
<bindingRedirect oldVersion="9.0.242.0" newVersion="10.0.0.0" />
</dependentAssembly>

The Right Position of Correct code is below.


This XML section must be added in between <runtime><assemblyBinding…> and </assemblyBinding></runtime> statements of the \ReportServer\bin\ReportingServicesService.exe.config file.


3


 


After Insert the Code in to “ReportingServicesService.exe.config” . save the file and reboot the “SQL Server Reporting Service”


4


That’s all :) ..


BUT…


But i after doing that problem is still not resolved. We still getting Black Reports. Now No Clue what to do next.  Then i tried the Following. I open the File in “Notepad++” and formatted it, save the file and restart SQL Reporting Server.


Before Formatting


Old-


After Formatting


Resolver


BingO.. this works for me … ( I know it doesn’t make any sense but it works) .. After done this my all schedule email reports works perfectly.


 


I hope that it may save some one else time ..


Thanks


Aman Dhally