SCOM: Windows Server Logical Disk Volume Name Added!

As you may be aware, the Windows server logical disks and mount points discoveries do not populate the Volume Name property. I have no idea why the product group left the label out of the original discovery script or why it hasn’t been added in any subsequent updates. It was easy enough to add back in. I disabled the original discoveries and created slightly modified ones that include the Volume Name property.

windowsdiskhelper_inventory1

This MP contains:

Overrides which disable the following discoveries:

  • MWS2003D!Microsoft.Windows.Server.2003.LogicalDisk.Discovery
  • MWS2008D!Microsoft.Windows.Server.2008.LogicalDisk.Discovery
  • MWS2008D!Microsoft.Windows.Server.2008.MountPoint.Discovery
  • MWS2012D!Microsoft.Windows.Server.6.2.LogicalDisk.Discovery

MWS2003D!Microsoft.Windows.Server.2003.MountPoint.Discovery (Already disabled by default)
MWS2012D!Microsoft.Windows.Server.6.2.MountPoint.Discovery (Already disabled by default)

New discoveries (all enabled by default) with slightly modified datasources:

  • WindowsDiskHelper.Server.LogicalDisk.NoMonitor.Group.Discovery (group to contain any disks with “NoMonitor” in the name)
  • WindowsDiskHelper.Microsoft.Windows.Server.6.2.LogicalDisk.Discovery
  • WindowsDiskHelper.Microsoft.Windows.Server.6.2.MountPoint.Discovery
  • WindowsDiskHelper.Microsoft.Windows.Server.2008.LogicalDisk.Discovery
  • WindowsDiskHelper.Microsoft.Windows.Server.2008.MountPoint.Discovery
  • WindowsDiskHelper.Microsoft.Windows.Server.2003.MountPoint.Discovery
  • WindowsDiskHelper.Microsoft.Windows.Server.2003.LogicalDisk.Discovery

windowsdiskhelper_discoveries1

Example code snippet from the Server 2012 Mount Point Discovery datasource:

Added code is in pink .

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
Function DoDiscovery(ByVal sTargetComputer, ByVal sTargetComputerID, ByVal oDisc, ByVal sMPElementID)
    Dim objMountPoints, objMountPnt, oInstance, strDeviceID, sLabel
    Dim objVolumes, objVol

    Set objMountPoints = WMIGetInstance("winmgmts:\\" + sTargetComputer + "\root\cimv2", "Win32_MountPoint")
    For Each objMountPnt In objMountPoints
        Set oInstance = oDisc.CreateClassInstance(sMPElementID)
        strDeviceID = FixVolumeName(objMountPnt.Volume)

        Set objVolumes = WMIGetInstance("winmgmts:\\" + sTargetComputer + "\root\cimv2", "Win32_Volume where DriveType = 3 and driveletter = null and DeviceID ='" & strDeviceID & "'")
        For Each objVol In objVolumes
            With oInstance
              .AddProperty "$MPElement[Name='Windows!Microsoft.Windows.Computer']/PrincipalName$", sTargetComputerID
              .AddProperty "$MPElement[Name='Windows!Microsoft.Windows.LogicalDevice']/DeviceID$", StripEndChar(GetWMIProperty(objVol, "Name", wbemCimtypeUseDefault, ErrAction_None))
              .AddProperty "$MPElement[Name='Windows!Microsoft.Windows.LogicalDevice']/Name$", StripEndChar(GetWMIProperty(objVol, "Name", wbemCimtypeUseDefault, ErrAction_None))
              .AddProperty "$MPElement[Name='Windows!Microsoft.Windows.LogicalDevice']/Description$", "Mounted Disk" ' "Description" property of win32_volume is <null>
              .AddProperty "$MPElement[Name='WindowsServer!Microsoft.Windows.Server.LogicalDisk']/FileSystem$", GetWMIProperty(objVol, "FileSystem", wbemCimtypeUseDefault, ErrAction_None)
              .AddProperty "$MPElement[Name='WindowsServer!Microsoft.Windows.Server.LogicalDisk']/Compressed$", GetWMIProperty(objVol, "Compressed", wbemCimtypeUseDefault, ErrAction_None)
              .AddProperty "$MPElement[Name='WindowsServer!Microsoft.Windows.Server.LogicalDisk']/Size$", GetWMIProperty(objVol, "Capacity", wbemCimtypeUseDefault, ErrAction_None)
              .AddProperty "$MPElement[Name='WindowsServer!Microsoft.Windows.Server.LogicalDisk']/SizeNumeric$", -1
              .AddProperty "$MPElement[Name='WindowsServer!Microsoft.Windows.Server.LogicalDisk']/SizeInMBs$", ExpressedInMB(GetWMIProperty(objVol, "Capacity", wbemCimtypeUseDefault, ErrAction_None))
              .AddProperty "$MPElement[Name='WindowsServer!Microsoft.Windows.Server.LogicalDisk']/DriveType$", GetWMIProperty(objVol, "DriveType", wbemCimtypeUseDefault, ErrAction_None)
              .AddProperty "$MPElement[Name='WindowsServer!Microsoft.Windows.Server.LogicalDisk']/SupportsDiskQuota$", GetWMIProperty(objVol, "SupportsDiskQuotas", wbemCimtypeUseDefault, ErrAction_None)
              .AddProperty "$MPElement[Name='WindowsServer!Microsoft.Windows.Server.LogicalDisk']/QuotasDisabled$", SwitchBoolean(GetWMIProperty(objVol, "QuotasEnabled", wbemCimtypeUseDefault, ErrAction_None))
              .AddProperty "$MPElement[Name='WindowsServer!Microsoft.Windows.Server.LogicalDisk']/SupportsFileBasedCompression$", GetWMIProperty(objVol, "SupportsFileBasedCompression", wbemCimtypeUseDefault, ErrAction_None)
              ' This is where we add the VolumeName property
              sLabel = GetWMIProperty(objVol, "Label", wbemCimtypeUseDefault, ErrAction_None)
              If Not IsNull(sLabel) Then .AddProperty "$MPElement[Name='Windows!Microsoft.Windows.LogicalDisk']/VolumeName$", sLabel		
            End With
        
            Call oDisc.AddInstance(oInstance)
        Next
    Next

    DoDiscovery = 0
End Function

DOWNLOAD HERE

2 Replies to “SCOM: Windows Server Logical Disk Volume Name Added!”

  1. how do i get the scom notification to report on the volume name?
    i have a custom smtp template for disk alerts, and would like to add the volume name

    1. @Brad,
      It’s a bit of a guess what you mean by “custom smtp template”.
      If you are talking about the html formatting that is now available in SCOM 2019 SMTP Email Channel configuration, then I don’t see a way to include the target class property, “VolumeName”. Unless… you configured a separate Command channel (PowerShell) that would trigger first and add the VolumeName to one of the alert custom properties, then include the custom property in your html email body of the second channel.

      If you are talking about some other SMTP template like this for example: https://monitoringguys.com/2015/01/30/scom-enhanced-email-notification-script-version-2-2/ , then you have a creative license to go get any of the properties of the alert source, including “VolumeName”, and include that value in your email body.

Leave a Reply

Your email address will not be published. Required fields are marked *