#cli #devops #healthcheck

app healthcheck-rs

A Rust executable for simple HTTP check status

3 releases

new 0.1.2 Jun 22, 2022
0.1.1 Jul 9, 2020
0.1.0 Jul 9, 2020

#347 in Command line utilities

Download history 7/week @ 2022-03-14 6/week @ 2022-03-21 10/week @ 2022-04-25 12/week @ 2022-05-02 5/week @ 2022-05-09 35/week @ 2022-05-16 11/week @ 2022-05-23 21/week @ 2022-05-30 8/week @ 2022-06-06 3/week @ 2022-06-13 26/week @ 2022-06-20

62 downloads per month

MIT license

11KB
76 lines

healthcheck-rs Latest Version

A Rust executable for simple HTTP check status.

healthcheck-rs use a config file containing URLs and check if the return of HTTP GET request of each one is successfully

Configure and build

Create a config.json file with the following specification:

{
    "groups": [
        {
            "name": "GOOGLE SERVICES",
            "hosts": [
                {
                    "name": "Google Search", 
                    "url": "https://www.google.com"
                },
                {
                    "name": "Google Drive", 
                    "url": "https://drive.google.com"
                }
            ]
        },
        {
            "name": "FACEBOOK SERVICES",
            "hosts": [
                {
                    "name": "Facebook", 
                    "url": "https://facebook.com"
                },
                {
                    "name": "Instagram", 
                    "url": "https://instagram.com"
                }
            ]
        }
    ]
}

Install using:

cargo install healthcheck-rs

Running

To run, you can use the binary generated in target/ folder or use (it will use config.json file in the same folder):

healthcheck-rs

You can pass config.json file in command-line using:

healthcheck-rs new-config-file.json

healthcheck-rs will do a HTTP GET request in each service and return an output like this:

===== GOOGLE SERVICES =====
Google Search - ✅
Google Drive - ✅
===== FACEBOOK SERVICES =====
Facebook - ❌ - reqwest::Error { kind: Request, url: "https://facebook.com", source: TimedOut }
Instagram - ✅

Dependency Crates

This project use the following crates:

  • reqwest - An ergonomic, batteries-included HTTP Client for Ru
  • serde - Serde is a framework for serializing and deserializing Rust data structures efficiently and generically.
  • serde-json - Serde is a framework for serializing and deserializing Rust data structures efficiently and generically in JSON format

Dependencies

~3–12MB
~249K SLoC