The Professional Open Source™ Company CLI Shell JBossNetwork Enterprise Manager Command Line Interface
2 The Professional Open Source™ Company Agenda Overview of the CLI shell How to specify resources Go over each group of commands Basic Resource Inventory Control et. al.
3 The Professional Open Source™ Company CLI is one of the two user interfaces The web-based JBN EM Console is the other Many things can be performed in both interfaces jbn-shell.[bat,sh] Upon startup, runs commands found in the script ~/.jbn/shellrc You can interactively enter commands You can execute a bulk set of commands by adding them to a script and running the script via the “ source ” command Help command provides help on commands help Overview
4 The Professional Open Source™ Company Specifying resources Many commands accept a resource as a command argument -platform -server -service -group -app Typically, you can specify a resource by name (“host.domain.com”, “My JBoss Server”) or by ID (10001) resource view –group resource view –group “My Group”
5 The Professional Open Source™ Company Basic Commands login login This can be the first line in ~/.jbn/shellrc to automatically log you in whenever you start the shell version license help help [command] [subcommand] e.g. help resource list source Bulk execute a set of commands time Times the execution of another command and reports the elapsed time once complete time e.g. time resource list sleep Pause for N seconds quit
6 The Professional Open Source™ Company Resource Export/Import resource inventory The full inventory can be exported to an.xml file or imported from an.xml resource export C:\inventory.xml List You can list all resources or just the resources of a particular type resource list -server View You can get a more detailed view of a resource (such as what resources are contained in a group, as an example) resource view –server "My JBoss Server" Configure and Set You can configure configuration settings for a particular resource Configure command configures all settings Set command configures one setting Rather than use this command, you typically configure a resource or set a particular resource’s configuration property from the GUI
7 The Professional Open Source™ Company e.g. Viewing a Resource jbnem-shell::jbnadmin> resource view -server “host JBN Server“ Server: host JBN Server (id=10006) Server Type: JBoss 3.2 Description: State: unknown Install Path: C:\jbem\server-jboss-1.0.8\hq- engine\server\default Owner: jbnadmin Location: Last Modified: 7/10/05 9:56:25 PM (by admin) Created: 7/9/05 11:00:40 PM [Configuration : resource] java.naming.provider.url = 'jnp:// :2099' [Configuration : control] configSet = 'default' program = 'C:\jbem\server-jboss-1.0.8\hq- engine\bin\run.bat'
8 The Professional Open Source™ Company Inventory Autoinventory This command provides ability to perform auto- discovery scans and to import resources into your inventory that were auto-discovered Start, stop Controls the scanning of new resources Schedule Schedule a scan to run in the future List History – shows previous scans Schedule – shows current schedule of scans Queue View Shows resources that were found during AI Process Approve or ignore resources found during AI
9 The Professional Open Source™ Company e.g. Approve New Resources jbnem-shell::jbnadmin> resource list -platform [ Platform listing ] ID Name Platform Type Domain Name Linux jbnem-shell::jbnadmin> resource list -server [ Server listing ] ID Name Server Type State mazz-linux JBN Agent JBN Agent unknown mazz-linux JBoss 4.0 all JBoss 4.0 stopped mazz-linux Tomcat 5.5 Tomcat 5.5 unknown jbnem-shell::jbnadmin> autoinventory queue process approve -aiplatform jbnem-shell::jbnadmin> resource list -platform [ Platform listing ] ID Name Platform Type Domain Name Linux mazzlap Win jbnem-shell::jbnadmin> resource list -server [ Server listing ] ID Name Server Type State mazz-linux JBN Agent JBN Agent unknown mazz-linux JBoss 4.0 all JBoss 4.0 stopped mazz-linux Tomcat 5.5 Tomcat 5.5 unknown mazzlap Apache Apache 2.0 unknown mazzlap JBN Agent JBN Agent unknown mazzlap JBN Server JBoss 3.2 unknown mazzlap JBN Tomcat Tomcat 4.1 unknown
10 The Professional Open Source™ Company Metrics Metric List Shows what metrics are configured for collection and values that have been collected over a date range Do “help metric list” for more interesting details View Shows metric details and live values Do “help metric view” for more interesting details Configure Configures a metric Create Disable Enable Delete Compact Compacts aging metric data and purges old data
11 The Professional Open Source™ Company e.g. list/view metrics for JBoss jbnem-shell::jbnadmin> metric list -server “host JBN Server“ Metric listing: 10 metrics found ID Interval Enabled Description Alias true Active Thread Count ActiveThreadCount true Active Thread Group Count ActiveThreadGroupCount true Availability Availability true JMS Message Cache Size TotalCacheSize true JVM Free Memory FreeMemory true JVM Max Memory MaxMemory true JVM Total Memory TotalMemory true Transactions Active TxCount true Transactions Committed per Minute TxCommits1m true Transactions Rolledback per Minute TxRollbacks1m jbnem-shell::jbnadmin> metric view -value Retrieved JVM Free Memory from ' host JBN Server ' (2:10006) Value: 47.2 MB Collection Time: 7/10/05 11:43:18 PM
12 The Professional Open Source™ Company Alerts Alert List Lists alerts that were raised The information provided is not as user-friendly as the information provided when the GUI lists alerts Delete Deletes alerts from a particular resource or during a particular date range (see help alert delete for interesting ways you can specify the date range) This is really the most useful of the alert/alertdef family of commands Alertdef List Create Delete The alertdef command is less commonly used – the GUI is typically used to perform the task of creating alert definitions
13 The Professional Open Source™ Company e.g. Purge alerts alert delete -from "now - 2 weeks " -to "7/10/2005 8:00am“ Deletes alerts that were triggered between the range of this time 2 weeks ago to the hard date of July 10, 2005 at 8:00am alert delete -from "now - 3 days" -to "now – 2 days" Deletes alerts that were triggered between the range of this time 3 days ago to this time 2 days ago alert delete -from "yesterday" Deletes alerts that were triggered anytime yesterday or later. See “help alert delete” for more info on date range specifications
14 The Professional Open Source™ Company Control List Lists control actions allowed for a particular resource Shows history of past executions of control actions Shows the current schedule of control actions to be executed in the future Schedule Schedules a control action to be performed some time in the future Perform Execute a control action immediately Configure Configures the control parameters for a particular resource
15 The Professional Open Source™ Company e.g. Listing Controls jbnem-shell::jbnadmin> control list -server "mazz-linux JBoss 4.0 all" Actions available for 2:10005: stop start restart jbnem-shell::jbnadmin> control list -server "mazz-linux JBoss 4.0 all” -history [ Control history listing ] User Date Started Action Duration Status jbnadmin 8/15/05 10:56:34 PM restart 00:00:00 In Progress jbnadmin 8/2/05 5:58:11 PM stop 00:00:09 Completed jbnadmin 8/2/05 2:35:10 PM stop 00:00:13 Completed
16 The Professional Open Source™ Company Agent Deployer deployer agent Start Stop Ping Install “help deployer agent” will show you properties you can set for better automation Secure – uses ssh Not supported on Windows platforms
17 The Professional Open Source™ Company Developer Commands Must set developer.commands property set developer.commands true Unsupported commands – some are ready for prime time, some are not e.g. “agent list” Useful to see all the agents on your network jbnem-shell::jbnadmin> agent list [ Agents listing ] Id Address Created Last Modified :2144 7/9/05 7:06:10 PM 7/9/05 8:20:47 PM
18 The Professional Open Source™ Company Thanks for your time! Q & A