Outputting registry values for certain topology objects (within FSMService) - Foglight for Databases - Foglight for Databases - Dell Community

Outputting registry values for certain topology objects (within FSMService)

Outputting registry values for certain topology objects (within FSMService)

This question is not answered

Hi,

I'm working on a WCF function that invokes the TopologyService & the RegistryService. My ambition is to map topology objects (Virtual Machines) that exist inside FSMServices to a custom registry variables values. These values is bound to the FSMServices Virtual Machines as their topology objects, see screenshot.

The issue I'm facing is with in a WCF function. I'm trying to match the VM objects within the FMS Service that is parameterized and inputted to the function with the Unique ID of VM object that is bound to the registry value (Screenshot). I will paste the code that I'm using for this:

//Find registry variable for this host
// value = regKonto.getRegistryValues()
// regValues is the all the registry values from my custom registry variable
for(value in regValues)
{

//TEST//
isTrue= "falseAgain"

//host contains all the child objects in the FMSService that is parameterized, they are VMs
def host = row.get("host")

//Get the unique id's (They are Strings)
//Here is where I'm trying to get the unique ID of the VM object in the registry value
def idA = value.getEntityObject().getObjectUniqueId()


if(host != null)
{
      //TEST
      isTrue= "trueAgain"

      // Here I get the unique ID of the FSM Service VM object
      def idB = host.getUniqueId()

       // WHEN I'M TRYING TO COPMPARE THE OBJECTS THEY ARE NOT THE SAME UNIQUE ID???
       if( idA.equals(idB) )
            {
            regValue = value.getEntityObject().getValue() as String
            }

//TEST
WhatIsidA = idA
//TEST
WhatIsidB = idB

}

The problem is that I don't recieve the same unique ID for these objects. Am I using the wrong method to get the unique ID for the registry value? I can't find any replacement for in the WCF API (Foglight Service Layer).

Thanks,

Erik Alm

All Replies
  • Hi


    in general it's not recommended to operate on RegistryVariables/Values in scripts unless it's for editing purposes as deep copies of internal state are being generated which has generally been proven as very slow (high CPU usage).


    Normally one should use the registry() function to look up correct values, the magic of finding the correct, most closely associated value, happens behind the scene, fast.

    I'm working on a WCF function that invokes the TopologyService & the RegistryService. My ambition is to map topology objects (Virtual Machines) that exist inside FSMServices to a custom registry variables values. These values is bound to the FSMServices Virtual Machines as their topology objects, see screenshot.

     

    Just for a better understanding, there are values bound to virtual machines or rather the associated services (I believe there's a service for every VM?). Where is the result of this calculation used?

    Could you elaborate why the default registry() functionality does't do the job?

     

    Regards

    Nils

  • Hi Nils,

    Thanks for the response!

    We already have a customer whom recieve custom scheduled Chargeback reports. Now the customer wants to add more functionality.

    Thus we created a registry variable that will contain registry values for all components in the FSM Services, these are in fact VMs in their own detertemental categories. The registry values will be account codes that will be used to weight the cost for different VM resources and. I haven't reach a result yet because I can't find a proper way to assign the registry values to the correct VMs. This is where I need help!

    In response to the performance issue, if these would be generated once a week just ine time, do you still think it would be an issue?

    Could you elaborate on the usage of the registry() function? Is this an default foglight function that can be called upon? Could you provide a simple example, or point me in a direction?

    Thank you,

    Erik Alm 

  • Hi again,

    I've learned that the uniqueId for registry objects and VM objects are not the same and that means I'll never going to be able to compare using that.

    But what I can get out of both these two objects is the name of the VM. I'd to perform som work on both the names in order for them to be exactly the same. That isn't the issue, rather when I compare the both names which I can't seem to do without receiving an exception. 

    I've tested it a lot and know for sure that it all comes down to the comparison, I'm using .equals which in groovy should compare the string not the object right?

    I also know for sure that these strings are: the same type java.lang.string, the same length, and because that I loop through all the registry object VM names and compare it to the current host.get("name"), I should compare them against eachother.

    Here is the entire script. The comparison that doesn't work is on line 300

    1362.MASTERSCRIPT_v4.txt

    The error message I get is:

    message: com.quest.nitro.service.sl.interfaces.scripting.ScriptingException: com.quest.nitro.service.sl.interfaces.scripting.ScriptAbortException: java.lang.ArrayIndexOutOfBoundsException: 1

    Can you see what I'm doing wrong?

    Thanks,

    Erik