Connecting to Mbean fromSCOM | Community
Skip to main content
varung44569684
Level 2
October 16, 2015
Solved

Connecting to Mbean fromSCOM

  • October 16, 2015
  • 4 replies
  • 1300 views

Hi,

Can someone help me on how to connect to a Mbean in CQ from SCOM  .Just like it is done for tomcat.   It would be great if someone can provide me the format of the xml that is used to connect to Mbean in CQ from SCOM.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by smacdonald2008

You can call MBean operations on AEM using Java APIs located in http://docs.oracle.com/javase/7/docs/api/javax/management/package-summary.html

You use these APIs within a Servlet. We have a community article that talks about how to retrieve the number of stale workflow items as an example. See: 

Creating Adobe Experience Manager Sling Servlets that invoke MBean operations


 

4 replies

Venugopal_Gumma
Level 3
October 16, 2015

its not clear what you are trying to do ..

smacdonald2008
Level 10
October 16, 2015

Can you please explain your use case a bit more. 

varung44569684
Level 2
October 16, 2015

Hi Donald/Venu , 

Actually SCOM is a microsoft utility to monitor the status of various applications instances . To Monitor it does not contact the Application directly , It calls the beanspy and inturn beanspy is linked to the application using Mbean , For that there is an xml configured on the SCOM/beanspy side which calls the method of particular Mbean, The same approach is followed with tomcat also .

I have a sample of the xml file that is used while using Tomcat with Scom .

Tomcat application discovery XML:

 

<Configuration>

  <ComputerName>$Target/Host/Property[Type="JEE!Microsoft.JEE.ApplicationServer.Monitored.Instance"]/HostName$</ComputerName>

  <Protocol>$Target/Host/Property[Type="JEE!Microsoft.JEE.ApplicationServer.Monitored.Instance"]/Protocol$</Protocol>

  <Port>$Target/Host/Property[Type="JEE!Microsoft.JEE.ApplicationServer.Monitored.Instance"]/Port$</Port>

  <BaseURL />

  <JMXQuery>Catalina:j2eeType=WebModule,*</JMXQuery>

  <AdditionalArguments>&amp;MaxDepth=1</AdditionalArguments>

  <RequestBody />

  <HealthyExpression>

    <SimpleExpression>

      <ValueExpression>

        <!-- The XPATH if it were applied directly against the XML in a browser should look like: -->

        <!-- /MBeans/org.apache.catalina.mbeans.ContextMBean[@objectName = "Catalina:j2eeType=WebModule,name=//localhost/,J2EEApplication=none,J2EEServer=none"]/Properties/state -->

        <XPathQuery Type="String">MBeans/MBean[@Name='org.apache.catalina.mbeans.ContextMBean' and @objectName="$Target/Property[Type="JEE!Microsoft.JEE.Application"]/ObjectName$"]/Properties/Property[@Name='stateName']</XPathQuery>

      </ValueExpression>

      <Operator>Equal</Operator>

      <ValueExpression>

        <Value Type="String">STARTED</Value>

      </ValueExpression>

    </SimpleExpression>

  </HealthyExpression>

  <NotHealthyExpression>

    <SimpleExpression>

      <ValueExpression>

        <!-- The XPATH should look like: -->

        <!-- /MBeans/org.apache.catalina.mbeans.ContextMBean[@objectName = "Catalina:j2eeType=WebModule,name=//localhost/,J2EEApplication=none,J2EEServer=none"]/Properties/state -->

        <XPathQuery Type="String">MBeans/MBean[@Name='org.apache.catalina.mbeans.ContextMBean' and @objectName="$Target/Property[Type="JEE!Microsoft.JEE.Application"]/ObjectName$"]/Properties/Property[@Name='stateName']</XPathQuery>

      </ValueExpression>

      <Operator>NotEqual</Operator>

      <ValueExpression>

        <Value Type="String">STARTED</Value>

      </ValueExpression>

    </SimpleExpression>

  </NotHealthyExpression>

  <IntervalSeconds>900</IntervalSeconds>

  <TimeoutSeconds>300</TimeoutSeconds>

</Configuration>.

 

 

 

So I am looking for a sample xml that can be similarly used to calls the mbeans present on the webcq side.

smacdonald2008
smacdonald2008Accepted solution
Level 10
October 16, 2015

You can call MBean operations on AEM using Java APIs located in http://docs.oracle.com/javase/7/docs/api/javax/management/package-summary.html

You use these APIs within a Servlet. We have a community article that talks about how to retrieve the number of stale workflow items as an example. See: 

Creating Adobe Experience Manager Sling Servlets that invoke MBean operations