Home
Manual
sf.net
Published: 09/09/2005 22:41:42
   

WLWatchman Manual :: Command line usage

Use at the command line

For those without access to a GUI desktop, or who want to script WLWatchman or leave it as a long-running, background task, it can be run from the command line. This page details the different switches that can be used with the start scripts.

Command line options

Shell scripts for DOS and UNIX are provided.

The available command-line switches are:

--consoleuse WLWatchman in GUI mode
--no-consoleuse WLWatchman in command-line mode
--config-file fileconfiguration file
--allprint out all available MBeans
--formatter classnamethe formatter class to use by default
--include-file ifileuse with --all to include specific objects
--exclude-file xfileuse with --all to exclude specific objects
--available-file filewhere to put the '--all' output
--username usersystem username for WebLogic domain
--password passsystem password for WebLogic domain
--admin-url urlURL for admin server of WebLogic domain
--repeat npoll for statistics n times; 0 means forever
--refresh Npoll for statistics every N seconds
--monitor-file filewhere to put the monitoring output
--appendappend to the output file
--no-appendoverwrite the output file
--date-format sformat string for dates in the the output file
--helpdisplay this message

More details of these switches are given below.

Details

--config-file file

The config file is an XML file containing details of each server to contact, which MBeans to query on the server and which attributes to monitor.

--all
--available-file file
--include-file ifile
--exclude-file xfile

Passing "--all" on the command-line will make WLWatchman connect to the admin server to fetch a list of configured servers in the domain and the contact each server in turn, including the admin server, to fetch a full list of every Runtime MBean in the server. It then interrogates the MBean for a list of available attributes and their types. By default this places its output in "config.xml" but this can be overridden with the "--available-file" argument. Also, by default, all MBeans are queried. This can be a little overwhelming so you can place a list of MBeans you don't want to analyse in "xfile" and pass it on the command line. If you want to be even more choosy, you can specify only which objects to return by using "--include-file" and passing a file containing the names of only those objects you want. If both excludes and includes files are given, the excludes is ignored. Sample includes and excludes are provided.

--username user
--password pass
--admin-url url

These arguments override the admin server settings in config.xml. If you don't have a config.xml and are running WLWatchman with "--all" in order to get a configuration file, these are required on the command line to allow a connection to the admin server.

--repeat n

By default, WLWatchman will keep going until the process dies. This behaviour can be modified by passing in an integer here. A non-zero value will cause the monitor to poll for statistics a given number of times only and then exit.

--refresh N

The default time between polls is 5 seconds, this can be increased or decreased in second increments by setting this argument. Note that a value less than 1 causes WLWatchman to default back to 5 seconds.

--monitor-file file

This option specifies the root or end of the output file. The default is "WLWatchman.csv" which leads to files such as "myserver-default-WLWatchman.csv" for the "default" execute queue on "myserver". As the full filename is constructed from the MBean under scutiny (and you get one file per MBean) the filenames can get a tad long.

--append
--no-append

These arguments specify whether the monitor output overwrites an existing outout file or is appended to it. This applies to all output files. If "--append" is chosen, and you've specified the CSV formatter in the <object> tag, you don't get any header if the file is already there. If the file isn't there, you get the CSV header regardless of whether you choose --append or --no-append.

--formatter classname

Each monitored object can havbe a separate formatter associated with it which is responsible for the output for that object. When constructing a config.xml with the "--all" optiona above, you can use this option to fill in a default formatter for each object. It can also be used when your config.xml does not have formatters specified for all the objects.

--date-format s

Dates are written using the same format string across all objects and formatters. The details for the string can be found in the JavaDoc for java.text.SimpleDateFormat.

--help

Displays the various command line options and exits.