Skip to main content

BES6.5 BAS6.6-all Platforms:Using bmsh to retrieve deployed archive"s name

  • February 15, 2013
  • 0 replies
  • 0 views

Problem:

Using bmsh to retrieve deployed archive's name from command prompt

  • Product Name: BES, BAS
  • Product Version: 6.5,6.6
  • Product Component: bmsh
  • Platform/OS Version: ALL

Resolution:

  1. Substitute "PleaseEnterYourServerName" with real hub name in the JavaScript below
  2. Copy and Paste the JavaScript as "displayModules.js"
  3. Start target Borland Management Agent (i.e. scu)
  4. Execute bmsh from command prompt where BES' environment variables are set by vbroker.sh (Unix) or vbroker.bat (Windows):
    # bmsh -user admin -pswd admin -realm ServerRealm displayModules.js

This is runable from any machine on your network

--------------

 
/* for BES6.5 or later */ 
var serverName = "PleaseEnterYourServerName"; 
var mgmtPort = bes.getManagementPort(bes.managementDomain); 
var hub = new Hub(); 
if (hub.connect(mgmtPort, serverName)) 
  print("connected to "  serverName   " at "   hub.getHost()); 
else { 
  print("unable to connect to " serverName); 
  quit(); 
} 
var configurations = hub.getConfigurations(); 
var ext = new Array(2); 
ext[0] = "war"; 
ext[1] = "ear"; 
for (conf in configurations) { 
  var configuration = hub.getConfiguration(configurations[conf]); 
  print("Configuration:" configuration.getName()); 
  var mos = configuration.getManagedObjects(); 
  for (managedObject in mos) { 
    if (mos[managedObject].getType() == "partition") { 
      print("\\tpartition - " mos[managedObject].getName()); 
      var fileNames = mos[managedObject].getFileNames(ext, true); 
      for (f in fileNames) 
        print("\\t\\t" fileNames); 
    } 
  } 
} 
hub.disconnect(); 
quit(); 


--------------

Old KB# 15238

#Security
#bmsh
#VisiBroker
#BorlandApplicationServer