Jolokia plugin returns ERROR: HTTP STATUS: 401

Hi,

I’m trying to get the mk_jolokia.py plugin to work to monitor my tomcat server. I’ve deployed the war to the tomcat server and if I run

lynx localhost:8080/jolokia

I can get in with the monitoring user and the password I setup in /etc/tomcat/tomcat-users.xml

In /etc/check_mk/jolokia.cfg I have:
server = “127.0.0.1”
port = 8080
user = “monitoring”
password = “”
mode = “digest”
vars = []
suburi = “jolokia”
instance = None

But if I test it by doing
telnet localhost 6556 I get this back:

<<<jolokia_info:sep(0)>>>
8080^@ERROR^@(‘HTTP STATUS’, 401)

So obviously something is wrong with the authorization part, but I can’t seem to find what piece I’m missing. Any help will be greatly appreciated.

Just a wild guess, but do you have any restrictions on which ip subnet can connect to your jolokia?
Besides that everything looks ok to me, your double quotes seems odd but it must be due to copy/paste or formatting.

Also you can try to specify different modes as in the config example.

Normally tomcat allows connection from localhost. The Plugin is called by the agent locally.

1 Like

But if you notice he tests it against localhost and specifies “127.0.0.1” as the server.
I don’t know his os config that’s why I asked. I just configured it once it worked like a charm. :slight_smile:

Thanks for the suggestion. So I changed it to:
server = “localhost”

in the config file. Unfortunately that did not work

But then I changed mode to basic_preemptive and now it’s working like a charm.

So thanks for the help.

2 Likes