check Ambari or any http-backed app with telnet

For some reason I wanted to check if Ambari was correctly working but didn’t have any browser access.

Check if it was listening on its 8080 port is easy with

$ netstat -anpe | grep 8080

If you really want to check if ambari is answering to requests, you can check that with telnet to the host and typing

GET / HTTP/1.1
Host: <AMBARI_FQDN>

 

localhost$ telnet ambari.mycluster.com 8080
Trying 10.195.196.48...
Connected to ambari.mycluster.com.
Escape character is '^]'.
GET / HTTP/1.1
Host: ambari.mycluster.com

HTTP/1.1 200 OK
Content-Type: text/html
Last-Modified: Fri, 02 Oct 2015 18:12:56 GMT
Accept-Ranges: bytes
Content-Length: 2012
Server: Jetty(8.1.17.v20150415)

<!--
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
-->

[...]

So, what do you think ?

  • Time limit is exhausted. Please reload CAPTCHA.