Problem
- Product Name: BES
- Product Version: 6.0
- Product Component: bmsh
- Platform/OS Version: ALL
How to use bmsh to retrieve deployed archive"s name?
Resolution
The below bmsh script can be used to retrieve the deployed archives names for the given Hub. This script retrieves the names from "wars" and "ears" directory of the partitions.
-----------------------------------------------------------------------------------------------------------------------------------------------------
/*
for BES6.0
*/
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();
for (c in configurations) {
var configuration = hub.getConfiguration(configurations\\[c\\]);
print("Configuration:" configuration.getName());
var mos = configuration.getManagedObjects();
for (mo in mos) {
if (mos\\[mo\\].getType() == "partition") {
print("\\tpartition - " mos\\[mo\\].getName());
print("\\t\\t[deployed wars]");
var files = fso.files(bes.getManagedObjectDir(configuration.getName() "//" mos\\[mo\\].getName()) "\\\\wars");
for (f in files) print("\\t\\t" files);
print("\\t\\t[deployed ears]");
var files = fso.files(bes.getManagedObjectDir(configuration.getName() "//" mos\\[mo\\].getName()) "\\\\ears");
for (f in files) print("\\t\\t" files);
}
}
}
hub.disconnect();
quit();
-----------------------------------------------------------------------------------------------------------------------------------------------------
Steps to execute the script:
1. Substitute "PleaseEnterYourServerName"with real hub name in the script.
2. Save the script as "diplayModules60.js".
3. Start target Borland Management Agent (scu).
4. Execute bmsh from command prompt where BES"s environment variables are setted by vbroker.sh(Unix) or vbroker.bat(Windows).
# bmsh -user admin -pswd admin -realm ServerRealm displayModules60.js
This is runnable from any machine on your network.
#BES
#scu
#hub
#VisiBroker
#archive
#bmsh
#Security