Skip to content
adatum
  • Home
  •  About adatum
  •  Learn Azure Bicep
  •  SCOM Web API
MPAuthoring

Creating seed discovery with Silect MP Author

  • 21/04/201507/01/2025
  • by Martin Ehrnst

FYI: This is now a built in feature in MPAuthor SP4


 

As a System Center Operations Manager Engineer (or what ever your title is) you are probably some what familiar with developing your own management packs, and if not, you most likely will end up in a situation where a colleague or a client want you to monitor his or hers custom developed application, or your environment requires you to do some MP development. There are many solutions out there to do the dirty work for you, and they are all good in their own ways. You can use the Authoring functions in your OpsMgr console (basic stuff available), Developers can use Visual Studio etc. My personal favorite is MP Author from Silect. This software is GUI oriented and will help you create management packs for any SW you want. Although, it has it limitations, it is also possible to edit the XML created through it’s wizard.

One of the things that is not possible to do in MP Author’s GUI is to create a seed class/discovery. If you’re not familiar with this concept there are many good articles available on the internet, but in short terms you create a class and discovery to find the smallest bit of your application (ie. registry key) and then target your other discoveries to the seed class.

In my case i had to develop a management pack that was print server related. I created a new target and discovery in MPAutor which would run against Windows Computer class. This discovery runs a WMI query for Print and Document services.

SELECT Name FROM Win32_ServerFeature WHERE ID=261

261 is the ID for Print and Document Services role installed (in this case) on all servers we would like to monitor.

demoappseed
seed discovery

Now, our seed discovery is created, and it is time to create discovery for your application it self.

I create a new registry target to find the “rest” of my application, base class now is Windows Local Application

demoappfulldiscovery demoreg

 

 

You could think our full discovery is finished now, but as you can see, our second discovery is targeted Windows Computer class.

demoappbaseclass

I wan’t this to target all computers that are running this application, “AdatumDemoApp.Seed” time for some .XML editing. Click “Edit XML” for your full discovery, and change this line:

Target="Windows!Microsoft.Windows.Computer

to

Target="AdatumDemoApp.Seed"

Wich is the name of the target you created (not the discovery name)
Look your discovery is now targeted your seed class. Time to import in your demo environment and see what’s not working 🙂

discoveryOK

 

 

Share this:

  • Click to share on LinkedIn (Opens in new window) LinkedIn
  • Click to share on X (Opens in new window) X
  • Click to share on Reddit (Opens in new window) Reddit
Operations Manager

HealthServiceStore.edb file growth

  • 25/03/201507/01/2025
  • by Martin Ehrnst

A while back i got an alert that system drive on one of our monitored servers was full. When examining what was consuming disk space I noticed that HealthServiceStore.edb, located in the agent’s Health Service State folder was way to large.

HealthServiceStore.edb is where the result of every workflow that runs on this agent is stored and sent to your Management Server(s). An agent running a lot of performance counters (Exchange, SQL etc) will probably have a larger database file than your average file server.

At first, i tried to flush the agents cache wich did not work. The next thing i tried was to run the “online store maintenance” task from OpsMgr console, this task will run a de-fragmentation of the database file.
onli

You can follow the result in the event log, HealthService (7404) Health Service Store: Online defragmentation is beginning a full pass on database ‘<C:\Program Files\Microsoft Monitoring Agent\Agent\Health Service State\Health Service Store\HealthServiceStore.edb>’.

Did this work? No, my database file was still huge.
The next thing to do, is to perform a “Dirty Defrag” on the DB file. To do this,

  • open your favorite shell and navigate to C:\Program Files\Microsoft Monitoring Agent\Agent\Health Service State\Health Service Store
  • Stop Healthservice.exe (Microsoft Monitoring Agent)
  • Run esentutl /r edb (recovery mode)
  • Start defragmentation by running esentutl /d HealthServiceStore.edb

esentutl

Your healthservicestore.edb should now have a normal size.

Do you have anything to include, please comment.

Share this:

  • Click to share on LinkedIn (Opens in new window) LinkedIn
  • Click to share on X (Opens in new window) X
  • Click to share on Reddit (Opens in new window) Reddit
Operations Manager

Export overrides to CSV, XML & HTML

  • 23/03/201507/01/2025
  • by Martin Ehrnst

To accomplish an internal goal, this script has been updated to accept parameters.

New version is available here and can be used like this Export-Overrides -managementserver -path -type -suffix

**

Originally, this script was published by Daniele Muscetta and Pete Zerger over at SystemCenterCentral.com. I adopted Dieter Wijckmans version to fit our needs.

Basicly we all need to find our way to document how our OpsMgr environment is configured. We all have our ways (some not) and we first started out using exporting our MP’s to excel with MPViewer where we manually added colours to rules that where disabled. That worked good for us, and we still use this method when we import management packs the first time, but maintaining these documents can be tough. For some time i have exported all unsealed management packs used for overrides to .csv files, and used those to track changes. Today i was asked if i could make them easier to read. Therefor i took the script we have been using (credits in top post) and modified it to include XML, CSV and HTML exports. With the HTML we are able to easily read the overrides, we can use CSV to edit in excel and XML export (you all know this) can be imported back to OpsMgr in case you need it.

In order to get this script running. You have to set your export path, enable or disable export types and define a suffix for your overrides management pack. All this is done in the “configuration area”

#====================================================================================================================
# AUTHOR:	DieterWijckmans (Dieter -Wijckmans -inovativ - be)
# DATE:		03/08/2012
# Name:		Export-Overrides2012.PS1
# Version:	1.2
#
# MODIFIED BY: MartinEhrnst (m a r t i n - e h r n s t - n o)
# MODIFY DATE: 18/03/2015
#
# COMMENT:	Export all your overrides to a CSV, XML & HTML files to keep for your reference.
#			Based on script of DanieleMuscetta and PeteZerger
#			http://www.systemcentercentral.com/BlogDetails/tabid/143/IndexID/78323/Default.aspx
#           
# 
# Usage:	Change your Management pack suffix, export location and Export types YES/NO.
#           Run script manually or with you favorite automation tool
#DontHassleTheCode
#
#=====================================================================================================================

#############################################################
################# CONFIGURATION AREA ########################
#Set export location
$locationroot = "PATH"
#Define your Overrides suffix
$MPSuffix = "SUFFIX"
#export methods
$CSV = "NO" #CSV export to use in excel etc.
$HTML = "YES" #HTML for easier readability
$XML = "YES" #enable if you want to import back toOpsMgr
################ END CONFIGURATION AREA ######################
##############################################################

