---
title: "Dashboard and Web Server - How do I monitor a Webserver using the JMX-Server Plugin?"
description: "Monitoring a Webserver using the JMX-Server plugin requires modifying the Webserver start script to enable JMX flags and configuring the JMX-Server Sampler in Geneos. This process allows the plugin to access MBean attributes like Memory for monitoring Java applications."
url: "https://docs.itrsgroup.com/docs/faq/geneos/115004028629-geneos-dashboard-and-web-server-how-do-i-monitor-a-webserver-using-the-jmx-server-plugin/index.html"
---
1. Modify the Webserver start script.

![Webserver start script](https://docscdn.itrsgroup.com/faq/images/geneos/webserver-start-script.png)

```
JMX\_PORT=50505 # these two lines enable remote monitoring/profiling of the application

JMX\_FLAGS="-Dcom.sun.management.jmxremote.port=$JMX\_PORT -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false"
```

From the preceding steps, uncommenting those variables will allow the Webserver to run with the JMX flags. Once a Java application is run with JMX flags, JMX managers/clients such as JConsole and our JMX-Server plugin will now be able to monitor the MBean attributes (such as Memory) of the Java application.

2. Save the start script.
3. Start the Webserver.
4. Configure the JMX-Server Sampler.

```
<sampler name="centos_jmx_server_webserver">
    <sampleInterval>
        <data>1</data>
    </sampleInterval>
    <plugin>
        <jmx-server>
            <connectionSettings>
                <generic>
                    <connectionSetting>
                        <name>serviceURL</name>
                        <value>
                            <var ref="WebServerJMX"></var>
                        </value>
                    </connectionSetting>
                </generic>
            </connectionSettings>
            <aliases>
                <alias>
                    <name>$1</name>
                    <value>
                        <data>java.lang:type=Memory,*</data>
                    </value>
                    <showCommands>
                        <headlines>false</headlines>
                        <tableColumns>false</tableColumns>
                    </showCommands>
                </alias>
            </aliases>
            <columns>
                <column>
                    <label>attribute</label>
                    <rowTemplate>
                        <data>HeapMemoryUsage</data>
                    </rowTemplate>
                </column>
                <column>
                    <label>committed</label>
                    <rowTemplate>
                        <data>$1.HeapMemoryUsage.committed</data>
                    </rowTemplate>
                </column>
                <column>
                    <label>init</label>
                    <rowTemplate>
                        <data>$1.HeapMemoryUsage.init</data>
                    </rowTemplate>
                </column>
                <column>
                    <label>max</label>
                    <rowTemplate>
                        <data>$1.HeapMemoryUsage.max</data>
                    </rowTemplate>
                </column>
                <column>
                    <label>used</label>
                    <rowTemplate>
                        <data>$1.HeapMemoryUsage.used</data>
                    </rowTemplate>
                </column>
            </columns>
            <jproperties>
                <jproperty>
                    <data>-Xint</data>
                </jproperty>
            </jproperties>
            <idAttributes></idAttributes>
        </jmx-server>
    </plugin>
</sampler>
```

5. Save the Gateway setup.

The resulting Dataview will look something like this:

![JMX-Server Webserver dataview](https://docscdn.itrsgroup.com/faq/images/geneos/jmx-server-web-server-dataview.png)

This guide assumes that the Netprobe has been set up to run the JMX-Server plugin. For more information, see [JMX plugin documentation](https://docs.itrsgroup.com/docs/geneos/current/collection/jmx-server/index.html).


