Failed to connect to remote server from Hawtio dashboard

I have a camel web app running on remote server-1 which is tomcat 8 server. I have attached the jolokia jvm agent to this cat like this:

java -jar jolokia-jvm-1.3.5-agent.jar start <PID>

      

I am getting the following response on my local machine by accessing http://remote-server-1:port/jolokia

-

{
    "request": {
        "type": "version"
    },
    "value": {
        "agent": "1.3.5",
        "protocol": "7.2",
        "config": {
            "maxDepth": "15",
            "discoveryEnabled": "true",
            "maxCollectionSize": "0",
            "agentId": "***.***.***.**-16224-35a7a114-jvm",
            "debug": "false",
            "agentType": "jvm",
            "historyMaxEntries": "10",
            "agentContext": "\/jolokia",
            "maxObjects": "0",
            "debugMaxEntries": "100"
        },
        "info": {
            "product": "tomcat",
            "vendor": "Apache",
            "version": "8.0.35"
        }
    },
    "timestamp": 1491307702,
    "status": 200
}

      

I also have hawtio.war deployed to my local-tomcat8.5. When I try to connect to this remote agent, I am redirected to the login page. I cannot figure out where I am going wrong. Can anyone help me with this?

+3


source to share


2 answers


Since hawtio 1.5.0 you need to add remote hosts to the system property hawtio.proxyWhitelist

.

http://hawt.io/configuration/index.html

hawtio.proxyWhitelist

hawtio 1.5.0 - Whitelist target hosts targeting the remote JVM ProxyServlet plugin (default localhost, 127.0.0.1). All nodes that are not listed in this list refuse to connect for security reasons. This option can be set to * to restore the old behavior and whitelist all hosts.



If you are using hawtio.war

, change it WEB-INF/web.xml

like this:

  <servlet>
    <servlet-name>jolokia-proxy</servlet-name>
    <servlet-class>io.hawt.web.ProxyServlet</servlet-class>
    <!--
      Comma-separated list of allowed target hosts. It is required for security.
      '*' allows all hosts but keep in mind it vulnerable to security attacks.
    -->
    <init-param>
      <param-name>proxyWhitelist</param-name>
      <param-value>
        localhost,
        127.0.0.1,
        remote-server-1
      </param-value>
    </init-param>
    <load-on-startup>1</load-on-startup>
  </servlet>

      

+7


source


If you are using the runnable JAR version of Hawtio, you can pass the hawtio.proxyWhitelist parameter also when starting the application:



java -Dhawtio.proxyWhitelist=SERVERNAME -jar hawtio-app-1.5.3.jar

      

+6


source







All Articles