Page tree
Skip to end of metadata
Go to start of metadata

This page briefly describes how to start working with MoSKito-Control.

Since MoSKito Control is pretty new, the page may become outdated fast. 

The page relies to the version 1.0.0.

Installing the Agent

MoSKito Control consists of two parts, the agent which is installed into the target (monitored) application and the MoSKito-Control webapp. For the version 0.2, that we are describing here, only the http connection between control and agents is realized. 

To enable the http agent in your web-application, simply add the following dependency to the pom.xml

            <dependency>
                <groupId>org.moskito</groupId>
                <artifactId>moskito-control-agent</artifactId>
                <version>1.0.0</version>
            </dependency>

If you don't use maven, simply download the lib from central and put it into your webapp/WEB-INF/libs folder.

If you are using a servlet container which supports servlet 3.0 (for example, tomcat 7) and jar scanning is enabled, that's all you need to do. The agent will be available under:

 

 

http://host:port/webapp/moskito-control-agent/status.

 

 

 

If you have an older container, add the following filter to your web.xml:

	<filter>
        <filter-name>ControlEndpoint</filter-name>
        <filter-class>org.moskito.controlagent.endpoints.http.HttpEndpoint</filter-class>
    </filter>

    <filter-mapping>
        <filter-name>ControlEndpoint</filter-name>
        <url-pattern>/moskito-control-agent/*</url-pattern>
    </filter-mapping>

Setting up the web application

To set up the web application, start with downloading it:

In either case you will need to provide some configuration. The configuration file is called moskitocontrol.json and is located under etc/appdata in repository. It should be located in the classpath (maven does that during build time). 

Among other settings it contains the list of supported applications and components per application, that you should fill out:

{
    "@applications": [
        {
            "name": "MyApp",
            "@components": [
                {
                    "name": "my-server-name1",
                    "category": "web",
                    "connectorType": "HTTP",
                    "location": "localhost:8080/myurl"
                },
                {
                    "name": "another-servet",
                    "category": "web",
                    "connectorType": "HTTP",
                    "location": "http://www.example.com"
                },
            ]
        },
        {
            "name": "AnotherApp",
            "@components": []
        }
    ],

Enter addresses of your machines, build the war,put it into another tomcat and you are ready to go (wink)

Furthermore you should have the following default components within the mentioned json file:

 "@connectors": [
        {
                "type": "HTTP",
                "className": "org.moskito.control.connectors.HttpConnector"
        }
    ],
    "@statusUpdater": {
        "checkPeriodInSeconds": 10,
        "threadPoolSize": 10,
        "timeoutInSeconds": 60,
        "enabled": true
    },
    "@chartsUpdater": {
        "checkPeriodInSeconds": 40,
        "threadPoolSize": 5,
        "timeoutInSeconds": 60,
        "enabled": true
    }

A more detailed example of the configuration File can be found here.

Enjoy!

 

  • No labels