gohost

module
v1.0.1-0...-61c25a1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 23, 2023 License: MIT

README

gohost

Gohost is a toy monitoring solution that aggregates host data and makes it accessible via a local webserver.

There are three components required to run gohost

  1. gohost-mon binary
    • Gohost-mon binary needs to run on the host that will be monitored.
    • Aggregates host metrics into the corresponding db
  2. gohost-api binary
    • User facing webserver that serves monitoring data via API endpoints
  3. postgresql db
    • Stores monitoring data and user credentials

There is a docker-compose.yml file included that will deploy the required microservices as per the following diagram

Warning
The container: gohost-mon is run in "privileged" mode which grants it access to the host machine.

Alt text

Endpoints

Metrics

Get metric by ID
Request
http://localhost:port/metric/{id}
Response
{
    "id": int,
    "al_1": float64,
    "al_5": float64,
    "al_15": float64,
    "hutd": uint64,
    "huth": uint64,
    "hutm": uint64,
    "pmu": int,
    "createdAt": time.Time
}
Get metric by date range
Request
http://localhost:port/metrics
Paramters:
Header:
x-jwt-token: JWT-token
Body:
{
    "startDateTime": "YYYY-MM-DDTHH:MM:SSZ",
    "endDateTime": "YYYY-MM-DDTHH:MM:SSZ"
}

Note: the character T and Z are required and should not be changed.

Response
{
    "id": int,
    "al_1": float64,
    "al_5": float64,
    "al_15": float64,
    "hutd": uint64,
    "huth": uint64,
    "hutm": uint64,
    "pmu": int,
    "createdAt": time.Time
}

Directories

Path Synopsis
lib
storage Module

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL