Configuring tomcat to checkmk monitoring

Hi i m trying to configure the tomcat to checkmk .
But i am getting error as

  • cd /usr/lib/check_mk_agent/plugins
  • for skript in ‘./*’
  • is_valid_plugin ./mk_jolokia.py
  • pattern=’.dpkg-(new|old|temp)$’
  • [[ -f ./mk_jolokia.py ]]
  • [[ -x ./mk_jolokia.py ]]
  • [[ ! ./mk_jolokia.py =~ .dpkg-(new|old|temp)$ ]]
  • true
  • ././mk_jolokia.py
    ERROR: (‘Connection aborted.’, BadStatusLine("’’",))
    ERROR: (‘Connection aborted.’, error(111, ‘Connection refused’))
    <<<jolokia_info:sep(0)>>>
    tomcat90LB1^@ERROR^@(‘Connection aborted.’, BadStatusLine("’’",))
    <<<jolokia_info:sep(0)>>>
    tomcat90LB2^@ERROR^@(‘Connection aborted.’, error(111, ‘Connection refused’))
  • for skript in ‘[1-9]/
  • is_valid_plugin ‘[1-9]/
  • pattern=’.dpkg-(new|old|temp)$’
  • [[ -f [1-9]/ ]]
  • false

Please ignore error 111 , i m basically looking for ERROR: (‘Connection aborted.’, BadStatusLine(“’’”,))

From the start, what do you have done so far to monitor your tomcat instance?
I only see a error message what makes no sense.

Thanks for the reply , let me explain you here
as per mentioned in document The agent for Linux in detail
i have installed checkmk agent check-mk-agent-1.6.0p20-1.noarch.rpm on my centos7 instance.
service xinetd with config /etc/xinetd.d/check-mk
{
type = UNLISTED
port = 6556
socket_type = stream
protocol = tcp
wait = no
user = root
server = /usr/bin/check_mk_agent
only_from = 127.0.0.1 10.0.20.1 10.0.20.2 172.31.25.62
log_on_success =
disable = no
}

mk_jolokia.py i download and put under path /usr/lib/check_mk_agent/plugins/
Below is my jolokia config, for my tomcat which are running on ajp port 1117

cat /etc/check_mk/jolokia.cfg

instances = [
{
“port” : 1117,
“instance” : “tomcat90LB1”,
},
{
“port” : 2228,
“instance” : “tomcat90LB2”,
}
]

#-> check_mk_agent | less
<<<check_mk>>>
Version: 1.6.0p20
AgentOS: linux
Hostname: ip-172-31-40-234.us-west-2.compute.internal
AgentDirectory: /etc/check_mk
DataDirectory: /var/lib/check_mk_agent
SpoolDirectory: /var/lib/check_mk_agent/spool
PluginsDirectory: /usr/lib/check_mk_agent/plugins
LocalDirectory: /usr/lib/check_mk_agent/local
<<>>
<<>>
<<<jolokia_info:sep(0)>>>
tomcat90LB1^@ERROR^@(‘Connection aborted.’, BadStatusLine("’’",))

Let me know if you need any further information

It looks like that there is no Jolokia running on your server.
You followed the description how to deploy the Jolokia here?
https://jolokia.org/index.html

Hi Andreas

i able to solve it now, when i comment redirectPort=“1111” ,jolokia is working fine and showing in monitoring ,1111 is ssl port , i think there is some misconfiguration for ssl port ,willcheck further for this .

Hi Andreas

when i download and try to put below war in tomcat, i m getting http 400 error
https://search.maven.org/remotecontent?filepath=org/jolokia/jolokia-war/1.6.2/jolokia-war-1.6.2.war

am i suppose to do any changes here ?

Hi Anders
are we suppose to do any changes in the war file oj jolokia >=?
or it will work simply by putting in to webapps of tomcat?

I don’t think so. In my use cases i don’t administer the Tomcat servers but as far as i know you only have to deploy the Jolokia war.
On this page you have all the possible configuration options.
https://jolokia.org/reference/html/agents.html

Hi Andreas
thanks for the reply

Hi Team
can somebody please help .
currently i m configuring check_mk 1.6
we are running tomcat with ajp port 1117 and https port 1111 (we r not running any http port )


i just configured jolokia in my check_mk agent .
when i try to run mk_jolokia.py , getting below ERROR

<<<jolokia_info:sep(0)>>>
ERROR: (‘Connection aborted.’, BadStatusLine("’’",))
tomcatERROR(‘Connection aborted.’, BadStatusLine("’’",))

netstat -tulnp | grep -i 1111
tcp6 0 0 :::1111 :::* LISTEN 21701/java
etstat -tulnp | grep -i 1117
tcp6 0 0 :::1117 :::* LISTEN 21701/java

my jolokia config file is as below
instances = [
{
“port” : 1117,
“instance” : “tomcatA1”,
}
]

<<jolokia_info:sep(0)>>>
ERROR: (‘Connection aborted.’, BadStatusLine("’’",))
tomcatERROR(‘Connection aborted.’, BadStatusLine("’’",))
<<<jolokia_info:sep(0)>>>
ERROR: HTTP STATUS: 400
tomcatERROR(‘HTTP STATUS’, 400)

my jolokia config file is as below
instances = [
{
“port” : 1117,
“instance” : “tomcatA1”,
},
{
“port” : 1111,
“instance” : “tomcatA1”,
}
]

First you can test with a normal browser or tools like curl if the jolokia is answering on the configured port.

curl -k https://localhost:1111/jolokia/version

The output should be a status line in json syntax.

Hi Andreas

Its working now , thanks for the reply

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed. Contact @fayepal if you think this should be re-opened.