
The jsmon program is a command line program for monitoring and management. It provides a means to inspect the state of a Java instance “directly”, that is with as few infrastructure demands as possible.
1. Call jsmon pf=
> jsmon pf=PRD_DVEBMGSxx_ciprdxx ****************************************** ***************************************** ***#####******####*****#######********* **##***##****##**##****##****##******* ***##********##**##****##****##***** ****###*****########***#######***** ******##****##****##***##******** **##***##**##******##**##******* ***#####***##******##**##***** ***************************** **************************** JStart Monitor Program Enter [prefix [arg]] <section> [command [options]] +-------+----------------+---------------------------------------------------+ |Section|Command |Description | +-------+----------------+---------------------------------------------------+ |jsmon |exit/quit |exit JSMon program | | |help |show help | | |view |show instance overview | | |repeat <command>|repeat <command> every 5 seconds | | |trace <level> |set JSMon trace-level |
2. Type jsmon help to list out all the command options available. From here, you can just execute the below command with options to display any status for instance, process, stop, start and shutdown.
> jsmon help Enter [prefix [arg]] <section> [command [options]] +--------+-----------------+-------------------------------------------------+ |Section |Command |Description | +--------+-----------------+-------------------------------------------------+ |jsmon |exit/quit |exit JSMon program | | |help |show help | | |view |show instance overview | | |repeat <command> |repeat <command> every 5 seconds | | |trace <level> |set JSMon trace-level | | |rows <num> |set the output length (number of rows to print) | | | |negative values specify the output length from | | | |the end of the table, i.e. the last <num> rows | | | | also as prefix: rows <num> <command> | | |page <num> |set the page length (rows between headers) | | | | also as prefix: page <num> <command> | +--------+-----------------+-------------------------------------------------+ |instance|view |show instance overview (static data) | | |start |start instance | | |stop [c] |stop (cluster stop) | | |shutdown [c] |shutdown (cluster stop) | | |terminate |terminate instance | | |restart |restart instance | | |reboot |reboot instance | | |inc |increment trace level | | |dec |decrement trace level | | |trace <comp> |set active trace components | | | |<comp> : [all,][efgijm] | | | |Upper case: active, lower case: inactive | | | | ALL/all: all components except those | | | | which are explicitly set | | | | E/e: Enqueue client library | | | | F/f: Startup Framework (jstart, jsmon) | | | | G/g: NLS functions | | | | I/i: Inter-process communication | | | | J/j: Java VM | | | | M/m: Kernel & networking | +--------+-----------------+-------------------------------------------------+ |process |view |list processes | | |start <idx> |start process <idx> | | |stop <idx> |stop process <idx> (hard shutdown) | | |shutdown <idx> |shutdown process <idx> (soft shutdown) | | |restart <idx> |restart process <idx> | | |reboot <idx> |reboot process <idx> | | |inc <idx> |increment trace level for <idx> | | |dec <idx> |decrement trace level for <idx> | | |trace <idx> |set active trace components for <idx> | | | <comp> |see "instance trace" | | |jmx <idx> |call JMX command <cmd> on <idx> | | | <cmd> | | | |sdump <idx> |trigger Java VM stack dump | | |hsdump <idx> |trigger Java VM heap & stack dump | | |cstack <tidx> |display call stack of thread <tidx> | | |tstack <tidx> |display task stack of thread <tidx> | +--------+-----------------+-------------------------------------------------+ |display |view |static instance data | | |locks |display locks | | |thread [a] |display threads (incl. unused) | | |cache |display caches | | |port |display ports | | |comp |display applications & services | | |ejb |display EJB sessions | | |web |display WEB sessions | | |roc |display remote object connections | +--------+-----------------+-------------------------------------------------+ |debug |view |list processes | | |start <idx> |start debug session: | | | <name> |<idx> : process index | | | <opt> |<name>: debug session owner name | | | |<opt> : additional options [c s l m k n] | | | | c : code isolation | | | | s : suspend execution | | | | l : load isolation | | | | m : migrate browser sessions | | | | to other servers | | | | k : keep debug session when process stops | | | | n : start debug session without debugger | | |stop <idx> |stop debug session | | |enable <idx> |open the debug port (without session) | | |disable <idx> |close debug port | | |migrate <idx> |migrate browser sessions to other servers | +--------+-----------------+-------------------------------------------------+ |lb |start <idx> |include process <idx> in load balancing | | |stop <idx> |exclude process <idx> from load balancing | +--------+-----------------+-------------------------------------------------+ |test |get <key> |return profile value for <key> | | |set <key>=<value>|set/overwrite profile value | | |expand <expr> |expand profile expression | | |split <expr> |split expression into strings | | |config <key> |show configuration value | | |load <pfx>=<file>|load configuration file | | |profile <key> |show instance.profile value |
3. As an example, you can display the process running under the instance.
> process view Processes: +---+----------+----+-------+---+---+-------+---------+----+-------+------+------+------+ |Idx|Name |PID |State |Err|Run|LBrestr|Cluster |Exec|Threads|Caches|AccPts|BrSess| +---+----------+----+-------+---+---+-------+---------+----+-------+------+------+------+ | 3|SDM |4140|Running| 0| 0| false| 0| yes| 0| 0| 3| 0| | 2|server1 |4139|Running| 0| 0| false|306765851| yes| 0| 0| 1| 0| | 1|server0 |4138|Running| 0| 0| false|306765850| yes| 0| 0| 1| 0| | 0|dispatcher|4137|Running| 0| 0| false|306765800| yes| 0| 0| 5| 0| +---+----------+----+-------+---+---+-------+---------+----+-------+------+------+------+ |Productive servers | 4 | |Restricted servers | 0 | |Applications | 0 | |Shared caches | 0 |




How to run jsmon non-interactively just to check if the j2ee system is up and running?
I’ve tried the below Unix command and it does not work.
echo “jsmon view” | jsmon pf=/sapmnt/SID/profile/SID_XX_server
Alternatively, how do I monitor, automated, if the J2EE system is running?