Tuesday, October 23, 2012

SCOM: Online Management Pack documentation

Today I was working on new Management Pack for SCOM 2012. As I was searching for a base class definition on the internet, I found this website which can be convinient if you need a quick peek at the System Center libraries. This website shows the System Center management packs contents and is easy to browse for class definitions, discoveries, rules and monitors.

Check it out: http://mpdb.azurewebsites.net/

Have fun!

Tuesday, May 22, 2012

Powershell: Split text file in multiple files

For importing computer entries in SCCM I had a rather big file with 35000 items in it. I wanted to take a phased approach and found a script to split the CSV file based on a number of lines per file. Script Center repository: http://gallery.technet.microsoft.com/scriptcenter/PowerShell-Split-large-log-6f2c4da0

I tweaked the script a little bit, so only the parameters that are necessary are File Name and Number of Lines Per File.

$linecount = 0
$filenumber = 1

$sourcefilename = Read-Host "What is the full path and name of the log file to split? (e.g. D:\mylogfiles\mylog.txt) "
$destinationfolderpath = Split-Path $sourcefilename -parent

$srcfile = gci $sourcefilename
$filebasename = $srcfile.BaseName
$fileext = $srcfile.Extension

Get-Content $sourcefilename | Measure-Object | ForEach-Object { $sourcelinecount = $_.Count }

Write-Host "Your current file size is $sourcelinecount lines long"

$destinationfilesize = Read-Host "How many lines will be in each new split file? "

$maxsize = [int]$destinationfilesize
 
Write-Host File is $sourcefilename - destination is $destinationfolderpath - new file line count will be $destinationfilesize

Write-Host "Writing part: $destinationfolderpath\$filebasename`_part$filenumber$fileext"
$content = get-content $sourcefilename | % {
 #Add-Content $destinationfolderpath\$filebasename_$filenumber.txt "$_"
 Add-Content $destinationfolderpath\$filebasename`_part$filenumber$fileext "$_"
  $linecount ++
  If ($linecount -eq $maxsize) {
    $filenumber++
    $linecount = 0
    Write-Host "Writing part: $destinationfolderpath\$filebasename`_part$filenumber$fileext"
  }
}

Wednesday, April 18, 2012

System Center 2012 Availability

The last month more and more System Center 2012 product guides, addons and other stuff was released.
Also the availability of the 2012 suite to Volume License Cusomers was already known by the public.

