Deployed the python files to /usr/lib/check_mk_agent/plugins (mk_jolokia.py & mk_jolokia_2.py)
Added the jolokia.cfg file to /etc/check_mk
# Settings for authentication
protocol = https
server = "10.127.0.157:8080"
user = "my_user"
password = my_password
mode = "digest"
# use "basic_preemptive" if server responds with 403 forbidden even
# though user/password are correct
mode = "basic_preemptive"
suburi = "jolokia"
instance = None
I select “JVM tomcat threadpool levels” and add that as a rule for a specific server.
I need to fill in the name of the JVM / Threadpool, butr where can I find that?
Do I need to adjust anything else?
Have I forgotten to do something ?
You should use either mk_jolokia.py or mk_jolokia_2.py on one system, not both. It’s depending on you installed version of python which you should use.
As for access, you’ve created the user “my_user” in your tomcat-users.xml? On my tomcat servers I have something like this for the monitoring user:
Yes, monitoring just jolokia itself wouldn’t be very useful. It should actually discover the other applications as well. Just to make sure, these applications, they’re running on port 8080 as well, right?
Next is making sure jolokia can actually see them. In the output of: http://<your host>:8080/jolokia/list
you should be able to find the names of your applications. Does that work?
Ok, so that’s good. And also not, since CheckMK should pick it up then. Just wondering if it can be a rights issue. If, on the tomcat host, you run the check_mk agent directly, in the output there should be something like this:
Also, I just noticed, you deleted mk_jolokia.py and kept mk_jolokia_2.py. If you have python3 (a bit recent machine should have this), you should have kept mk_jolokia.py, which is for python 3.
Ah, ok, no worries. What’s the output if you run /usr/lib/check_mk_agent/plugins/mk_jolokia_2.py directly from the command line? That should give you the right output. If not, hopefully it produces an errormessage that’ll help fix this issue.
username@server:/usr/lib/check_mk_agent/plugins$ python mk_jolokia_2.py
<<<jolokia_info>>>
Error: mk_jolokia requires the requests library. Please install it on the monitored system.
Ok, so I understand it needs the requests library.
Phython’s library? Jolokia’s Library?
Hi Louis, thanks for the continued help, I appreciate it, I installed the requests module but then I run into an error message when I try to execute the phyton script again
Looks like an error in the plugin code. I’m not sure. It’s getting a bit out of my league now. But what I do know about python is that it’s very picky about indentation.
Mabe if you paste the content of mk_jolokia_2.py here it may show some hints on how to correct it:
I’ve got some good news, it seemed to be the bad formating of the jolokia.cfg file that was hindering the execution of the file. (there where TABS that shouldn’t have been there [not added by me, but where in the file already])
Now it executes without issue.
Now I get that output that you referenced earlier:
Hmmm, glad you got that working at least. It should pick up the services automatically then. So, is this the output from running mk_jolokia_2.py directly or from calling the agent? If from the first, do you see the jolokia info if you call the agent from the CheckMK server? Something like:
nc -v <tomcat server> 6556
That should have the jolokia section. If not, it’s probably a rights issue.
Oh, that’s why you don’t see it on the CheckMK server. It’s not getting the data. I’ve been in similar situations before and typcially it means that the environment settings in your interactive shell when you log in on the tomcat server are not the same. Most of the time that means some PATH or Library environment is not set when calling the agent over the network
Now, I’m no python expert (far from) but I guess you’ll need to find out what environmet settings you have and find a way to have those available when calling the agent via the network. Maybe adding something to /etc/bash.bashrc.local can do the trick.