update readme
This commit is contained in:
parent
f86e9731da
commit
8273aafaf4
|
|
@ -1,5 +1,43 @@
|
||||||
# influxunifi
|
## UnPoller InfluxDB Plugin
|
||||||
|
|
||||||
## UnPoller Input Plugin
|
|
||||||
|
|
||||||
Collects UniFi data from a UniFi controller using the API.
|
Collects UniFi data from a UniFi controller using the API.
|
||||||
|
|
||||||
|
This is meant for InfluxDB users 1.8+ and 2.x series.
|
||||||
|
|
||||||
|
## Configuration
|
||||||
|
|
||||||
|
### InfluxDB 1.8+, 2.x
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
influxdb:
|
||||||
|
disable: false
|
||||||
|
# How often to poll UniFi and report to Datadog.
|
||||||
|
interval: "2m"
|
||||||
|
# the influxdb url to post data
|
||||||
|
url: http://somehost:1234
|
||||||
|
# the secret auth token
|
||||||
|
auth_token: somesecret
|
||||||
|
# the influxdb org
|
||||||
|
org: my-org
|
||||||
|
# the influxdb bucket
|
||||||
|
bucket: my-bucket
|
||||||
|
# how many points to batch write per flush.
|
||||||
|
batch_size: 20
|
||||||
|
```
|
||||||
|
|
||||||
|
### InfluxDB pre 1.8
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
influxdb:
|
||||||
|
disable: false
|
||||||
|
# How often to poll UniFi and report to Datadog.
|
||||||
|
interval: "2m"
|
||||||
|
# the influxdb url to post data
|
||||||
|
url: http://somehost:1234
|
||||||
|
# the database
|
||||||
|
db: mydb
|
||||||
|
# the influxdb api user
|
||||||
|
user: unifi
|
||||||
|
# the influxdb api password
|
||||||
|
pass: supersecret
|
||||||
|
```
|
||||||
|
|
|
||||||
|
|
@ -65,7 +65,7 @@ type InfluxDB struct {
|
||||||
type InfluxUnifi struct {
|
type InfluxUnifi struct {
|
||||||
Collector poller.Collect
|
Collector poller.Collect
|
||||||
influxV1 influxV1.Client
|
influxV1 influxV1.Client
|
||||||
influxV2 influx.ClientInterface
|
influxV2 influx.Client
|
||||||
LastCheck time.Time
|
LastCheck time.Time
|
||||||
*InfluxDB
|
*InfluxDB
|
||||||
}
|
}
|
||||||
|
|
@ -231,7 +231,7 @@ func (u *InfluxUnifi) ReportMetrics(m *poller.Metrics, e *poller.Events) (*Repor
|
||||||
|
|
||||||
if u.Config.Version2 {
|
if u.Config.Version2 {
|
||||||
// Make a new Influx Points Batcher.
|
// Make a new Influx Points Batcher.
|
||||||
r.writer = &u.influxV2.WriteAPI(u.Org, u.Bucket)
|
r.writer = u.influxV2.WriteAPI(u.Org, u.Bucket)
|
||||||
|
|
||||||
go u.collect(r, r.ch)
|
go u.collect(r, r.ch)
|
||||||
// Batch all the points.
|
// Batch all the points.
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue