locked
SCOM 2012 Creating Computer groups via SDK weird issue RRS feed

  • Question

  • I've created connectors before for SCOM and I am actually using some code that works in one of my other connectors.  The problem here is very unusual.  In my code I am creating a series of computer groups based off of a list of apps and LOB classifications.  Here is the routine I am using to do this:

    public static void AddComputerGroup_AppAndClass(ManagementGroup mg, LOBEnvironment lob)
            {
                string membershipRule = CreateMembershipRule(lob.APP, lob.CLASS);
                CreatableObjectGroup cmoGroup = GetCustomMonitoringObjectGroup(
                    Computer.LOB_CONFIGURATION_MP, String.Format(@"Group.{0}.{1}", lob.APP, lob.CLASS),
                    String.Format(@"!LOB - {0} - {1}", lob.APP, lob.CLASS),
                    membershipRule);
                ManagementPack mp = GetManagementPack(mg, Computer.LOB_CONFIGURATION_MP);
                mp.InsertCustomEnterpriseManagementObjectGroup(cmoGroup, mpRefColl);
            }

    lob.APP and lob.CLASS have the forms "Application.Name" and "PROD" respectively.

    Now, no errors are thrown and the code runs perfectly.  The issue though is when I view the newly created groups in the OP console, they all have the form:

    "!LOB - Application.Name - PROD/!LOB - Application Name - Prod"

    The expected result is

    "!LOB - Application.Name - PROD"

    I thought I must have had something wrong in the code so I exported the MP I am updating to look at the XML and it shows for the DisplayString:

    <DisplayString ElementID="LOB.Configuration.Group.Application.Name.PROD">
           <Name>!LOB - Application.Name - PROD</Name>
    </DisplayString>

    When you view the properties of the computer group, the display name shows correctly as well:

    "!LOB - Application.Name - PROD"

    Now, some of my applications do not have two words in the name, so they appears without any "." in them.  For these, everything appears to be normal.  Through deductive reasoning, it appears there is a limitation on the display string where you cannot use a "." in the string as it translates it improperly.  My guess it thinks the string is the class name and some sort of parsing occurs twice to remove all the "."

    Anybody else see this type of behavior??



    Always seek the innovative solution.

    Thursday, March 14, 2013 4:18 PM

Answers

  • I'm a little confused what the issue is.  The display name is showing up double if contains a dot?  I don't know of any limitation that we can't have a dot in the display name.  Have you tried removing the dot to see if that corrects the issue?

    This posting is provided "AS IS" with no warranties, and confers no rights. Use of attachments are subject to the terms specified at http://www.microsoft.com/info/cpyright.htm

    • Marked as answer by Yog Li Tuesday, March 26, 2013 8:56 AM
    Friday, March 15, 2013 4:56 PM
  • Actually, you are 90% correct on the display name.  What happens is in the code the display name looks like this:

    !TEST - Application.Name - Prod

    Now, in the console under the groups view the display name will show up like this:

    !TEST - Application.Name - Prod\!TEST - Application Name - Prod

    You are correct in that removing the "." from the display name eliminates this issue, I tested that out yesterday and they come up normally.  My question then I guess is this behavior is expected and we cannot expect to put "." in our display name values?

    Thankfully I have a fix that was easy to implement, but I just found the whole issue curious.


    Always seek the innovative solution.

    • Marked as answer by Yog Li Tuesday, March 26, 2013 8:56 AM
    Friday, March 15, 2013 5:44 PM

All replies

  • I'm a little confused what the issue is.  The display name is showing up double if contains a dot?  I don't know of any limitation that we can't have a dot in the display name.  Have you tried removing the dot to see if that corrects the issue?

    This posting is provided "AS IS" with no warranties, and confers no rights. Use of attachments are subject to the terms specified at http://www.microsoft.com/info/cpyright.htm

    • Marked as answer by Yog Li Tuesday, March 26, 2013 8:56 AM
    Friday, March 15, 2013 4:56 PM
  • Actually, you are 90% correct on the display name.  What happens is in the code the display name looks like this:

    !TEST - Application.Name - Prod

    Now, in the console under the groups view the display name will show up like this:

    !TEST - Application.Name - Prod\!TEST - Application Name - Prod

    You are correct in that removing the "." from the display name eliminates this issue, I tested that out yesterday and they come up normally.  My question then I guess is this behavior is expected and we cannot expect to put "." in our display name values?

    Thankfully I have a fix that was easy to implement, but I just found the whole issue curious.


    Always seek the innovative solution.

    • Marked as answer by Yog Li Tuesday, March 26, 2013 8:56 AM
    Friday, March 15, 2013 5:44 PM