add log info

This commit is contained in:
Cody Lee 2022-12-08 20:35:13 -06:00
parent a148f669da
commit f392648182
No known key found for this signature in database
1 changed files with 6 additions and 2 deletions

View File

@ -99,8 +99,12 @@ func init() { // nolint: gochecknoinits
func (u *InfluxUnifi) PollController() { func (u *InfluxUnifi) PollController() {
interval := u.Interval.Round(time.Second) interval := u.Interval.Round(time.Second)
ticker := time.NewTicker(interval) ticker := time.NewTicker(interval)
log.Printf("[INFO] Poller->InfluxDB started, interval: %v, dp: %v, db: %s, url: %s", version := "1"
interval, u.DeadPorts, u.DB, u.URL) if u.IsVersion2 {
version = "2"
}
log.Printf("[INFO] Poller->InfluxDB started, version: %s, interval: %v, dp: %v, db: %s, url: %s",
version, interval, u.DeadPorts, u.DB, u.URL)
for u.LastCheck = range ticker.C { for u.LastCheck = range ticker.C {
metrics, err := u.Collector.Metrics(&poller.Filter{Name: "unifi"}) metrics, err := u.Collector.Metrics(&poller.Filter{Name: "unifi"})