This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Dynamic Managed Component question

I would like to create a dynamic managed component query to create a service. I would like the service to contain Net Monitor Devices but only those that also have an Oracle agent on the host that the Net Monitor is checking. I was hoping to use a query such as:

NetMonitorDevice where deviceReference.referredObject.agents instanceof DBO_Agent_Model 

but this does not work as an error says the NetMonitorDevice does not have a property "agents". I thought I was doing a "walk along a property path" because I could follow this path in the script console, but maybe not.

Is what I would like to do possible?

Thanks,

Kris 

  • Hello Kris,

    That basically should work, walking along the property path. Often people just use the wrong name for the property or need to go further down the path.

    Not tested (but you need to atleast do something like)

    NetMonitorDevice where host.agents instanceof DBO_Agent_Model

    But this may fail since agents is a list of objects.

    Your error looks like you tried: "NetMonitorDevice where agents instanceof DBO_Agent_Model", that will not work, since agents are not directly connected to the Netmonitor, instead they are attached to the host.
  • Hi Jan,
    Thanks for the response. It's good to know that I was on the right track. I had another look at this and your comment about failing because the result would be a list of objects was spot on. My walk along the property path was correct but it was returning a list and not a object. It was the error returned that was misleading me. If I do something like this:
    NetMonitorDevice where deviceReference.referredObject.name like '%dev%'
    it works.
    Thanks!
    Kris
  • So, I tried a different approach:

    NetMonitorDevice where deviceReference.referredObject.agents in (Agent where topologyTypeName = 'DBO_Agent_Model')

    and I get the same error:

    QueryException: java.lang.IllegalArgumentException: Type 'foglight-5:NetMonitorDevice:7' does not have a property with the name 'agents'

    However if I deliberately make a mistake in the query and look for a property called agent, I get this:

    NetMonitorDevice where deviceReference.referredObject.agent in (Agent where topologyTypeName = 'DBO_Agent_Model')

    QueryException: java.lang.IllegalArgumentException: Type 'foglight-5:Host:21' does not have a property with the name 'agent'

    So it looks like the walk down the property path is working but when it gets to the Host object it can't find the property agent, which is correct. But when I try to look for the property agents that does belong to Host, it says it doesn't belong to NetMonitorDevice. I don't understand why that is.

    Kris

  • Hello Kris,

    We have a much bigger Problem. The Host Field is not filled, it is an empty reference.
    This means we need to go another path. Unfortunately i can't find any.

    The problem is the Type "NetMonitorDevice", since it can be monitored from different Hosts (locations). So maybe a better solution would be to use another Topology Type like "NetMonitorDeviceMeasurement".

    This Type has a direct connected Host and Agents ...

    Hope this helps.

    Jan
  • Thanks Jan, I understand the problem much better now and understand why I couldn't do what I thought I might be able to do.
    Cheers,
    Kris