move pkgs, update readme, add two more metrics to influx client
This commit is contained in:
parent
d052e699db
commit
ebe05ec3e5
11
README.md
11
README.md
|
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
[](https://discord.gg/KnyKYt2)
|
[](https://discord.gg/KnyKYt2)
|
||||||
[](https://twitter.com/TwitchCaptain)
|
[](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://hub.docker.com/r/golift/unifi-poller)
|
||||||
[](https://www.somsubhra.com/github-release-stats/?username=davidnewhall&repository=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://github.com/davidnewhall/unifi-poller)
|
||||||
[](https://travis-ci.org/davidnewhall/unifi-poller)
|
[](https://travis-ci.org/davidnewhall/unifi-poller)
|
||||||
|
|
||||||
Collect your UniFi controller data and export it to an InfluxDB instance.
|
Collect your UniFi controller data and report it to an InfluxDB instance,
|
||||||
[Five Grafana Dashboards](http://grafana.com/dashboards?search=unifi-poller)
|
or export it for Prometheus collection. Prometheus support is new, and much
|
||||||
included; with screenshots. Updated 2019.
|
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
|
## Installation
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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
|
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
|
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.
|
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
|
reauthenticate default: false
|
||||||
Setting this parameter to true will make UniFi Poller send a new login
|
Setting this parameter to true will make UniFi Poller send a new login
|
||||||
|
|
|
||||||
|
|
@ -56,7 +56,7 @@ unifi_user = "influx"
|
||||||
unifi_pass = "4BB9345C-2341-48D7-99F5-E01B583FF77F"
|
unifi_pass = "4BB9345C-2341-48D7-99F5-E01B583FF77F"
|
||||||
unifi_url = "https://127.0.0.1:8443"
|
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.
|
# Only useful if IDS or IPS are enabled on one of the sites.
|
||||||
collect_ids = false
|
collect_ids = false
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -79,7 +79,7 @@
|
||||||
<unifi_pass></unifi_pass>
|
<unifi_pass></unifi_pass>
|
||||||
<unifi_url>https://127.0.0.1:8443</unifi_url>
|
<unifi_url>https://127.0.0.1:8443</unifi_url>
|
||||||
<!--
|
<!--
|
||||||
# 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.
|
# Only useful if IDS or IPS are enabled on one of the sites.
|
||||||
-->
|
-->
|
||||||
<collect_ids>false</collect_ids>
|
<collect_ids>false</collect_ids>
|
||||||
|
|
|
||||||
|
|
@ -57,7 +57,7 @@ unifi_user: "influx"
|
||||||
unifi_pass: ""
|
unifi_pass: ""
|
||||||
unifi_url: "https://127.0.0.1:8443"
|
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.
|
# Only useful if IDS or IPS are enabled on one of the sites.
|
||||||
collect_ids: false
|
collect_ids: false
|
||||||
|
|
||||||
|
|
|
||||||
2
main.go
2
main.go
|
|
@ -3,7 +3,7 @@ package main
|
||||||
import (
|
import (
|
||||||
"log"
|
"log"
|
||||||
|
|
||||||
"github.com/davidnewhall/unifi-poller/poller"
|
"github.com/davidnewhall/unifi-poller/pkg/poller"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Keep it simple.
|
// Keep it simple.
|
||||||
|
|
|
||||||
|
|
@ -56,6 +56,7 @@ func ClientPoints(c *unifi.Client, now time.Time) ([]*influx.Point, error) {
|
||||||
"essid": c.Essid,
|
"essid": c.Essid,
|
||||||
"bssid": c.Bssid,
|
"bssid": c.Bssid,
|
||||||
"radio_desc": c.RadioDescription,
|
"radio_desc": c.RadioDescription,
|
||||||
|
"satisfaction": c.Satisfaction.Val,
|
||||||
"hostname": c.Hostname,
|
"hostname": c.Hostname,
|
||||||
"dpi_stats_last_updated": c.DpiStatsLastUpdated,
|
"dpi_stats_last_updated": c.DpiStatsLastUpdated,
|
||||||
"last_seen_by_uap": c.LastSeenByUAP,
|
"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": c.TxBytes,
|
||||||
"tx_bytes_r": c.TxBytesR,
|
"tx_bytes_r": c.TxBytesR,
|
||||||
"tx_packets": c.TxPackets,
|
"tx_packets": c.TxPackets,
|
||||||
|
"tx_retries": c.TxRetries,
|
||||||
"tx_power": c.TxPower,
|
"tx_power": c.TxPower,
|
||||||
"tx_rate": c.TxRate,
|
"tx_rate": c.TxRate,
|
||||||
"uptime": c.Uptime,
|
"uptime": c.Uptime,
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
package influxunifi
|
package influxunifi
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/davidnewhall/unifi-poller/metrics"
|
"github.com/davidnewhall/unifi-poller/pkg/metrics"
|
||||||
client "github.com/influxdata/influxdb1-client/v2"
|
client "github.com/influxdata/influxdb1-client/v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -4,8 +4,8 @@ import (
|
||||||
"crypto/tls"
|
"crypto/tls"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/davidnewhall/unifi-poller/influxunifi"
|
"github.com/davidnewhall/unifi-poller/pkg/influxunifi"
|
||||||
"github.com/davidnewhall/unifi-poller/metrics"
|
"github.com/davidnewhall/unifi-poller/pkg/metrics"
|
||||||
influx "github.com/influxdata/influxdb1-client/v2"
|
influx "github.com/influxdata/influxdb1-client/v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -6,8 +6,8 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/davidnewhall/unifi-poller/metrics"
|
"github.com/davidnewhall/unifi-poller/pkg/metrics"
|
||||||
"github.com/davidnewhall/unifi-poller/promunifi"
|
"github.com/davidnewhall/unifi-poller/pkg/promunifi"
|
||||||
"github.com/prometheus/client_golang/prometheus"
|
"github.com/prometheus/client_golang/prometheus"
|
||||||
"github.com/prometheus/client_golang/prometheus/promhttp"
|
"github.com/prometheus/client_golang/prometheus/promhttp"
|
||||||
)
|
)
|
||||||
|
|
@ -5,7 +5,7 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/davidnewhall/unifi-poller/metrics"
|
"github.com/davidnewhall/unifi-poller/pkg/metrics"
|
||||||
"golift.io/unifi"
|
"golift.io/unifi"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -8,7 +8,7 @@ import (
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/davidnewhall/unifi-poller/metrics"
|
"github.com/davidnewhall/unifi-poller/pkg/metrics"
|
||||||
"github.com/prometheus/client_golang/prometheus"
|
"github.com/prometheus/client_golang/prometheus"
|
||||||
"golift.io/unifi"
|
"golift.io/unifi"
|
||||||
)
|
)
|
||||||
|
|
@ -4,7 +4,7 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/davidnewhall/unifi-poller/metrics"
|
"github.com/davidnewhall/unifi-poller/pkg/metrics"
|
||||||
"github.com/prometheus/client_golang/prometheus"
|
"github.com/prometheus/client_golang/prometheus"
|
||||||
)
|
)
|
||||||
|
|
||||||
Loading…
Reference in New Issue