4 Replies Latest reply on Oct 15, 2009 11:15 AM by Ian Springer

    The nested <service> is not called for Discovery

    Amit Bhayani Newbie

      Hi Guys,

      I am trying to write Plugin where the parent Service is manually added by user from JON Console. There is nested service which should be discovered automatically when the top service is added.

      Here is the rhq-plugin.xml to explain it better

      <?xml version="1.0" encoding="UTF-8" ?>

      <plugin name="MMSServer" displayName="MMS Server"
      package="org.rhq.plugins.mobicents.mediaserver" version="2.1"
      description="Monitoring of MMS servers"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns="urn:xmlns:rhq-plugin" xmlns:c="urn:xmlns:rhq-configuration">




      <plugin-configuration>
      <c:simple-property name="host"
      displayName="MMS Server listen IP" required="true"
      description="The IP Address where Mobicents Media Server is running" />
      <c:simple-property name="port"
      displayName="MMS Server listen Port" required="true"
      description="The port where Mobicents Media Server is listening on above IP">
      <c:constraint>
      <c:integer-constraint minimum="1"
      maximum="65535" />
      </c:constraint>
      </c:simple-property>
      </plugin-configuration>












      So now when user adds the 'MMSServer' service I want that 'Endpoint' Service should also be discovered.

      The above plugin gets deployed well and I can add 'MMSServer' service, but MmsEndpointDiscoveryComponent class is never called.

      Am I missing something?

      Thanks for your answer in advance

        • 1. Re: The nested <service> is not called for Discovery
          Amit Bhayani Newbie

          Posting xml again

          <?xml version="1.0" encoding="UTF-8" ?>
          
          <plugin name="MMSServer" displayName="MMS Server"
           package="org.rhq.plugins.mobicents.mediaserver" version="2.1"
           description="Monitoring of MMS servers"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xmlns="urn:xmlns:rhq-plugin" xmlns:c="urn:xmlns:rhq-configuration">
          
           <server name="MMSServerCheck" discovery="MmsDiscoveryComponent"
           class="MmsComponent" description="MMS Server pinging">
          
           <service name="MMSServer"
           discovery="MmsServiceDiscoveryComponent" class="MmsServiceComponent"
           description="One remote MMS Server" supportsManualAdd="true">
           <plugin-configuration>
           <c:simple-property name="host"
           displayName="MMS Server listen IP" required="true"
           description="The IP Address where Mobicents Media Server is running" />
           <c:simple-property name="port"
           displayName="MMS Server listen Port" required="true"
           description="The port where Mobicents Media Server is listening on above IP">
           <c:constraint>
           <c:integer-constraint minimum="1"
           maximum="65535" />
           </c:constraint>
           </c:simple-property>
           </plugin-configuration>
          
           <metric property="responseTime" displayName="Response Time"
           measurementType="dynamic" units="milliseconds"
           displayType="summary" />
          
           <metric property="status" displayName="Status Code"
           dataType="trait" displayType="summary" />
          
           <service name="Endpoint" class="MmsEndpointComponent"
           discovery="MmsEndpointDiscoveryComponent"
           description="MMS Endpoint" >
           </service>
           </service>
           </server>
          </plugin>
          


          • 2. Re: The nested <service> is not called for Discovery
            Amit Bhayani Newbie

            Ok I tried using the automatic discover service rather than manual one

            And as soon as I import the MMSServer on JON Console I see the DummyServer service and EndpointZzz service nested in it. Below is the xml

            Does that mean service that are added manually can't have nested ? Is this bug? Or suppose to behave like this?

            <?xml version="1.0" encoding="UTF-8" ?>
            
            <plugin name="MMSServer" displayName="MMS Server"
             package="org.rhq.plugins.mobicents.mediaserver" version="2.1"
             description="Monitoring of MMS servers"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xmlns="urn:xmlns:rhq-plugin" xmlns:c="urn:xmlns:rhq-configuration">
            
             <server name="MMSServerCheck" discovery="MmsDiscoveryComponent"
             class="MmsComponent" description="MMS Server pinging">
            
             <service name="DummyServer" discovery="DummyDiscoveryComponent"
             class="DummyComponent" description="some dummy Server">
             <metric property="status" displayName="Status Code"
             dataType="trait" displayType="summary" />
            
             <service name="EndpointZzz" class="DummyComponent2"
             discovery="DummyDiscoveryComponent2"
             description="DummyComponent2">
            
             <metric property="status" displayName="Status Code"
             dataType="trait" displayType="summary" />
             </service>
            
            
            
             </service>
            
             <service name="MMSServer"
             discovery="MmsServiceDiscoveryComponent" class="MmsServiceComponent"
             description="One remote MMS Server" supportsManualAdd="true">
             <plugin-configuration>
             <c:simple-property name="host"
             displayName="MMS Server listen IP" required="true"
             description="The IP Address where Mobicents Media Server is running" />
             <c:simple-property name="port"
             displayName="MMS Server listen Port" required="true"
             description="The port where Mobicents Media Server is listening on above IP">
             <c:constraint>
             <c:integer-constraint minimum="1"
             maximum="65535" />
             </c:constraint>
             </c:simple-property>
             </plugin-configuration>
            
             <metric property="responseTime" displayName="Response Time"
             measurementType="dynamic" units="milliseconds"
             displayType="summary" />
            
             <metric property="status" displayName="Status Code"
             dataType="trait" displayType="summary" />
            
             <service name="Endpoint" class="MmsEndpointComponent"
             discovery="MmsEndpointDiscoveryComponent" description="MMS Endpoint"
             createDeletePolicy="both">
            
             <metric property="status" displayName="Status Code"
             dataType="trait" displayType="summary" />
             </service>
             </service>
             </server>
            </plugin>



            • 3. Re: The nested <service> is not called for Discovery
              mazz Master

              nothing should be different (manual-add vs. auto-discovery) when dealing with resource hierarchies. You can have nested resources no matter how they are detected.

              When you manually-add, the workflow into the plugin is slightly different (in fact, we added a ManualAddFacet in the latest code tree to make it more obvious to the plugin developer writer).

              However, if you manually added a server successfully, I see no reason why the plugin container wouldn't (eventually) call the discovery component for its child types.

              I'm not quite sure why it is what you are seeing - perhaps Ian S. can help - I know he recently worked in this part of the code (he added the Manual-Add facet). Ian - any ideas of why this behavior is occurring?

              • 4. Re: The nested <service> is not called for Discovery
                Ian Springer Master

                Make sure the parent MMSServerCheck Resource is connecting (i.e. the corresponding ResourceComponent in the plugin is starting) successfully. To verify this, go to the Resource's Inventory>Connection tab and make sure there isn't a yellow warning box near the top of the page. If there is, try connecting again by editing the connection properties and saving them (no need to actually change any property values). Once you're sure the MMSServerCheck Resource is connected, kick off a full discovery scan by running "discovery -f -v" from the Agent prompt. If the child MMSServer Resources still don't show up in inventory in the GUI, check your Agent logfile for errors.