180 likes | 339 Views
CLI Shell. JBossNetwork Enterprise Manager Command Line Interface. Agenda. Overview of the CLI shell How to specify resources Go over each group of commands Basic Resource Inventory Control et. al. Overview. CLI is one of the two user interfaces
E N D
CLI Shell JBossNetwork Enterprise ManagerCommand Line Interface 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. 2 The Professional Open Source™ Company
Overview • 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 <command> 3 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 10001 • resource view –group “My Group” 4 The Professional Open Source™ Company
Basic Commands • login • login username:password@host • 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 <command to execute> • e.g. time resource list • sleep • Pause for N seconds • quit 5 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 6 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://127.0.0.1:2099' [Configuration : control] configSet = 'default' program = 'C:\jbem\server-jboss-1.0.8\hq- engine\bin\run.bat' 7 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 8 The Professional Open Source™ Company
e.g. Approve New Resources jbnem-shell::jbnadmin> resource list -platform [ Platform listing ] ID Name Platform Type Domain Name -- ---- ------------- ----------- 10001 192.168.0.4 Linux 192.168.0.4 jbnem-shell::jbnadmin> resource list -server [ Server listing ] ID Name Server Type State -- ---- ----------- ----- 10002 mazz-linux JBN Agent JBN Agent unknown 10005 mazz-linux JBoss 4.0 all JBoss 4.0 stopped 10004 mazz-linux Tomcat 5.5 Tomcat 5.5 unknown jbnem-shell::jbnadmin> autoinventory queue process approve -aiplatform 192.168.0.3 jbnem-shell::jbnadmin> resource list -platform [ Platform listing ] ID Name Platform Type Domain Name -- ---- ------------- ----------- 10001 192.168.0.4 Linux 192.168.0.4 10051 mazzlap Win32 192.168.0.3 jbnem-shell::jbnadmin> resource list -server [ Server listing ] ID Name Server Type State -- ---- ----------- ----- 10002 mazz-linux JBN Agent JBN Agent unknown 10005 mazz-linux JBoss 4.0 all JBoss 4.0 stopped 10004 mazz-linux Tomcat 5.5 Tomcat 5.5 unknown 10051 mazzlap Apache 2.0.52 Apache 2.0 unknown 10058 mazzlap JBN Agent JBN Agent unknown 10057 mazzlap JBN Server JBoss 3.2 unknown 10056 mazzlap JBN Tomcat Tomcat 4.1 unknown 9 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 10 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 -- -------- ------- ----------- ----- 10070 300 true Active Thread Count ActiveThreadCount 10066 300 true Active Thread Group Count ActiveThreadGroupCount 10064 10 true Availability Availability 10058 300 true JMS Message Cache Size TotalCacheSize 10062 10 true JVM Free Memory FreeMemory 10054 1800 true JVM Max Memory MaxMemory 10060 300 true JVM Total Memory TotalMemory 10068 300 true Transactions Active TxCount 10056 600 true Transactions Committed per Minute TxCommits1m 10052 600 true Transactions Rolledback per Minute TxRollbacks1m jbnem-shell::jbnadmin> metric view -value 10062 Retrieved JVM Free Memory from 'host JBN Server' (2:10006) Value: 47.2 MB Collection Time: 7/10/05 11:43:18 PM 11 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 12 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 13 The Professional Open Source™ Company
Control • 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 14 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 15 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 16 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 -- ------- ------- ------------- 10001 127.0.0.1:2144 7/9/05 7:06:10 PM 7/9/05 8:20:47 PM 17 The Professional Open Source™ Company
Q & A Thanks for your time! 18 The Professional Open Source™ Company