Sign inSign up

jmbooth2000/httping-server

By jmbooth2000

•Updated about 2 years ago

Configurable httping with proxy support and a simple web-page for tracking web-server status.

Image
Networking
Web servers
Monitoring & observability
0

159

jmbooth2000/httping-server repository overview

⁠httping-server

This container image is stored on docker hub: jmbooth2000/httping_server.

This container extends Bret Fisher's dockerized version of httping to create a version that includes a basis webserver. As httping works by fetching a web-page this can be use to monitor whether a website is up and measure the performance. It can also be used to monitor an internet connection or proxy connection.

The container allows you to specify,

  1. The url to 'httpping' - if nothing is specified it defaults to google.com.
  2. The frequency with which to check - if nothing is specified it defaults to 60 seconds.
  3. Any additional arguments to the httping command e.g. -x :

⁠Simple Example

A simple non-proxy example using the default value of google.com and a periodicity of 60 seconds, docker run --rm -p 5000:5000 httping-server

If you point your webbrowser to "http://:5000/httping" you should get, { "command":"httping -c 1 -G http://google.com⁠", "ping time":"0.39 ms", "results":"PING google.com:80 (/):\nconnected to google.com:80 (163 bytes), seq=0 time= 0.39 ms \n--- http://google.com/⁠ ping statistics ---\n1 connects, 1 ok, 0.00% failed, time 1001ms\nround-trip min/avg/max = 0.4/0.4/0.4 ms", "time":"18:18:58", "url":"http://google.com⁠" }

⁠Slightly More Complex Example

A slightly more complex example that uses a docker compose file, proxy, custom URL, and customer periodicty is shown below,

Docker compose file

services: httping-server-custom: environment: - HTTPING_URL="cnn.com" - HTTPING_ADDITIONAL_PARMS="-x : - HTTPING_PERIODICITY="10" - TZ=America/New_York # If you don't specify time zone your times will be in UTC ports: - 5000:5000 # If you need to change the port change the first number image: httping-server

If your proxy is another docker container then you will need to ensure that the containers can talk to each other. One way to do this is to add the following to include the following in both the httping-server and the proxy compose files. This enables the two containers to communicate.

    networks:
        - mybridge

networks: mybridge: external: true

If you point your web browser to "http://:5000/httping" you should get, { "command":"httping -c 1 -G -x proxy-pia-uk:8001 http://cnn.com⁠", "ping time":"0.39 ms", "results":"PING cnn.com:80 (/):\nconnected to cnn.com:80 (163 bytes), seq=0 time= 0.39 ms \n--- http://cnn.com/⁠ ping statistics ---\n1 connects, 1 ok, 0.00% failed, time 1001ms\nround-trip min/avg/max = 0.4/0.4/0.4 ms", "time":"18:18:58", "url":"http://cnn.com⁠" }

⁠Homepage Integration

I like to use httping along side homepage (https://github.com/gethomepage/homepage⁠) to monitor the status of my http proxies. This allows you to configure httping to periodically httping through your proxy to alert you if it goes down. The configuration wou>

- httping proxy check:
    widget:
      type: customapi
      url: http://name-of-your-httping-container:5000/httping    # Assumes you use the bridge network strategy described earlier.

      method: GET
      headers:
        Content-Type: application/json

      mappings:
        - field: ping time
          label: ping time
        - field: time
          label: time
        - field: url
          label: url

This produces a simply GUI widget that you can add to your home page that displays the ping time in ms, the date/time the check was performed, and the url that was pulled.

⁠License

This repository and Dockerfile are MIT licensed. All upstream software including httping are licensed by their owners.

Tag summary

Content type

Image

Digest

sha256:39871f0b7…

Size

65.1 MB

Last updated

about 2 years ago

docker pull jmbooth2000/httping-server