JMX (Java Management Extensions) makes it possible to connect to the running Mireka process and set and view JRE and Mireka management online. Among others you can change log levels and monitor mail traffic.
JMX access is not enabled by default, because it is insecure without additional measures.
To enable, some Java command line parameters must be added as detailed below. JMX will be listening on all interfaces and no authentication will be required. Therefore it must be firewalled, otherwise anyone can connect to it. Even then, any local user can connect to it.
If it is switched on, and firewalled, JMX can be accessed either locally, or remotely via an SSH tunnel. The port is 4452, but RMI, the default remote access protocol of JMX, also uses a second, random port in the later phases, so it is practically impossible to use it across a firewall.
Uncomment the line starting with env JMX_OPTIONS
in the Upstart job configuration file, /etc/init/mireka.conf
.
Uncomment the JMX options line below the comment Enable JMX
in the /etc/default/mireka
configuration file.
Start Service Manager, bin/mirekaw.exe
, go to the Java
tab and add the following lines to the Java Options
edit box:
-Dcom.sun.management.jmxremote.port=4452 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false
Restart Mireka so the changes take effect.
putty -D 9999 -load mireka-session
Start jconsole:jconsole -J-DsocksProxyHost=localhost -J-DsocksProxyPort=9999 -debug
MeasureTraffic
filter publishes statistics in a JMX MBean object under the name
mireka:type=TrafficSummary.
It can be displayed for example using the jconsole
application of the JDK.