You are browsing the archive for 2012 August.

LiveMeeting 20th September: Management pack tuning wars

8:30 am in SCOM, sysctr by Dieter Wijckmans

 

Missed my session at the Experience days last June? No fear I’ll rerun my session during a live meeting the 20th of September. It will be packed with demos of the new wave of authoring tools which will make your life much easier in maintaining, creating and upgrading your management packs in the SCOM environment.

The abstract of this LiveMeeting:

Do you feel like installing, maintaining and developing management packs feels like a mission? Why not make it a mission! Join me in this session to efficiently tune and create your own management pack with military precision and no room for failure. Get the right tools to arm yourself for the job, get the best approach and fire away. The new secret weapon in Management pack authoring will be revealed and showcased so you can complete every management pack design mission quick and effectively. Attention!

Make sure to sign up here:

https://msevents.microsoft.com/CUI/EventDetail.aspx?EventID=1032523394&Culture=en-us&community=0

 

In addition Microsoft BELUX is launching the “Technet Tuesdays and Thursdays”. Two days in the week filled with LiveMeetings + you’ll get 50 MVA (Microsoft Virtual Academy points) when attending.

SNAG-0105

Check out the full list of LiveMeetings here to receive all the info you need first hand from the experts in the field: http://technet.microsoft.com/nl-be/bb291010/

SCOM Speak PowerShell script

10:50 pm in Uncategorized by Dieter Wijckmans

In my early days of monitoring we had a dedicated computer set up who read out all the critical alerts as for example a server was down. It was a fairly simple setup but had it’s flaws and it was not combined with System Center Operations Manager (which is already a big flaw).

The idea to create a PowerShell script for just doing that was already a significant time on my to do list but kind of made it to the top of my list due to a Facebook request I got last week.

Prerequisites

SCOM 2007 (will post the SCOM 2012 version shortly)

*UPDATE* The SCOM 2012 script is now available here: http://gallery.technet.microsoft.com/SCOM-2012-Speak-script-9f24b90c

The pc you want to read out the alert on needs to have:

WinRM needs to be enabled

At least .net framework 3.0 needs to be installed

PowerShell 2.0 needs to be installed

Speakers (pretty obvious no?)

Setup of the PC

First of all make sure that Computer has PowerShell 2.0 installed.

If this is not the case download and install it here: http://support.microsoft.com/kb/968930

Open PowerShell by browsing to Start > Accessories > Windows Powershell and open Powershell as administrator by right clicking and choosing run as admin:

SNAG-0085

Next thing on our list is to enable the ability remotely execute commands on the computer.

Run: “Enable-PSRemoting –Force” to enable the WinRM service on the computer. SNAG-0087

An alternative way is to use the command WinRM quickconfig in an elevated prompt.

Verify afterwards that the service was started:

SNAG-0088

Now test from the RMS that the server is reachable through WinRM by running the following command on the RMS:

Test-WsMan COMPUTER (replace COMPUTER with the name of the computer you want the alert to be played on)

The following should appear:

SNAG-0089

The PowerShell Script:

In this example I’m using this script to read out a warning when there’s a server down but you can easily change it to your specific needs of course.

The 2007 script can be downloaded here

The 2012 script can be downloaded here

Copy paste of the script for your reference

#=========================================================================
# AUTHOR:    Dieter Wijckmans
# DATE:        07/08/2012
# Name:        speak_scom2007.PS1
# Version:    1.0
# COMMENT:    Let SCOM read an alert out loud on a remote computer to notify the operator
# CREDITS:
# Usage:    .\speak_scom2007.ps1 -$severity -$text -$pc1 -$machine
#
#=========================================================================

###Prepare environment for run###

####
# Start Ops Mgr snapin, get RMS
###

###
#Get parameters from command line, Start Ops Mgr snapin
###
param ([string]$severity,[string]$stext,[string]$pc1,[string]$machine)
#param ([string]$text,[string]$pc1)

##Read out the RMS name
$objCompSys = Get-WmiObject win32_computersystem
$rootMS = $objCompSys.name
#If the RMS is installed on a cluster comment the above 2 lines, uncomment the line below and fill in the server below.
#$rootMS = “Your clustered RMS here”