#HTML OUTPUT STYLING
$Header = @""@ ##This will read out your server name. Run from a management server. $objCompSys = Get-WmiObject win32_computersystem $inputScomMS = $objCompSys.name #Initializing the Ops Mgr 2012 Powershell provider# Import-Module -Name "OperationsManager" New-SCManagementGroupConnection -ComputerName $inputScomMS #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} #Define the backup location #Get date $Backupdatetemp = Get-Date $Backupdatetemplocal = ($Backupdatetemp).tolocaltime() $Backupdate = $Backupdatetemplocal.ToShortDateString() $strBackupdate = $Backupdate.ToString() #Define backup location if((test-path $locationroot) -eq $false) { mkdir $locationroot } $locationfolder = $strbackupdate -Replace "/","-" $location = $locationroot + $locationfolder + "\" new-item "$location" -type directory -force #Delete backup location older than 15 days #To make sure our disk will not be cluttered with old backups we'll keep 15 days of backup locations. $Retentionperiod = "15" $folders = dir $locationroot echo $folders $now = [System.DateTime]::Now $old = $now.AddDays("-$Retentionperiod") foreach($folder in $folders) { if($folder.CreationTime -lt $old) { Remove-Item $folder.FullName -recurse } } #gets all UNSEALED MAnagement Packs with your defined suffix $mps = get-SCOMmanagementpack | where {$_.Sealed -eq $false -and $_.DisplayName -like "*$MPsuffix"} #loops thru them foreach ($mp in $mps) { $mpname = $mp.name Write-Host "Exporting Overrides info for Management Pack: $mpname" #array to hold all overrides for this MP $MPRows = @() #Gets the actual override objects $overrides = $mp.GetOverrides() #loops thru those overrides in order to extract information from them foreach ($override in $overrides) { #Prepares an object to hold the result $obj = new-object System.Management.Automation.PSObject #clear up variables from previous cycles. $overrideName = $null $overrideProperty = $null $overrideValue = $null $overrideContext = $null $overrideContextInstance = $null $overrideRuleMonitor = $null # give proper values to variables for this cycle. this is what we can then output. $overrideName = $override.Name $overrideProperty = $override.Property $overrideValue = $override.Value trap { $overrideContext = ""; continue } $overrideContext = $override.Context.GetElement().DisplayName trap { $overrideContextInstance = ""; continue } $overrideContextInstance = (Get-SCOMMonitoringObject -Id $override.ContextInstance).DisplayName if ($override.Monitor -ne $null){ $overrideRuleMonitor = $override.Monitor.GetElement().DisplayName } elseif ($override.Discovery -ne $null){ $overrideRuleMonitor = $override.Discovery.GetElement().DisplayName } else { $overrideRuleMonitor = $override.Rule.GetElement().DisplayName } #fills the current object with those properties $obj = $obj | add-member -membertype NoteProperty -name overrideName -value $overrideName -passthru $obj = $obj | add-member -membertype NoteProperty -name overrideProperty -value $overrideProperty -passthru $obj = $obj | add-member -membertype NoteProperty -name overrideValue -value $overrideValue -passthru $obj = $obj | add-member -membertype NoteProperty -name overrideContext -value $overrideContext -passthru $obj = $obj | add-member -membertype NoteProperty -name overrideContextInstance -value $overrideContextInstance -passthru $obj = $obj | add-member -membertype NoteProperty -name overrideRuleMonitor -value $overrideRuleMonitor -passthru #adds this current override to the array $MPRows = $MPRows + $obj } #FILE EXPORT - SEE CONFIGURATION AREA #CSV if ($csv -eq "YES"){ $filename = $location + $mp.name + ".csv" $MPRows | Export-Csv $filename } #XML see configuration if ($XML -eq "YES"){ Export-SCOMManagementPack -ManagementPack $mps -Path $location } #HTML see configuration $filename = $location + $mp.name + ".html" if ($HTML -eq "YES"){ $MPRows | ConvertTo-Html -Title "Overrides For $mp" -Head $Header | Out-File $filename } }

 

Share this:

  • Click to share on LinkedIn (Opens in new window) LinkedIn
  • Click to share on X (Opens in new window) X
  • Click to share on Reddit (Opens in new window) Reddit

Posts pagination

1 … 35 36 37

Popular blog posts

  • Azure Application registrations, Enterprise Apps, and managed identities
  • Azure token from a custom app registration
  • Creating Azure AD Application using Powershell
  • Migrate from Azure DevOps to GitHub - what you need to know
  • Azure AD authentication in Azure Functions

Categories

Automation Azure Azure Active Directory Azure Bicep Azure DevOps Azure Functions Azure Lighthouse Azure Logic Apps Azure Monitor Azure Policy Community Conferences CSP Monitoring DevOps GitHub Guest blogs Infrastructure As Code Kubernetes Microsoft CSP MPAuthoring OMS Operations Manager Podcast Powershell Uncategorised Windows Admin Center Windows Server

Follow Martin Ehrnst

  • X
  • LinkedIn

RSS feed RSS - Posts

RSS feed RSS - Comments

Microsoft Azure MVP

Martin Ehrnst Microsoft Azure MVP
Adatum.no use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it. Cookie Policy
Theme by Colorlib Powered by WordPress