{"id":15481852,"url":"https://github.com/catvec/net-test","last_synced_at":"2025-12-30T02:05:02.012Z","repository":{"id":48417656,"uuid":"134084453","full_name":"Noah-Huppert/net-test","owner":"Noah-Huppert","description":"Monitors network connectivity for downtime.","archived":false,"fork":false,"pushed_at":"2021-07-27T12:24:27.000Z","size":731,"stargazers_count":43,"open_issues_count":2,"forks_count":5,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-19T05:18:49.027Z","etag":null,"topics":["golang","grafana","grafana-dashboard","monitoring","monitoring-scripts","monitoring-tool","network","network-analysis","network-monitoring","prometheus","prometheus-exporter","prometheus-metrics","tool"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Noah-Huppert.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-05-19T17:41:09.000Z","updated_at":"2024-09-27T22:52:08.000Z","dependencies_parsed_at":"2022-08-24T09:30:20.862Z","dependency_job_id":null,"html_url":"https://github.com/Noah-Huppert/net-test","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Noah-Huppert%2Fnet-test","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Noah-Huppert%2Fnet-test/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Noah-Huppert%2Fnet-test/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Noah-Huppert%2Fnet-test/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Noah-Huppert","download_url":"https://codeload.github.com/Noah-Huppert/net-test/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249273966,"owners_count":21242004,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["golang","grafana","grafana-dashboard","monitoring","monitoring-scripts","monitoring-tool","network","network-analysis","network-monitoring","prometheus","prometheus-exporter","prometheus-metrics","tool"],"created_at":"2024-10-02T05:06:37.108Z","updated_at":"2025-12-30T02:05:01.647Z","avatar_url":"https://github.com/Noah-Huppert.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Net Test\nMonitors network connectivity for downtime.\n\n# Table Of Contents\n- [Overview](#overview)\n- [Run](#run)\n  - [Command Line Options](#command-line-options)\n  - [Run with Docker Compose](#run-with-docker-compose)\n  - [Run Manually](#run-manually)\n- [Analyse](#analyse)\n\n# Overview\nThe Net Test program performs measurements and publishes the resulting metrics for Prometheus to scrape.\n\nPrometheus and Grafana Docker containers are provided setup and ready to analyse Net Test data.\n\n![Grafana dashboard showing histogram of round trip time](./screenshot.png)\n\n# Run\nThe Net Test tool measures results and publishes them for Prometheus. Grafana is used to view the data.\n\nA Docker Compose setup is provided to make this process as easy as running a single command, see [Run with Docker Compose](#run-with-docker-compose).\n\nIf one would like to run the setup without Docker Compose see [Run Manually](#run-manually).\n\n## Command Line Options\nThe behavior of the `net-test` tool is specified using command line options. \n\nThe tool is configured with a list of target hosts, a host picking strategy, and a set of measurements to take.\n\nTarget host options:\n\n- `-t string`: Target hosts (DNS or IP4) to measure (can be provided multiple times)\n- `-T string`: Add this target host to the beginning of existing target hosts\n\nHost picking strategy:\n\n- `-f`: Only measure the first target host and fallover to other following target hosts if the measurement fails (incompatible with -a) (default true)\n- `-a`: Measure all target hosts (incompatible with -f)\n\nMeasurement options:\n\n- `-p int`: Interval in milliseconds at which to perform the ping measurement. A value of -1 disables this test. Results recorded to the `ping_rtt_ms` and `ping_failures_total` metrics with the `target_host` label. (default 10000)\n\nOther options:\n\n- `-m string`: Host on which to serve Prometheus metrics (default \":2112\")\n\n## Run with Docker Compose\nA Docker Compose file is provided which orchestrates the execution of Net Test, Prometheus, and Grafana.\n\nRun:\n\n```\ndocker-compose up -d\n```\n\nThen visit [127.0.0.1:3000](http://127.0.0.1:3000) and view the `Net Test` dashboard.\n\nTo customize the measurements and behavior of Net Test one must edit the Docker Compose configuration. Make a copy of `docker-compose.custom.example.yml` named `docker-compose.custom.yml`. Edit the `services.net_test.command` field in this file with your custom command line options.\n\nFor example this `docker-compose.custom.yml` file tells Net Test to measure `example.com` before any other target hosts, and run the ping test every second (see [Command Line Options](#command-line-options)):\n\n```yml\nversion: \"3.9\"\nservices:\n  net_test:\n    command: net-test -T example.com -p 1000\n```\n\nRun your custom Docker Compose setup with the following command:\n\n```\ndocker-compose -f docker-compose.yml -f docker-compose.custom.yml up -d\n```\n\nThis tells Docker Compose to look at the `docker-compose.yml` and `docker-compose.custom.yml` files for configuration. The `docker-compose.yml` file contains the original Docker Compose setup details. Your `docker-compose.custom.yml` file contains an override for the container which runs the Net Test tool.\n\nThis is a lot to type every time, so the helper script `custom-docker-compose` is provided to make life easier. The following is equivalent to the command above:\n\n```\n./custom-docker-compose up -d\n```\n\n## Run Manually\nThe Net Test tool is written in Go. Run it:\n\n```\ngo run main.go\n```\n\nSee [Command Line Options](#command-line-options) for details.\n\nNext run Prometheus and have it scrape the host on which you set Net Test to publish metrics. By default this is `127.0.0.1:2112`.\n\nFinally run Grafana, use the configuration files provided in the `grafana/` directory.\n\n# Analyse\nMeasurements are placed in Prometheus. The following measurement types create the following metrics:\n\n**Ping (`-p \u003cms interval\u003e`)**  \n- `ping_rtt_ms` (Histogram, labels `target_host`): Round trip time to target host\n- `ping_failures_total` (Count, labels `target_host`): Incremented when a target host cannot be reached\n\nGrafana is hosted at [127.0.0.1:3000](http://127.0.0.1:3000) by the provided Docker containers. A dashboard named \"Net Test\" has been pre-configured to show all available measurement data.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcatvec%2Fnet-test","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcatvec%2Fnet-test","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcatvec%2Fnet-test/lists"}