This week at MMS (no I'm not attending) the announcement was made that System Center 2012 is now generally available. So the coming weeks and months, more in-depth product knowledge will be shared Technet, forums, blogs and other media. Now the MVP's can finally share what they know already.

Just read a blog where Microsoft introduced a new console for creating basic management packs for Operations Manager 2007 and 2012: http://systemscentre.blogspot.com/2012/04/visio-management-pack-designer-for.html

Friday, January 13, 2012

SCOM: 2012 Wish List

Last week I was present at the first SCUG (System Center User Group) meeting for this year. It was a great source of information. Two speakers from Microsoft USA were present to tell us about the application monitoring feature (AviCode) and Network Monitoring feature. It looks great and promising!

As SCOM 2012 is going to be released and everyone is wondering what new features it might bring, I would like to share my ideas/wishes for the next SCOM releases. I'm pretty sure these are not available in SCOM 2012.
  • Remove boundary for sealed en unsealed MP's.
    • Microsoft Best Practices for SCOM conflict with available functionality in SCOM.
    • Using one management group all self developed MP's are unsealed and their is no way to include objects from those unsealed MP's in a distributed application.
    • Currently sealing is the only solution. However sealing breaks MP's in which MP templates are used. Yeeh!
  • Light-weight Operator Console for better performance
  • Scale down Authoring in Operator Console, move functionality to Authoring Console.
  • Increase usability
  • Decrease complexity
  • Create intuitive GUI layer on top of current console.
  • Ease up using the Authoring Console as it was easy to create MP's in MOM 2005 with the adminstrator console.
  • Possibility to use templates in the Authoring Console.
  • Allow role 'Author' to make use of the Management Pack templates. Currently only a SCOM Administrator is allowed to make use of them.
  • Dynamic component groups for DA's from the GUI to avoid XML usage.
  • Log file monitoring for circular log files
  • Out of the box better alert message possibities (read property bag definition from script, alert message templates)
  • Possibility to use XPath expressions in alert suppression or a GUI layer for xpath dummies, like $Data/Context/Params[Contains(Param[1],"Fatal"). This can be handy when monitoring error events in logfile
  • Review the current class model. There so much classes now. Is this really necessary? The new Network Monitoring features add classes for each component and each brand. Why not using multiple discoveries for 1 class?

If you have other good ideas/wishes, let me know!

Tuesday, August 16, 2011

SCCM: Get Drivers From Driver Packages (WQL)

I was searching for a way to list Driver Packages which contain Drivers. Why? I want to use Driver Packages without importing the drivers in SCCM.
Why? You can read about that here: http://hayesjupe.wordpress.com/sccm-osd-driver-best-practices/

I found an interesting script of Christjan which can detect differences in drivers between Driver Packages. The script contained the necessary WQL statements that I needed.

Here's the link to his script:
http://pr3m.pri.ee/blog/?p=653

Example WQL query for displaying the PackageID and Name of Driver Packages that contain drivers:

SELECT DPKG.Name,DPKG.PackageID FROM SMS_PackageToContent AS PTC

JOIN SMS_CIToContent AS CITC ON PTC.ContentUniqueID=CITC.ContentUniqueID
JOIN SMS_Driver AS DRV ON CITC.CI_ID=DRV.CI_ID
JOIN SMS_DriverPackage AS DPKG ON PTC.PackageID = DPKG.PackageID

Tuesday, August 9, 2011

SCCM: Task Sequence Import Fails with APPCRASH

Currently I'm working on automating the provisioning of SCCM environments.
One of the things that came along was exporting and importing Task Sequences between SCCM environments.
After automatically dealing with the package references I was ready to import them in the target SCCM deployment with my script.

Sadly, this didn't work. Even with the ConfigMgr Console it didn't work. As I was not presented with some kind of error, I searched the Event Viewer.

There I found multiple APPCRASH events (eventid 1000) on wmiprvse.exe.
So there had to be something in the Task Sequence export files that causes WMI to crash.

Many times WMI crashes because of bad queries or non-existing WMI classes, or ..... yep memory issues.

After (manually :'( ) comparing the two SCCM deployments, I found out I was missing the Microsoft Deployment Toolkit 2010 Task Sequence steps on the target SCCM deployment. After installing that, all issues were gone.

It would be nice though if the ConfigMgr console could present me with a simple error, stating that MDT was missing. Arghh.....

Tuesday, June 21, 2011

SCOM: Dynamic Group MaxDepth

This blog shows a trick to retrieve the right query depth when using contains/contained expressions in group membership rules.

If you don't know how these expressions work: Raphael Burri has an excellent blog about Dynamic Group Population: http://rburri.wordpress.com/2009/01/14/dynamic-group-membership-authoring-and-performance-impact-on-rms/

Whenever you use Contains or Contained (or their compliments NotContains or NotContained), you should use the attribute MaxDepth to save I/O on the RMS.

But how do you know what the MaxDepth is???

You could find this info in the Service Model from the Management Pack Guide. But not every MP Guide is equiped with a Service Model.
To overcome this, you can use the Group membership rule wizard (Query Builder) in the Operations Console.

In this example I want to group all IIS 7.0 Application Pools which are hosted on computers with a specific Computer Description. In most cases MaxDepth 1 will do, but not in this case.

For the Computer Description attribute I created an extended class based on Windows Computer. The attribute is filled with the value of a registry key found locally on the agent.

Let's see.....

Start the Create Group Wizard and go the the Dynamic Members tab:




















Click Create/Edit rules and select IIS 7.0 Application Pool class and click Add:

















Select the property drop down list and go to the last entry, which shows the host class. This shows that the IIS 7.0 Application Pool Class is hosted by the IIS 7.0 Web Server class.





















In the next steps select the parent classes until you reach the host class Windows Computer. For every host step, maxDepth is incremented.






So now you know that you'll have to use maxDepth="3" in Contains/Contained expressions on the Windows Computer class (or in my case a class which derives from this class).
The membership rule would look like this:


$MPElement[Name="Windows1!Microsoft.Windows.InternetInformationServices.2008.ApplicationPool"]$
$MPElement[Name="MicrosoftSystemCenterInstanceGroupLibrary6172210!Microsoft.SystemCenter.InstanceGroupContainsEntities"]$


$MPElement[Name="MyExtLib!MyExtLib.Windows.Computer.Extended"]$



$MPElement[Name="MyExtLib!MyExtLib.Windows.Computer.Extended"]/Description$

ContainsSubstring
Web Server LOB1





Of course you can create groups based on the host properties, but sadly this doesn't work on derived classes.
If you do can work with the host properties, the membership rule can look like this:


$MPElement[Name="Windows1!Microsoft.Windows.InternetInformationServices.2008.ApplicationPool"]$
$MPElement[Name="MicrosoftSystemCenterInstanceGroupLibrary6172210!Microsoft.SystemCenter.InstanceGroupContainsEntities"]$




$MPElement[Name="MicrosoftWindowsLibrary6172210!Microsoft.Windows.Computer"]$
$MPElement[Name="MicrosoftWindowsLibrary6172210!Microsoft.Windows.Computer"]/OrganizationalUnit$


ContainsSubstring
Web Servers


Wednesday, June 8, 2011

SCOM: Reserved Custom Attributes?

Today I came accross a post of Daniele Grandini in which he writes that the Exchange 2010 MP uses the Custom Attributes of alerts for it's internal Alert Correlation engine.

Why is this important to know? Custom Attributes can be used for notification purposes to send extra information.

I realised I know more Management Packs which also use these Custom Attributes. So here's a short list of the MP's:


  • Microsoft Biztalk Server MP 6.0.6703.0: Custom Field 1

  • Microsoft Group Policy 2003 MP (Converted): Custom Field 6

  • Microsoft SCCM MP 6.0.6000.2: Custom Field 1 and 6

  • nWorks VMware VEM MP 5.0.3.248: Custom Field 1 to 6 and 9, 10

This is what I came accross. It's possible these MP's use more custom attributes. Let me know when you want to add something to this list.


You can check this quickly by creating an alert view (MyWorkspace also possible), and show all alerts with a filter on custom attribute 1 to 10 with text '%'.