#Initializing the Ops Mgr 2007 Powershell provider#
Add-PSSnapin “Microsoft.EnterpriseManagement.OperationsManager.Client” -ErrorVariable errSnapin ;
Set-Location “OperationsManagerMonitoring::” -ErrorVariable errSnapin ;
new-managementGroupConnection -ConnectionString:$rootMS -ErrorVariable errSnapin ;
Set-Location $rootMS -ErrorVariable e-severrrSnapin ;

#Set Culture Info# In this case Dutch Belgium
$cultureInfo = [System.Globalization.CultureInfo]’nl-BE’

#Error handling setup
$error.clear()
$erroractionpreference = “SilentlyContinue”
$thisScript = $myInvocation.MyCommand.Path
$scriptRoot = Split-Path(Resolve-Path $thisScript)
$errorLogFile = Join-Path $scriptRoot “error.log”
if (Test-Path $errorLogFile) {Remove-Item $errorLogFile -Force}

#create the text to read. You can change this section to read out a different phrase
#Notice the extra spaces in the string. These are used to slow down the reading and make it more comprehensive

$text = $severity + ”    Alert on    ” + $machine + ”    ” + $stext

#execute script#

invoke-command -computer $pc1 -scriptblock {[Reflection.Assembly]::LoadWithPartialName(“System.Speech”)
$voice = New-Object System.Speech.Synthesis.SpeechSynthesizer
$voice.Speak($args[0]) } -argumentlist $text

###
#Remove the Ops Mgr PSSnapin#
###

Remove-PSSnapin Microsoft.EnterpriseManagement.OperationsManager.Client

 

 

Note

You can change the actual change the sentence SCOM is speaking out loud in the highlighted section so let your imagination + creativity go wild on this…

Setup the notification channel

The last thing you have to do to let the computer read out the SCOM alerts is to make a subscription for the alert and pass the desired parameters.

For a full list of all the available parameters I would like to reference to a great post of Kevin Holman: http://blogs.technet.com/b/kevinholman/archive/2007/12/12/adding-custom-information-to-alert-descriptions-and-notifications.aspx

In my particular example I’m using the following parameters: Severity, Machine name, pc1 and text.

Severity: Alert severity

Machine name: machine which is down

Text: Free text you would like to read out loud.

Pc1: The machine where the text needs to be spoken.

Note

: You can send the command to multiple PC’s at the same time by adding a new variable to the command line and C/P the speak section in the script with the name of the new parameter.

The Notification Channel should look like this:

SNAG-0090

Full Path of the command file: C:\Windows\System32\WindowsPowerShell\V1.0\Powershell.exe

Command Line Parameters:

C:\Scripts\speak_scom2007.ps1 -severity ‘$Data/Context/DataItem/Severity$’ -stext ‘Machine Down’ -pc1 ‘desktop1′ -machine ‘$Data/Context/DataItem/ManagedEntityDisplayName$’

Startup folder for the command line:

C:\scripts

SNAG-0091

Only thing left to do is link this channel to a subscriber and make an actual subscription for the machine down alerts.

Now just wait until SCOM will start talking to you Smile

SCOM 2012: Error 0x80131500 when installing Reporting server

9:43 pm in operations manager, SCOM, SCOM 2012, sysctr by Dieter Wijckmans

 

Today I received a rather strange error message when I wanted to install a reporting server in an already existing OM 2012 environment.

Symptoms:

The install took ages and was running on “Creating SRS source” forever however it was still running.

After 2 hours it gave an error and rolled back to the original situation.

After going over the prerequisites again it failed again. Rebooted the machine, checked everything again but no dice.

SNAG-0084

The error message was: Exception Error Code: 0x80131500. The communication object, System.ServiceModel.Channels.ServiceChannel, cannot be used for communication because it is in the Faulted state.

Solution

Turned out that there were proxy settings filled in in Internet Explorer. Apparently the install process is using these proxy settings to connect to the IIS in the background. However my user did not have rights on the proxy. Therefore the connection was denied and the install could not continue. Removing the Proxy settings resolved the issue and Reporting was installed successfully.