10.7. Monitoring WebSphere Application Server.

What should you configure in osagent.conf.xml to monitor your WebSphere application server / J2EE application ?

10.7.1. Checks for monitoring WebSphere application server

10.7.2. Example configuration for monitoring WebSphere

<!-- ... -->
<PROC>
  <PROCESS>
    <!-- check the node agent (listed as process in ps -ef) -->
    <PROCNAME>/usr/WebSphere/nodeagent/bin/java</PROCNAME>
    <ERRORLEVEL>ERROR</ERRORLEVEL>
    <DESCRIPTION>
      The NodeAgent of the application server isn't running.
      This is maybe a bad sign - but you can try to restart it by
      /usr/WebSphere/Deployment/bin/startNode.sh
    </DESCRIPTION>
  </PROCESS>
  <!-- check the websphere jvm (listed as process in ps -ef) -->
    <PROCNAME>/usr/WebSphere/appsrv/bin/java</PROCNAME>
    <ERRORLEVEL>ERROR</ERRORLEVEL>
    <DESCRIPTION>
    WebSphere isn't running - look at your SystemOut.log / SystemErr.log
    and restart it - if possible
    </DESCRIPTION>
  </PROCESS>
</PROC>

<WEBSPHERE>
  <WAS_HOME>/usr/IBM/WebSphere/AppServer</WAS_HOME>
  <WSADMIN_APPEND>-conntype SOAP -username test -password 123</WSADMIN_APPEND>

  <CLUSTER_STATE>
    <CLUSTER_NAME>ProdCluster</CLUSTER_NAME>
    <CELL_NAME>PRODCELL</CELL_NAME>
  </CLUSTER_STATE>

  <!-- member of ProdCluster is Clone01 -->
  <SERVER_STATE>
    <CELL_NAME>PRODCELL</CELL_NAME>
    <NODE_NAME>wassrv1</NODE_NAME>
    <SERVER_NAME>Clone01</SERVER_NAME>
  </SERVER_STATE>
</WEBSPHERE>

<SOCKETS>
  <CHECK4SOCKET>
    <!-- Maybe you have do define the right interface definition for
    your system http port, https port, admin console, servlet container etc. -->
    <INTERFACE>0.0.0.0</INTERFACE>
    <PORT>9080</PORT>
    <ERRORLEVEL>FATAL</ERRORLEVEL>
    <DESCRIPTION>Socket of servlet container doen't exists - check logfiles</DESCRIPTION>
  </CHECK4SOCKET>
  <!-- More sockets you want to check -->
</SOCKETS>

<WEBAPP>
  <APP2CHECK>
    <!-- Test your servlet container if the response is correct, also report
the reponse time (this will be done by default) -->
    <APPNAME>Web-Application-1</APPNAME>
    <HOST>www.myownwebserver.de</HOST>
    <PORT>80</PORT>
    <HTTPRQST>GET / HTTP/1.0</HTTPRQST>
    <TEXT2CHECK>if you can read this, the servlet works correctly</TEXT2CHECK>
    <ERRORLEVEL>ERROR</ERRORLEVEL>
  </APP2CHECK>
  <!-- More webapps you want to check -->
</WEBAPP> 

<LOGS>
  <LOGFILE>
    <LOGFILENAME>/usr/WebSphere/appsrv/logs/SystemOut.log</LOGFILENAME>
    
    <!-- java exceptions -->
    <LOGFILTER>
      <REGEX>.*Exceptions in thread.*</REGEX>
      <ERRORLEVEL>ERROR</ERRORLEVEL>
    </LOGFILTER>

    <!-- user logged off the app isn't important -->
    <LOGFILTER><REGEX>user.*logged off.*</REGEX></LOGFILTER>
    <LOGFILTER><REGEX>user.*no longer active in.*</REGEX></LOGFILTER>

    <LOGFILTER>
      <REGEX>.*</REGEX><!-- Everything unknown -->
      <PRIORITY>1000</PRIORITY>
      <!-- That is AFTER all default priorities! -->
      <ERRORLEVEL>WARNING</ERRORLEVEL>
    </LOGFILTER>
  </LOGFILE>
  <!-- More logs you want to check -->
</LOGS>

<SIMPLE>
  <!-- check if a connection to a WebSphere MQ Qmgr
       is possible
  <SCRIPT>
    <SCRIPTNAME>/home/osmart/bin/mqconnect -c 127.0.0.1(1415) -q qmgr1</SCRIPTNAME>
    <CHECKNAME>MQConnect</CHECKNAME>
    <CHECKPOINTNAME>qmgr1</CHECKPOINTNAME>
    <ERRORLEVEL>WARNING</ERRORLEVEL>
  </SCRIPT>
</SIMPLE>