1

Hello I´ve a problem when I try to monitor which one of a cluster oam servers is online and offline I use the the getServerDiagnosticInfo() method of AccessClient class from aSDK, but the Hashtable that returns only contains Keys (name and port of server) and Values that contains another HashTable (ObKeyMapVal a subtype of HashTable) but I think that this object must contains the health, server port, server name and number of connections as mentioned in the API doc but when I print the size and contents of it only prints "0" and [] (its empty)

snippet:

try{
   AccessClient ac =      AccessClient.createDefaultInstance("/dir",AccessClient.CompatibilityMode.OAM_10G);
   Hashtable info = ac.getServerDiagnosticInfo();
   Set<?> servers = info.keySet();
   Collection<?> serverInfo = info.values();
   System.out.println("Num of servers: " + servers.size());
   Iterator it = servers.iterator();

   Object servidor = null;
   Object dato = null;

   while(it.hasNext()){
     servidor = it.next();
     System.out.println("Server: " + servidor);
     dato = info.get(servidor);
     System.out.println("Data: " + dato);

     ObKeyValMap ob = (ObKeyValMap) dato;
     System.out.println("Size: " + ob.keySet().size());
     System.out.println("Is Empty: " + ob.keySet().isEmpty());
     System.out.println("Properties: " + ob.keySet());
  }

  ac.shutdown();
} catch (oracle.security.am.asdk.AccessException e) {
   e.printStackTrace();
} catch (Exception e){
   e.printStackTrace();
}

And got the next output:

Num of servers: 2

Server: myserver1.com5575 Data: {} Size: 0 Is Empty: true Properties: []

Server: myserver2.com5575 Data: {} Size: 0 Is Empty: true Properties: []

Thanks for your help !!!

1 Answers1

0

Once you get the OAM Server Host and Port using getServerDiagnosticInfo(). Try to do telnet ( I am not Java Expert, following link may help How to connect/telnet to SPOP3 server using java (Sockets)?) , if the server is up the telnet session will be established.

Community
  • 1
  • 1
anil
  • 961
  • 1
  • 11
  • 23