com.jamonapi
Class Mon

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by com.jamonapi.Mon
All Implemented Interfaces:
java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public class Mon
extends javax.servlet.http.HttpServlet

Servlet that enables the ability to take advantage of jamon by passing arbitrary strings to this servlet which subsequently calls start/stop/add on the MonitorFactory. The distribution comes with some bash scripts which should work on mac/linux/unix that allow you to take advantage of jamon facilities from your scripts. This can be used to track nightly running processes such as backups to name just one. The scripts simply take arguments and reformat them to calls to this servlet via either curl or wget whichever is installed. See them as well as jamon_readme.txt in the distribution zip in the directory osmon for more info.

Note if the calls was unsuccessful (to add/start/stop/get) then the error message is returned which starts with the keyword: Error. OK will be returned by add/start/stop if they are successful, but not get. get simply returns the value or error if there was a problem. script calls to jgetdata.sh don't call this servlet and so they don't return error if they fail, however you can check to see if they contain data.

Happy monitoring!

put this in web.xml file

<servlet>
       <servlet-name>Mon</servlet-name>
       <servlet-class>com.jamonapi.Mon</servlet-class>
  </servlet>

  <servlet-mapping>
    <servlet-name>Mon</servlet-name>
    <url-pattern>/Mon</url-pattern>
  </servlet-mapping>

 

Author:
stevesouza
See Also:
Serialized Form

Constructor Summary
Mon()
           
 
Method Summary
 void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
           
 void doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
           
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, service
 
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Mon

public Mon()
Method Detail

doGet

public void doGet(javax.servlet.http.HttpServletRequest request,
                  javax.servlet.http.HttpServletResponse response)
           throws javax.servlet.ServletException,
                  java.io.IOException
Overrides:
doGet in class javax.servlet.http.HttpServlet
Throws:
javax.servlet.ServletException
java.io.IOException

doPost

public void doPost(javax.servlet.http.HttpServletRequest request,
                   javax.servlet.http.HttpServletResponse response)
            throws javax.servlet.ServletException,
                   java.io.IOException
Overrides:
doPost in class javax.servlet.http.HttpServlet
Throws:
javax.servlet.ServletException
java.io.IOException