diff --git a/README.md b/README.md
index c2ca2d6a..721c0e6e 100644
--- a/README.md
+++ b/README.md
@@ -3,7 +3,7 @@
[](https://discord.gg/KnyKYt2)
[](https://twitter.com/TwitchCaptain)
-[](http://grafana.com/dashboards?search=unifi-poller)
+[](http://grafana.com/dashboards?search=unifi-poller)
[](https://hub.docker.com/r/golift/unifi-poller)
[](https://www.somsubhra.com/github-release-stats/?username=davidnewhall&repository=unifi-poller)
@@ -12,9 +12,12 @@
[](https://github.com/davidnewhall/unifi-poller)
[](https://travis-ci.org/davidnewhall/unifi-poller)
-Collect your UniFi controller data and export it to an InfluxDB instance.
-[Five Grafana Dashboards](http://grafana.com/dashboards?search=unifi-poller)
-included; with screenshots. Updated 2019.
+Collect your UniFi controller data and report it to an InfluxDB instance,
+or export it for Prometheus collection. Prometheus support is new, and much
+of the documentation still needs to be updated. 11/30/2019
+[Seven Grafana Dashboards](http://grafana.com/dashboards?search=unifi-poller)
+included; with screenshots. Five for InfluxDB and two for Prometheus, although
+three more Prometheus dashboards are coming!
## Installation
diff --git a/examples/MANUAL.md b/examples/MANUAL.md
index 4648bc4c..75188ec4 100644
--- a/examples/MANUAL.md
+++ b/examples/MANUAL.md
@@ -148,6 +148,7 @@ is provided so the application can be easily adapted to any environment.
Detection System data. IDS and IPS are the same data set. This is off
by default because most controllers do not have this enabled. It also
creates a lot of new metrics from controllers with a lot of IDS entries.
+ IDS data does not contain metrics, so this doesn't work with Prometheus.
reauthenticate default: false
Setting this parameter to true will make UniFi Poller send a new login
diff --git a/examples/up.conf.example b/examples/up.conf.example
index 0f1b3041..eb4fb0f2 100644
--- a/examples/up.conf.example
+++ b/examples/up.conf.example
@@ -56,7 +56,7 @@ unifi_user = "influx"
unifi_pass = "4BB9345C-2341-48D7-99F5-E01B583FF77F"
unifi_url = "https://127.0.0.1:8443"
-# Enable collection of Intrusion Detection System Data.
+# Enable collection of Intrusion Detection System Data (InfluxDB only).
# Only useful if IDS or IPS are enabled on one of the sites.
collect_ids = false
diff --git a/examples/up.xml.example b/examples/up.xml.example
index 3022948b..325f12d4 100644
--- a/examples/up.xml.example
+++ b/examples/up.xml.example
@@ -79,7 +79,7 @@
https://127.0.0.1:8443
false
diff --git a/examples/up.yaml.example b/examples/up.yaml.example
index 4dfe2e67..00e75fba 100644
--- a/examples/up.yaml.example
+++ b/examples/up.yaml.example
@@ -57,7 +57,7 @@ unifi_user: "influx"
unifi_pass: ""
unifi_url: "https://127.0.0.1:8443"
-# Enable collection of Intrusion Detection System Data.
+# Enable collection of Intrusion Detection System Data (InfluxDB only).
# Only useful if IDS or IPS are enabled on one of the sites.
collect_ids: false
diff --git a/main.go b/main.go
index f98e65c4..332bfd5d 100644
--- a/main.go
+++ b/main.go
@@ -3,7 +3,7 @@ package main
import (
"log"
- "github.com/davidnewhall/unifi-poller/poller"
+ "github.com/davidnewhall/unifi-poller/pkg/poller"
)
// Keep it simple.
diff --git a/influxunifi/README.md b/pkg/influxunifi/README.md
similarity index 100%
rename from influxunifi/README.md
rename to pkg/influxunifi/README.md
diff --git a/influxunifi/clients.go b/pkg/influxunifi/clients.go
similarity index 97%
rename from influxunifi/clients.go
rename to pkg/influxunifi/clients.go
index 5a57331b..8e35f282 100644
--- a/influxunifi/clients.go
+++ b/pkg/influxunifi/clients.go
@@ -56,6 +56,7 @@ func ClientPoints(c *unifi.Client, now time.Time) ([]*influx.Point, error) {
"essid": c.Essid,
"bssid": c.Bssid,
"radio_desc": c.RadioDescription,
+ "satisfaction": c.Satisfaction.Val,
"hostname": c.Hostname,
"dpi_stats_last_updated": c.DpiStatsLastUpdated,
"last_seen_by_uap": c.LastSeenByUAP,
@@ -84,6 +85,7 @@ func ClientPoints(c *unifi.Client, now time.Time) ([]*influx.Point, error) {
"tx_bytes": c.TxBytes,
"tx_bytes_r": c.TxBytesR,
"tx_packets": c.TxPackets,
+ "tx_retries": c.TxRetries,
"tx_power": c.TxPower,
"tx_rate": c.TxRate,
"uptime": c.Uptime,
diff --git a/influxunifi/ids.go b/pkg/influxunifi/ids.go
similarity index 100%
rename from influxunifi/ids.go
rename to pkg/influxunifi/ids.go
diff --git a/influxunifi/metrics.go b/pkg/influxunifi/metrics.go
similarity index 97%
rename from influxunifi/metrics.go
rename to pkg/influxunifi/metrics.go
index 3919c8c7..f4a8c86b 100644
--- a/influxunifi/metrics.go
+++ b/pkg/influxunifi/metrics.go
@@ -3,7 +3,7 @@
package influxunifi
import (
- "github.com/davidnewhall/unifi-poller/metrics"
+ "github.com/davidnewhall/unifi-poller/pkg/metrics"
client "github.com/influxdata/influxdb1-client/v2"
)
diff --git a/influxunifi/site.go b/pkg/influxunifi/site.go
similarity index 100%
rename from influxunifi/site.go
rename to pkg/influxunifi/site.go
diff --git a/influxunifi/uap.go b/pkg/influxunifi/uap.go
similarity index 100%
rename from influxunifi/uap.go
rename to pkg/influxunifi/uap.go
diff --git a/influxunifi/udm.go b/pkg/influxunifi/udm.go
similarity index 100%
rename from influxunifi/udm.go
rename to pkg/influxunifi/udm.go
diff --git a/influxunifi/usg.go b/pkg/influxunifi/usg.go
similarity index 100%
rename from influxunifi/usg.go
rename to pkg/influxunifi/usg.go
diff --git a/influxunifi/usw.go b/pkg/influxunifi/usw.go
similarity index 100%
rename from influxunifi/usw.go
rename to pkg/influxunifi/usw.go
diff --git a/metrics/metrics.go b/pkg/metrics/metrics.go
similarity index 100%
rename from metrics/metrics.go
rename to pkg/metrics/metrics.go
diff --git a/poller/build_macos.go b/pkg/poller/build_macos.go
similarity index 100%
rename from poller/build_macos.go
rename to pkg/poller/build_macos.go
diff --git a/poller/build_unix.go b/pkg/poller/build_unix.go
similarity index 100%
rename from poller/build_unix.go
rename to pkg/poller/build_unix.go
diff --git a/poller/build_windows.go b/pkg/poller/build_windows.go
similarity index 100%
rename from poller/build_windows.go
rename to pkg/poller/build_windows.go
diff --git a/poller/config.go b/pkg/poller/config.go
similarity index 100%
rename from poller/config.go
rename to pkg/poller/config.go
diff --git a/poller/dumper.go b/pkg/poller/dumper.go
similarity index 100%
rename from poller/dumper.go
rename to pkg/poller/dumper.go
diff --git a/poller/helpers.go b/pkg/poller/helpers.go
similarity index 100%
rename from poller/helpers.go
rename to pkg/poller/helpers.go
diff --git a/poller/influx.go b/pkg/poller/influx.go
similarity index 95%
rename from poller/influx.go
rename to pkg/poller/influx.go
index d428bdb8..1eb2bb83 100644
--- a/poller/influx.go
+++ b/pkg/poller/influx.go
@@ -4,8 +4,8 @@ import (
"crypto/tls"
"fmt"
- "github.com/davidnewhall/unifi-poller/influxunifi"
- "github.com/davidnewhall/unifi-poller/metrics"
+ "github.com/davidnewhall/unifi-poller/pkg/influxunifi"
+ "github.com/davidnewhall/unifi-poller/pkg/metrics"
influx "github.com/influxdata/influxdb1-client/v2"
)
diff --git a/poller/prometheus.go b/pkg/poller/prometheus.go
similarity index 95%
rename from poller/prometheus.go
rename to pkg/poller/prometheus.go
index ae2daa63..88502dc9 100644
--- a/poller/prometheus.go
+++ b/pkg/poller/prometheus.go
@@ -6,8 +6,8 @@ import (
"strings"
"time"
- "github.com/davidnewhall/unifi-poller/metrics"
- "github.com/davidnewhall/unifi-poller/promunifi"
+ "github.com/davidnewhall/unifi-poller/pkg/metrics"
+ "github.com/davidnewhall/unifi-poller/pkg/promunifi"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promhttp"
)
diff --git a/poller/start.go b/pkg/poller/start.go
similarity index 100%
rename from poller/start.go
rename to pkg/poller/start.go
diff --git a/poller/unifi.go b/pkg/poller/unifi.go
similarity index 98%
rename from poller/unifi.go
rename to pkg/poller/unifi.go
index 54135923..c431f252 100644
--- a/poller/unifi.go
+++ b/pkg/poller/unifi.go
@@ -5,7 +5,7 @@ import (
"strings"
"time"
- "github.com/davidnewhall/unifi-poller/metrics"
+ "github.com/davidnewhall/unifi-poller/pkg/metrics"
"golift.io/unifi"
)
diff --git a/promunifi/README.md b/pkg/promunifi/README.md
similarity index 100%
rename from promunifi/README.md
rename to pkg/promunifi/README.md
diff --git a/promunifi/clients.go b/pkg/promunifi/clients.go
similarity index 100%
rename from promunifi/clients.go
rename to pkg/promunifi/clients.go
diff --git a/promunifi/collector.go b/pkg/promunifi/collector.go
similarity index 98%
rename from promunifi/collector.go
rename to pkg/promunifi/collector.go
index 25cfd370..42a821cf 100644
--- a/promunifi/collector.go
+++ b/pkg/promunifi/collector.go
@@ -8,7 +8,7 @@ import (
"sync"
"time"
- "github.com/davidnewhall/unifi-poller/metrics"
+ "github.com/davidnewhall/unifi-poller/pkg/metrics"
"github.com/prometheus/client_golang/prometheus"
"golift.io/unifi"
)
diff --git a/promunifi/loops.go b/pkg/promunifi/loops.go
similarity index 100%
rename from promunifi/loops.go
rename to pkg/promunifi/loops.go
diff --git a/promunifi/report.go b/pkg/promunifi/report.go
similarity index 96%
rename from promunifi/report.go
rename to pkg/promunifi/report.go
index 016d3db8..4262a546 100644
--- a/promunifi/report.go
+++ b/pkg/promunifi/report.go
@@ -4,7 +4,7 @@ import (
"fmt"
"time"
- "github.com/davidnewhall/unifi-poller/metrics"
+ "github.com/davidnewhall/unifi-poller/pkg/metrics"
"github.com/prometheus/client_golang/prometheus"
)
diff --git a/promunifi/site.go b/pkg/promunifi/site.go
similarity index 100%
rename from promunifi/site.go
rename to pkg/promunifi/site.go
diff --git a/promunifi/uap.go b/pkg/promunifi/uap.go
similarity index 100%
rename from promunifi/uap.go
rename to pkg/promunifi/uap.go
diff --git a/promunifi/udm.go b/pkg/promunifi/udm.go
similarity index 100%
rename from promunifi/udm.go
rename to pkg/promunifi/udm.go
diff --git a/promunifi/usg.go b/pkg/promunifi/usg.go
similarity index 100%
rename from promunifi/usg.go
rename to pkg/promunifi/usg.go
diff --git a/promunifi/usw.go b/pkg/promunifi/usw.go
similarity index 100%
rename from promunifi/usw.go
rename to pkg/promunifi/usw.go