2 Configuration - lucamingardi/jeeobserver GitHub Wiki

Configuring and starting jeeObserver server

First of all download jeeObserver_4_2_2 package from download page.

The jeeObserver server is the heart of the system and is included into jeeobserver.jar. The server receive and save all monitoring data and return them as statistics.

To run jeeObserver server you need only to put into classpath jeeobserver.jar

The server can be started in three different ways:

  • As web application: Including jeeobserver-server.war in your application server.
  • As a java application: Executing [JEEOBSERVER_PACKAGE]/server/bin/start.bat (or .sh if you use linux).
  • Manually inside a custom class: Including jeeobserver.jar into classpath and creating an instance of server as shown below
//Create jeeObserver server context. (start server)
JeeObserverServerContext.createInstance(5688);

//Wait for requests...

//Close jeeObserver server context. (stop server)
JeeObserverServerContext.close();

Server configuration parameters:

  • JOS_SERVER_PORT: The server port.

  • JOS_DATABASE_HANDLER: Database handler class name. (Default: jeeobserver.server.FileDatabaseHandler) If you want you can create your own database handler implementing jeeobserver.server.DatabaseHandler interface

  • JOS_SAMPLING_PERIOD: The statistics sampling period [DAY | HOUR | MINUTE | SECOND]. (Default: MINUTE)

  • JOS_STORAGE_PERIOD: The time period after that statistics will be automaticalluy deleted [Value + ' ' + MONTH | DAY | HOUR | MINUTE]. (Default: 3 MONTH).

  • JOS_LOGGER_LEVEL: The logger level [OFF | SEVERE | WARNING | INFO | FINE | FINER | FINEST | ALL]. (Default: INFO) FileDatabaseHandler configuration parameters:

  • JOS_DATABASE_FILE_PATH: File Database handler data folder. (Default: ./JEEOBSERVER_4_1) EmailNotificationHandler configuration parameters:

  • JOS_NOTIFICATION_EMAIL_SMTP_HOST: Email notification SMTP host.

  • JOS_NOTIFICATION_EMAIL_SMTP_PORT: Email notification SMTP port.

  • JOS_NOTIFICATION_EMAIL_SMTP_USER: Email notification SMTP username.

  • JOS_NOTIFICATION_EMAIL_SMTP_PASSWORD: Email notification SMTP password.

  • JOS_NOTIFICATION_EMAIL_FROM_ADDRESS: Email notification from address.

  • JOS_NOTIFICATION_EMAIL_FROM_NAME: Email notification from name.

  • JOS_NOTIFICATION_EMAIL_CONTENT_TYPE: Email notification content type [text/plain | text/html}. (Default: text/plain)

If the server is started as a web application these parameters are saved into properties file jeeobserver-server.properties (Example).

The file must be included into classpath of the application server. For example:

  • Apache Tomcat 5.5: [SERVER_DIR]/common/classes/
  • Apache Tomcat 6.x, 7.x: [SERVER_DIR]/lib/
  • jBoss 4.x, 5.x: [SERVER_DIR]/server/[SERVER_TYPE]/conf/
  • Glassfish 2.x, 3.x: [SERVER_DIR]/domain/[DOMAIN]/lib/classes/ etc...

You can set these parameter also as system variables and if the server is started as a Java application, these parameters can be specified inside start.bat or start.sh script file.

Configuring Java Web applications

Include jeeobserver.jar into application server common libraries folder (Do not include into WEB-INF/lib project folder).

To start monitoring of a java web applications is necessary to insert a servlet context listener into your web.xml

<web-app>
    <!-- jeeObserver Listener -->
    <listener>
        <listener-class>jeeobserver.JeeObserverListener</listener-class>
    </listener>
</web-app>

jeeObserver have 9 configuration parameters:

  • JO_CONTEXT: The unique name of the created context instance. (Default: DEFAULT_CONTEXT)
  • JO_SERVER_HOST: The jeeObserver server host. (Default: 'localhost')
  • JO_SERVER_PORT: The jeeObserver server port. (Default: '5688')
  • JO_BUFFER_SIZE: The maximum number of elements buffered. (Default: 100.000)
  • JO_TIMER_INTERVAL: The interval (milliseconds) of every jvm and hard disk snapshot and for every core request sent to jeeObserver server. (Default: 5.000 ms)
  • JO_SERVLET_PARAMETERS: Servlet observer include parameters that satisfy this regex (Ex: (.*) = all parameters, param1|param2 = only param1 and param2, ...)
  • JO_ENABLED: Enable / Disable all observers of context. Use only if jeeObserver server will be down for a long time.
  • JO_LOGGER_LEVEL: The logger level [OFF | SEVERE | WARNING | INFO | FINE | FINER | FINEST | ALL]. (Default: INFO)

Configuration parameters are saved into properties file jeeobserver.properties (Example).

The file must be included into classpath of the application server. For example:

  • Apache Tomcat 5.5: [SERVER_DIR]/common/classes/
  • Apache Tomcat 6.x, 7.x: [SERVER_DIR]/lib/
  • jBoss 4.x, 5.x: [SERVER_DIR]/server/[SERVER_TYPE]/conf/
  • Glassfish 2.x, 3.x: [SERVER_DIR]/domain/[DOMAIN]/lib/classes/ etc...

You can set these parameter also as system variables.

If a jeeObserver server instance is not running monitored data will be buffered until server startup.

Configuring Java applications

Include jeeobserver.jar into application classpath.

To monitor a java applications you must activate the jeeObserver context manually in this way:

//Create jeeObserver context
JeeObserverContext.createInstance("context_name", "localhost", 5688);

//Insert here your custom observers...

//Close jeeObserver context
JeeObserverContext.close();

If could specify other configuration parameters using other constructors of JeeObserverContext class.

If a jeeObserver server instance is not running monitored data will be buffered until server startup.

⚠️ **GitHub.com Fallback** ⚠️