cancel
Showing results for 
Search instead for 
Did you mean: 

JMX calls to monitor Server

Former Member
0 Kudos

Hi,

I am writing external JMX client to monitor the following things:

Server State

NetWeaver Version

Can anyone help me with that ?

Thanks,

Urvish

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Urvish,

I had a similar problem figuring out via JMX if the instance is a server or dispatcher. The "problem" is, that "Entries" provides an array of Serializable: Here is my solution ( without try{}-catch() 😞


private static void printInstanceInfo(MBeanServerConnection mbsc, String nodeID, String cluster){
       Object sapInfo[] = {-1,"unknown"};
       ObjectName name = new ObjectName("com.sap.default:name=\"/System/System "  +   \\ 
                          Properties\",j2eeType=SAP_MonitorPerNode,SAP_J2EEClusterNode=" +   \\
                          nodeID+",SAP_J2EECluster="+cluster);
       Serializable temp[] = (Serializable[])mbsc.getAttribute(name, "Entries");
       for (int index =0;index<temp.length;index++){
            Serializable temp1[] = (Serializable[])temp[index];
            if ( ((String)temp1[0]).equals("SAPSTARTUP") )
		sapInfo[0] = Integer.valueOf((String)temp1[1]);
            if ( ((String)temp1[0]).equals("SAP_J2EE_Engine_Version") )
                sapInfo[1] = (String)temp1[1];
       }
       System.out.println("Status: "+sapInfo[0]);
       System.out.println("Version Info: "+sapInfo[1]);
}

I hope, it helps.

Andreas

Former Member
0 Kudos

Thanks Andrea!!!

That was useful.

So In order to get JMX connection it requires some 4 jar files in the class path. Can you please let me know how did you get that and is that distributable ?

Did you use the same approach of including 4 jar files in class path or different ?

Thanks,

Urvish

Answers (0)