{"id":42775124,"url":"https://github.com/easybill/mehsh","last_synced_at":"2026-01-29T22:05:36.624Z","repository":{"id":70030265,"uuid":"219312847","full_name":"easybill/mehsh","owner":"easybill","description":"Mehsh Network Monitoring UDP Ping","archived":false,"fork":false,"pushed_at":"2024-04-19T19:55:24.000Z","size":241,"stargazers_count":1,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-05-02T04:37:46.030Z","etag":null,"topics":["latency","monitoring","network","network-analysis","ping","udp"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/easybill.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,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2019-11-03T14:25:04.000Z","updated_at":"2022-03-25T10:36:10.000Z","dependencies_parsed_at":"2024-04-19T20:49:34.064Z","dependency_job_id":"3e6d0092-e45d-4c5d-ad2e-719700d1a393","html_url":"https://github.com/easybill/mehsh","commit_stats":null,"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"purl":"pkg:github/easybill/mehsh","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/easybill%2Fmehsh","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/easybill%2Fmehsh/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/easybill%2Fmehsh/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/easybill%2Fmehsh/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/easybill","download_url":"https://codeload.github.com/easybill/mehsh/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/easybill%2Fmehsh/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28886888,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-29T21:06:44.224Z","status":"ssl_error","status_checked_at":"2026-01-29T21:06:42.160Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["latency","monitoring","network","network-analysis","ping","udp"],"created_at":"2026-01-29T22:05:35.790Z","updated_at":"2026-01-29T22:05:36.618Z","avatar_url":"https://github.com/easybill.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Mehsh\n\nMehsh allows to monitor the network between N servers for failures.\nIt sends UDP packets from server to server and measures how many packets have disappeared.\n\nMehsh allows more complex configurations.  So it is possible to define the complete server landscape in a configuration file and to specify the current server when starting Mehsh (default is the hostname).\n\n### Download\nYou can download the latest binaries from the [releases page](https://github.com/easybill/mehsh/releases) or use these permalinks for the latest version:\n- [mehsh_linux_latest_x86_64](https://github.com/easybill/mehsh/releases/latest/download/mehsh_ubuntu-latest_x86_64)\n- [mehsh_linux_latest_aarch64](https://github.com/easybill/mehsh/releases/latest/download/mehsh_ubuntu-latest_aarch64)\n\n### Example 1 (works local)\n\nmehsh.toml:\n```toml\n# you have to group servers into groups, \n# in practive this might be \"loadbalancers\", \"webservers\", \"storageservers\", ... \n# to make this example as simple as possible we've just one group named all\n[[group]]\nname = \"all\"\n\n# you've define to define every server, when you've 100 servers you would end up \n# with 100 [[server]] blocks. Every server has a name, an ip and is part of N groups.\n[[server]]\nname = \"local\"\nip = \"127.0.0.1\"\ndatacenter = \"fra.dc11\" # optional, datacenter of the server. great to see if a whole datacenter has issues\ngroups = [\"all\"]\nextra1 = \"some extra value you could use in placeholders\"\nextra2 = \"same like extra1\"\nextra3 = \"same like extra1\"\n\n[[server]]\nname = \"fail\"\nip = \"127.0.222.1\"\ndatacenter = \"fra.dc12\"\ngroups = [\"all\"]\n\n# now comes the real check\n# we're checking with the udp_ping from \"local\" to \"all\".\n# in real applications you would create one check per usecase.\n# For example, one check that checks the connection of load balancers to application servers \n# and another check that checks the connection from the application server to the database server.\n# And maybe another check that checks the connection between \n# the database servers to detect replication problems before they occur.\n[[check]]\nfrom = \"local\" # could be a servername or a group\nto = \"all\" # could be a servername or a group\ncheck = \"udp_ping\"\n```\n\nnow you could download and run mehsh\n\n```\nmehsh_check example/local.toml --name=local # name is the name defined in the toml as server.name\n```\n\nOutput\nIn the output you can see that the server local has a problem to reach fail, but local itself is reached.\nin addition, you see an aggregated view for each datacenter. If you specify a \".\" at the datacenter, each of these blocks will be aggregated for itself.\n\nFields:\n\n- server: `[from] -\u003e [to]`, name of the server defined in the `[[server]]` block.\n- ip: Ip of the `to server`.\n- req: Number of udp packets that were send.\n- resp: Number of the udp packets that received a pont. (successful req)\n- max_lat: Max latency between sending and receiving a package\n- min_lat: Min latency between sending and receiving a package\n- mode: \"normal\" or \"MAINTENANCE\" if mehsh runs in Maintenance Mode.\n- loss: Number of packages lost. results from the calculation of  `req - resp`\n\n```\n2022-03-25 09:56:37 server: local -\u003e fail, ip: 127.0.222.1, req: 161, resp: 0, max_lat: None, min_lat: None, mode: normal, loss: 161, withloss\n2022-03-25 09:56:37 server: local -\u003e local, ip: 127.0.0.1, req: 161, resp: 161, max_lat: Some(243), min_lat: Some(51), mode: normal, loss: 0, withoutloss\n2022-03-25 09:56:37 datacenter: fra.dc11 -\u003e fra, req: 322, resp: 161, max_lat: None, min_lat: None, mode: normal, loss: 161, withloss\n2022-03-25 09:56:37 datacenter: fra.dc11 -\u003e fra.dc12, req: 161, resp: 0, max_lat: None, min_lat: None, mode: normal, loss: 161, withloss\n2022-03-25 09:56:37 datacenter: fra.dc11 -\u003e fra.dc11, req: 161, resp: 161, max_lat: Some(243), min_lat: Some(51), mode: normal, loss: 0, withoutloss\n# repeats every second.\n```\n\n### Automatically run network analysis tools in case of losses\nSome hosters (e.g. [hetzner](https://docs.hetzner.com/de/robot/dedicated-server/troubleshooting/network-diagnosis-and-report-to-hetzner/)) want you to send them analysis with certain tools in case of network issues.\nA common tool is [mtr](https://en.wikipedia.org/wiki/MTR_(software)) but theoretically it could be any tool.\n\nWhen you want to execute tools like mtr using Mehsh you might need to run Mehsh as root because mtr needs to run as root.\n\n```toml\n[[analysis]]\nfrom = \"local\" # server from\nto = \"all\" # server to\nname = \"mtr\" # just a name\nmin_loss = 20\n# the command you want to run.\n# variables:\n# {{server.from.ip}}\n# {{server.from.extra1}}\n# {{server.from.extra2}}\n# {{server.from.extra3}}\n# {{server.to.ip}}\n# {{server.to.extra1}}\n# {{server.to.extra2}}\n# {{server.to.extra3}}\ncommand = \"mtr -s 1000 -r -c 1000 {{server.to.ip}}\"\n```\n\nMehsh will execute the command and create a file with the output in `/tmp/mehsh/[NAME]/[SERVER_TO]/[DATE_TIME].txt`.\nThe output is also visible in Mehsh stdout.\n\nif you want to run your analysis tool against another ip you can use the extra fields \nto store the other ip there and access it with `{{server.to.extra1}}`.\nThis is useful if mehsh is running in a VPN (wireguard etc.) but you need to run the diagnostics against the external ip.\n\n### Example 2 (lamp stack)\n\n```mermaid\n  graph TD;\n      loadbalancers--\u003eapplicationservers;\n      applicationservers--\u003edatabaseservers;\n      databaseservers--\u003edatabaseservers;\n      database_backup--\u003edatabaseservers;\n```\n\n```toml\n[[group]]\nname = \"loadbalancers\"\n\n[[group]]\nname = \"applicationservers\"\n\n[[group]]\nname = \"databaseservers\"\n\n[[server]]\nname = \"loadbalancer1\"\nip = \"v4:127.0.2.2\"\ngroups = [\"loadbalancers\"]\n\n[[server]]\nname = \"loadbalancer2\"\nip = \"v4:127.0.2.3\"\ngroups = [\"loadbalancers\"]\n\n[[server]]\nname = \"applicationserver1\"\nip = \"v4:127.0.3.2\"\ngroups = [\"applicationservers\"]\n\n[[server]]\nname = \"applicationserver2\"\nip = \"v4:127.0.3.3\"\ngroups = [\"applicationservers\"]\n\n[[server]]\nname = \"databaseserver1\"\nip = \"v4:127.0.4.2\"\ngroups = [\"databaseservers\"]\n\n[[server]]\nname = \"databaseserver2\"\nip = \"v4:127.0.4.3\"\ngroups = [\"databaseservers\"]\n\n[[server]]\nname = \"databaseserver3\"\nip = \"v4:127.0.4.4\"\ngroups = [\"databaseservers\"]\n\n[[server]]\nname = \"database_backup\"\nip = \"v4:127.0.5.1\"\ngroups = []\n\n# load balancers needs to access applicationservers\n[[check]]\nfrom = \"loadbalancers\"\nto = \"applicationservers\"\ncheck = \"udp_ping\"\n\n# applicationservers needs access to the database servers\n[[check]]\nfrom = \"applicationservers\"\nto = \"databaseservers\"\ncheck = \"udp_ping\"\n\n# database servers must see each other\n[[check]]\nfrom = \"databaseservers\"\nto = \"databaseservers\"\ncheck = \"udp_ping\"\n\n# backup server needs access to database servers\n[[check]]\nfrom = \"database_backup\"\nto = \"databaseservers\"\ncheck = \"udp_ping\"\n```\n\nnow you could start mehsh on each server with the corrent `--name` argument. The name defaults to the hostname.\n\n### Maintenance Mode\n\nMehsh checks if the file `/tmp/mehsh_maintenance` exists.\nif the file exists mehsh will be put into maintenance mode.\nIn maintenance mode, no more analysis tools are started and metrics no longer send a loss.\nYou can create / remove the file while mehsh is running.\nThe mode is included in the cli output.\n\n```bash\n# enable Maintenance Mode\ntouch /tmp/mehsh_maintenance\n# disable Maintenance Mode\nrm /tmp/mehsh_maintenance\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feasybill%2Fmehsh","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feasybill%2Fmehsh","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feasybill%2Fmehsh/lists"}