Temp fix for test cases and warning from Dockerfile

This commit is contained in:
aharper343
2025-12-23 16:10:22 -05:00
parent 0b9d3de5cc
commit 22dfc25801
4 changed files with 18 additions and 12 deletions

View File

@@ -123,7 +123,7 @@ func (u *InputUnifi) pollController(c *Controller) (*poller.Metrics, error) {
if m.CountryTraffic, err = c.Unifi.GetCountryTraffic(sites, &tp); err != nil {
return nil, fmt.Errorf("unifi.GetCountryTraffic(%s): %w", c.URL, err)
}
u.Logf("Found %d CountryTraffic entries", len(m.CountryTraffic))
u.LogDebugf("Found %d CountryTraffic entries", len(m.CountryTraffic))
}
if c.SaveTraffic != nil && *c.SaveTraffic && c.SaveDPI != nil && *c.SaveDPI {
@@ -131,10 +131,10 @@ func (u *InputUnifi) pollController(c *Controller) (*poller.Metrics, error) {
if err != nil {
return nil, fmt.Errorf("unifi.GetClientTraffic(%s): %w", c.URL, err)
}
u.Logf("Found %d ClientUsageByApp entries", len(clientUsageByApp))
u.LogDebugf("Found %d ClientUsageByApp entries", len(clientUsageByApp))
b4 := len(m.ClientsDPI)
u.convertToClientDPI(clientUsageByApp, m)
u.Logf("Added %d ClientDPI entries for a total of %d", len(m.ClientsDPI)-b4, len(m.ClientsDPI))
u.LogDebugf("Added %d ClientDPI entries for a total of %d", len(m.ClientsDPI)-b4, len(m.ClientsDPI))
}
// Get all the points.

View File

@@ -277,6 +277,10 @@ func (u *InputUnifi) setDefaults(c *Controller) { //nolint:cyclop
c.SaveAnomal = &f
}
if c.SaveTraffic == nil {
c.SaveTraffic = &f
}
if c.URL == "" {
c.URL = defaultURL
}