Wednesday, 4 October 2017

We use SquaredUp quite heavily for visualising SCOM.   Once thing I was asked was to find the number of connections to each RDS Collection we have.

SCOM can graph RDS performance counters for each server. Which is all fine, unless you have 10+ servers for a collection.  It ends up looking quite messy with similar colours.

The result isn't that useful for anyone wanting to see how many total users are currently on the collection.

The easy solution was to use the SquaredUp Community Management Pack (free!).

I created a new rule in SCOM using the MP to query the RDS Connection Broker and find out the name of the farms, and then work out the total connections and return it as a property bag.
I then used SquaredUp to display this value.

Net result : 

The rule is targeted to "Remote Desktop Connection Broker Role Service" and set to gather every 2 mins.  We have two brokers, so I can gather stats from either server.

Code (I could probably make it more efficient if I get time):

This script will count the number of active connections to the RD Connection Brokers per farm  
Initially created August 2017 by Darren Joyce

If this script is altered, make sure all rules using it are updated otherwise cookdown will be broken.
The rule needs to be scoped to the RDS Connection brokers only.

function Event-Log {
    param (
        [string] $logtext
    $Global:EventLog += $logtext

$api = New-Object -comObject "MOM.ScriptAPI"

$computer = (Get-WmiObject Win32_ComputerSystem)
$servers = Get-WMIObject -Class Win32_SessionDirectoryServer
$clusters = $servers.ClusterName | get-unique
  Event-Log "Beginning Script 1.0 `n"
$hash = @()
$hash = $servers | group "clustername" | select Name,@{Name="Sessions";Expression={[System.Math]::Round($($ | measure-object -sum NumberOfSessions).sum,2)}}

foreach ($h in $hash){
$propertybag = $api.CreatePropertyBag()
$propertybag.addvalue("Farm",("RDSFarm:" +($
Event-Log "   Created PropertyBag for $h `n" 

$totalRDSSessions `n"
write-EventLog -Source 'Health Service Script' -LogName 'Operations Manager' -EventId 335 `
                  -Message $Global:EventLog `
                  -EntryType Information
Write-Verbose $Global:EventLog 
Clear-variable -Name "EventLog" -scope Global

The mapping on the rule is as follows : 

I left it for a while to do it's thing. Although it's set for every 2 mins to run, I found sometimes when I built a new performance rule it could take an hour or so before I could initially start using the results in SquaredUp.

In SquaredUp, the tile performance metric is configured like this :

Conclusion : An example of how the SquaredUp Community MP can be used to combine performance values.    We are also doing it with SNMP queries on our PBX gateways - something that there is no SCOM MP for, and the SquaredUp Community MP fits right in for that.

If you found this useful, please leave a comment.  I might post some other bits and pieces about SquaredUp, SCOM and interesting things I'm doing.  :)

Wednesday, 24 February 2016

Reset Health on Alert Closure.

SCOM has two alert types. Monitors and Rules. 
Both need to be handled differently when resolving. Normally Monitor alerts will self close when the alert has been resolved, but in some cases we have users who will inadvertently close a monitor alert. 
 It can also be difficult to have users fully understand the difference between a rule and a monitor, and act appropriately. If the monitor alert is closed, and the underlying issue not resolved (eg low disk space), then you will not get further alerts unless the health state changes back to healthy and then unhealthy again.

Ideally it's easier to tell users just to "close" alerts, and not to have "reset health".

This posting on the Technet Wiki was one solution I'm implementing to make it easier for users.

Wednesday, 2 September 2015

OMS Performance Data

OMS can now collect performance data. Take a look at the link for more info

Friday, 7 August 2015

Emailing outstanding alerts from SCOM

Sometimes it's good to have a list of SCOM alerts mailed out, especially if your SCOM environment is not connected to a job management system.  
In our environment, we email out a list of alerts that are in the "New" resolution state, as a gentle reminder for people to sort it out.

I've split the email up with monitors and rules separately, due to the way we use SCOM. But its very straightforward to alter the script to not have this.
Add it as a scheduled task.
It's available on the TechNet Wiki

Monday, 3 August 2015

Microsoft Ignite NZ

Self-plug : I will be doing a joint presentation at Microsoft Ignite NZ in September on OMS, and analysing your data in the cloud.  Come to the session if you want to hear more about OMS being used in real life.

Wednesday, 29 July 2015

IIS Log rollover for OMS with SCOM alerting

Microsoft recommends that machines loaded into Microsoft Operations Management Suite (OMS that are running IIS, have their log rollover set to hourly.

However, once machines are added into OMS, it's entirely possible the IIS logs are changed, new sites are rolled, etc.  And there is no easy way to see if that had been done, or stay on top of it.

 As a solution I throw an alert in SCOM if any site is not configured to 'hourly'.
See my TechNet wiki articlefor a howto, and a handy script to set up IIS Log rollover via PowerShell.

Monday, 20 July 2015

I published an article about displaying OMS updates in SCOM.   Looks like I picked up the gold award System Centre from the Technet Wiki Ninja's. yay!