users@glassfish.java.net

logging mode for "asadmin monitor"

From: Wolfram Rittmeyer <w.rittmeyer_at_jsptutorial.org>
Date: Mon, 24 Mar 2008 11:28:38 +0100

Hello,

I wanted to use "asadmin monitor" in some scripts to periodically send
me some reports. Now there are some issues when trying to do this:

First I believe there is no logging/batch mode (like e.g. "top -l 1" or
"top -n 1", depending on which top version you are using). For a command
used to monitor s.th. I think this is essential. I could file an
enhancement request, but maybe I am only missing something?

Secondly "asadmin monitor --type xyz --filename xyz.log server" prints
monitoring results to stdout as well as to the file stated. Even an
additional "--terse" didn't prevent output from being printed on stdout.

A very weird behaviour occurs when issuing asadmin monitor with a
trailing "&" so to run in in the background (using filename and terse
again). The headline gets printed but afterwards no output gets printed
until I kill the process. Then all lines get printed at once.

Another problem is the process id returned:

$PATH_PREFIX/bin/asadmin monitor --type xyz --filename xyz.txt server &
ASADMIN_PID=$$

Now I get the PID of the asadmin command. But this command only issues
another java command. How do I get this PID (it probably is the asadmin
PID plus one, but not necessarily so)? If I had both PIDs I could kill
both processes in my skript afterwards and could work around the above
issues for the time being. On Linux the second process gets killed when
I kill the first one. But not so on Mac OS X.


Regards,

Wolfram Rittmeyer