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
- gohost-mon binary
- Gohost-mon binary needs to run on the host that will be monitored.
- Aggregates host metrics into the corresponding db
- gohost-api binary
- User facing webserver that serves monitoring data via API endpoints
- 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.
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:
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
}