Update discord links, make processPoints better, add restartsec to unit
This commit is contained in:
parent
e1be422270
commit
a4a61c4b15
|
|
@ -1,7 +1,7 @@
|
|||
<img width="320px" src="https://raw.githubusercontent.com/wiki/davidnewhall/unifi-poller/images/unifi-poller-logo.png">
|
||||
|
||||
|
||||
[](https://discord.gg/DyVsMyt)
|
||||
[](https://discord.gg/KnyKYt2)
|
||||
[](https://twitter.com/TwitchCaptain)
|
||||
[](http://grafana.com/dashboards?search=unifi-poller)
|
||||
[](https://hub.docker.com/r/golift/unifi-poller)
|
||||
|
|
@ -22,8 +22,8 @@ included; with screenshots. Updated 2019.
|
|||
We have a special place for [Docker Users](https://github.com/davidnewhall/unifi-poller/wiki/Docker).
|
||||
I'm willing to help if you have troubles.
|
||||
Open an [Issue](https://github.com/davidnewhall/unifi-poller/issues) and
|
||||
we'll figure out how to get things working for you. You can also check out
|
||||
my [Discord server](https://discord.gg/DyVsMyt); sometimes I look at it too!
|
||||
we'll figure out how to get things working for you. You can also get help in
|
||||
the #unifi-poller channel on the [Ubiquiti Discord server](https://discord.gg/KnyKYt2).
|
||||
|
||||
## Description
|
||||
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ ExecStart=/usr/bin/{{BINARY}} $DAEMON_OPTS
|
|||
EnvironmentFile=-/etc/default/{{BINARY}}
|
||||
EnvironmentFile=-/etc/sysconfig/{{BINARY}}
|
||||
Restart=always
|
||||
RestartSec=10
|
||||
StandardOutput=syslog
|
||||
StandardError=syslog
|
||||
SyslogIdentifier={{BINARY}}
|
||||
|
|
|
|||
|
|
@ -176,25 +176,27 @@ func (u *UnifiPoller) ReportMetrics(metrics *Metrics) error {
|
|||
// still check&log it in case the data going is skewed up and causes errors!
|
||||
func (m *Metrics) ProcessPoints() []error {
|
||||
errs := []error{}
|
||||
processPoints := func(m *Metrics, p []*influx.Point, err error) error {
|
||||
if err != nil || p == nil {
|
||||
return err
|
||||
processPoints := func(m *Metrics, p []*influx.Point, err error) {
|
||||
switch {
|
||||
case err != nil:
|
||||
errs = append(errs, err)
|
||||
case p == nil:
|
||||
default:
|
||||
m.BatchPoints.AddPoints(p)
|
||||
}
|
||||
m.BatchPoints.AddPoints(p)
|
||||
return nil
|
||||
}
|
||||
|
||||
for _, asset := range m.Sites {
|
||||
pts, err := SitePoints(asset, m.TS)
|
||||
errs = append(errs, processPoints(m, pts, err))
|
||||
processPoints(m, pts, err)
|
||||
}
|
||||
for _, asset := range m.Clients {
|
||||
pts, err := ClientPoints(asset, m.TS)
|
||||
errs = append(errs, processPoints(m, pts, err))
|
||||
processPoints(m, pts, err)
|
||||
}
|
||||
for _, asset := range m.IDSList {
|
||||
pts, err := IDSPoints(asset) // no m.TS.
|
||||
errs = append(errs, processPoints(m, pts, err))
|
||||
processPoints(m, pts, err)
|
||||
}
|
||||
|
||||
if m.Devices == nil {
|
||||
|
|
@ -202,19 +204,19 @@ func (m *Metrics) ProcessPoints() []error {
|
|||
}
|
||||
for _, asset := range m.Devices.UAPs {
|
||||
pts, err := UAPPoints(asset, m.TS)
|
||||
errs = append(errs, processPoints(m, pts, err))
|
||||
processPoints(m, pts, err)
|
||||
}
|
||||
for _, asset := range m.Devices.USGs {
|
||||
pts, err := USGPoints(asset, m.TS)
|
||||
errs = append(errs, processPoints(m, pts, err))
|
||||
processPoints(m, pts, err)
|
||||
}
|
||||
for _, asset := range m.Devices.USWs {
|
||||
pts, err := USWPoints(asset, m.TS)
|
||||
errs = append(errs, processPoints(m, pts, err))
|
||||
processPoints(m, pts, err)
|
||||
}
|
||||
for _, asset := range m.Devices.UDMs {
|
||||
pts, err := UDMPoints(asset, m.TS)
|
||||
errs = append(errs, processPoints(m, pts, err))
|
||||
processPoints(m, pts, err)
|
||||
}
|
||||
return errs
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue