# Jolokia (remote JMX with JSON over HTTP)

**URL:** <https://community.wowza.com/t/jolokia-remote-jmx-with-json-over-http/373>\
**Category:** Wowza Streaming Engine\
**Tags:** server-administration\
**Created:** [May 20, 2011, 3:17pm UTC](https://community.wowza.com/t/jolokia-remote-jmx-with-json-over-http/373 "2011-05-20T15:17:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/system/32/447_2.png) [@system](https://community.wowza.com/u/system)\
**Post date:** [May 20, 2011, 3:17pm UTC](https://community.wowza.com/t/jolokia-remote-jmx-with-json-over-http/373/1 "2011-05-20T15:17:07Z")

</div>

Hello,

I just thought I would post something cool that I’ve come across. I’ve been looking for a way to access JMX functionality remotely without using Java. I was originally looking for something that would provide XML-RPC access, but then I found something better:

[http://www.jolokia.org/](http://www.jolokia.org/)

To implement on Amazon EC2, I added the following to my startup.xml:

```auto
<Download>
	<URL>http://www.jolokia.org/dist/0.90/jolokia-0.90-bin.zip</URL>
	<Destination>/opt/jolokia.zip</Destination>
	<Action>UNZIP</Action>
</Download>

```

Then, I changed the following in tuning/bin/setenv.sh:

```auto
JAVA_OPTS="-Xmx{JAVAMAXHEAPSIZE} -server -javaagent:/opt/jolokia-0.90/agents/jolokia-jvm6.jar"

```

Then, I added port 8778 to my EC2 security group (see here on how to choose a different port: [http://www.jolokia.org/agent/jvm.html](http://www.jolokia.org/agent/jvm.html)).

After startup, I was able to go to [http://ec2-123-123-123-123.compute-1.amazonaws.com:8778/jolokia/read/WowzaMediaServerPro:name=Connections](http://ec2-123-123-123-123.compute-1.amazonaws.com:8778/jolokia/read/WowzaMediaServerPro:name=Connections) and get the following response:

```auto
{"timestamp":1305929352,"status":200,"request":{
    "mbean":"WowzaMediaServerPro:name=Connections",
    "type":"read"
},"value":{
    "total":0,
    "modelerType":"com.wowza.wms.client.ConnectionCounter",
    "lastConnectAcceptedTimeString":"never",
    "lastDisconnectTimeString":"never",
    "lastDisconnectStampString":"never",
    "lastConnectAcceptedStamp":0,
    "totalAccepted":0,
    "lastDisconnectStamp":0,
    "lastConnectRejectedStamp":0,
    "current":0,
    "totalRejected":0,
    "lastConnectAcceptedStampString":"never",
    "lastConnectRejectedTimeString":"never",
    "lastConnectRejectedStampString":"never"
}}

```

See [http://www.jolokia.org/reference/html/protocol.html](http://www.jolokia.org/reference/html/protocol.html) for more details on what you can do, but you can do more than just read. You can write and execute as well. 😃

Anyway, hope this helps someone!

Security note: As is, this is wide open to anyone. A better option would be to load it on localhost (-javaagent:agent.jar=port=7777,host=localhost) and use Apache to redirect and handle authentication. I’ll update this post once I’ve figured out the easiest way to do that. 🙂

- david

---

<div class="post-metadata">

**Author:** ![Ian\_Beyer](https://avatars.discourse-cdn.com/v4/letter/i/e99b99/32.png) [@Ian\_Beyer](https://community.wowza.com/u/Ian_Beyer)\
**Post date:** [May 20, 2011, 7:51pm UTC](https://community.wowza.com/t/jolokia-remote-jmx-with-json-over-http/373/2 "2011-05-20T19:51:34Z")

</div>

Thanks for the tip!

---

<div class="post-metadata">

**Author:** ![Vasya\_Volkov](https://avatars.discourse-cdn.com/v4/letter/v/ba9def/32.png) [@Vasya\_Volkov](https://community.wowza.com/u/Vasya_Volkov)\
**Post date:** [March 23, 2012, 9:44am UTC](https://community.wowza.com/t/jolokia-remote-jmx-with-json-over-http/373/3 "2012-03-23T09:44:18Z")

</div>

YES! It’s great! Thank you!
