An open API service indexing awesome lists of open source software.

https://github.com/goliatone/go-rpi-agent

Golang RPi agent, advertise over MDNS and expose service for stats
https://github.com/goliatone/go-rpi-agent

Last synced: 2 months ago
JSON representation

Golang RPi agent, advertise over MDNS and expose service for stats

Awesome Lists containing this project

README

        

## Installation

To install the service run the `taskfile`:

```
$ run service:install
```

Where:
* USER: RPi user, e.g. `pi`
* HOST: RPi host, e.g. `raspberrypi.local`
* UUID: RPi instance ID, e.g. `20d520b5-1f94-412e-9dd6-d6b11aa89b06`

## Metrics

Refactoring:
1. Use a template for output
2. Collect metrics/data using a plugin architecture

### Template output

- [ ] Add flag with path to template
- [ ] Create default template

### Data Collection

- [ ] Add flag to directory with plugins
- [ ] Define plugin interface
- [ ] Define typedef for:
- [ ] Measurement
- [ ] Store

```go
type Meassurement struct {
Key string
Value interface{}
Time int64
}

type Store interface {
func set(m Meassurement)
func serialize()
}
```

TODO:

- [ ] Dynamically create service systemd to use right user
- [ ] Take URL endpoint from flags
- [ ] Refactor to use external template to configure POST payload
- [ ] Add flag to run timer for POST payload
- [ ] Refactor so we collect data dynamically:
- [ ] Each function should take output map and add its result to it, e.g.: getMac(&out)
- [ ] These collectors should be a plugin interface to be loaded

- [ ] Is there a way to configure refresh rate of MDNS client?
- [ ] Create Prometheus endpoint for [metrics](https://prometheus.io/docs/concepts/metric_types/)
- [ ] Fluentbit [fluentd agent](https://fluentbit.io/)
- [ ] arm info [here](https://fluentbit.io/documentation/0.12/installation/raspberry_pi.html)
- [ ] Add `ExecStop` and `ExecReload` to rpi service.