Skip to content

Commit

Permalink
Merge pull request dmuth#3 from dmuth/hosts
Browse files Browse the repository at this point in the history
Added support for custom /etc/hosts lookups
  • Loading branch information
dmuth authored Dec 26, 2021
2 parents a945091 + 306d520 commit fff2deb
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 2 deletions.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,15 @@ Here are a few other dashboards which show details about the running system:
- [SEPTA Regional Rail Stats](http://localhost:3000/d/U2n119O7z/septa-regional-rail) - Stats on [SEPTA Regional Rail](http://www.septa.org/service/rail/)


## Pinging Additional Hosts

- Optionally edit the file `hosts.txt` to add human-readable names for IP addresses.
- Copy `docker-compose.override.yml.sample` to `docker-compose.override.yml`.
- Uncomment the `environment:` and `HOSTS:` keys.
- Add additional hosts or IPs into `HOSTS:` as you see fit.
- Restart the `ping` container with `docker-compose kill ping; docker-compose rm -f ping; docker-compose up -d ping`.


## Exporting Dashboards

- If you want to export your current set of dashboards (including any changes made) to disk, first you'll need launch a shell in the tools container:
Expand Down
2 changes: 2 additions & 0 deletions docker-compose.override.yml.sample
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ services:
loki-url: http://host.docker.internal:3100/loki/api/v1/push

ping:
#environment:
#HOSTS: "google.com amazon.com google-dns cloudflare-dns "
logging:
driver: loki
options:
Expand Down
5 changes: 3 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,15 @@ services:
# Host to ping. Can be hostname or IP. Space-delimited.
# Note that DNS lookups may fail, so consider pinging some IPs...
#
HOSTS: "google.com amazon.com 8.8.8.8 1.1.1.1"
HOSTS: "google.com amazon.com google-dns cloudflare-dns "
#
# Comment the previous line and uncomment this one if you'd like to ping
# some hosts on different continents.
#
#HOSTS: "google.com amazon.com 8.8.8.8 1.1.1.1 cheetah.jp leopard.se"
#HOSTS: "google.com amazon.com google-dns cloudflare-dns cheetah.jp leopard.se"
volumes:
- logs:/logs/
- ./hosts.txt:/etc/hosts
restart: "always"

#
Expand Down
10 changes: 10 additions & 0 deletions hosts.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#
# This file is copied to /etc/hosts in the ping container.
#
127.0.0.1 localhost
1.1.1.1 cloudflare-dns
8.8.8.8 google-dns

#192.168.1.1 router
#10.0.0.1 router

0 comments on commit fff2deb

Please sign in to comment.