address issue
This commit is contained in:
parent
5122360018
commit
4b19b873ab
|
|
@ -106,7 +106,7 @@ func (u *DatadogUnifi) setConfigDefaults() {
|
|||
u.Interval = cnfg.Duration{Duration: minimumInterval}
|
||||
}
|
||||
|
||||
u.Interval = cnfg.Duration{Duration: u.Interval.Duration.Round(time.Second)}
|
||||
u.Interval = cnfg.Duration{Duration: u.Interval.Round(time.Second)}
|
||||
|
||||
u.options = make([]statsd.Option, 0)
|
||||
|
||||
|
|
@ -182,7 +182,7 @@ func (u *DatadogUnifi) DebugOutput() (bool, error) {
|
|||
|
||||
u.Statsd, err = statsd.New(u.Address, u.options...)
|
||||
if err != nil {
|
||||
return false, fmt.Errorf("Error configuration Datadog agent reporting: %+v", err)
|
||||
return false, fmt.Errorf("error configuration Datadog agent reporting: %+v", err)
|
||||
}
|
||||
|
||||
return true, nil
|
||||
|
|
|
|||
|
|
@ -165,7 +165,7 @@ func (u *InfluxUnifi) DebugOutput() (bool, error) {
|
|||
|
||||
u.setConfigDefaults()
|
||||
|
||||
_, err := url.Parse(u.Config.URL)
|
||||
_, err := url.Parse(u.URL)
|
||||
if err != nil {
|
||||
return false, fmt.Errorf("invalid influx URL: %v", err)
|
||||
}
|
||||
|
|
@ -223,7 +223,7 @@ func (u *InfluxUnifi) Run(c poller.Collect) error {
|
|||
|
||||
u.setConfigDefaults()
|
||||
|
||||
_, err = url.Parse(u.Config.URL)
|
||||
_, err = url.Parse(u.URL)
|
||||
if err != nil {
|
||||
u.LogErrorf("invalid influx URL: %v", err)
|
||||
|
||||
|
|
@ -304,7 +304,7 @@ func (u *InfluxUnifi) setConfigDefaults() {
|
|||
u.Interval = cnfg.Duration{Duration: minimumInterval}
|
||||
}
|
||||
|
||||
u.Interval = cnfg.Duration{Duration: u.Interval.Duration.Round(time.Second)}
|
||||
u.Interval = cnfg.Duration{Duration: u.Interval.Round(time.Second)}
|
||||
}
|
||||
|
||||
func (u *InfluxUnifi) getPassFromFile(filename string) string {
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ func (u *UnifiPoller) Start() error {
|
|||
}
|
||||
|
||||
log.Fatal("Failed debug checks")
|
||||
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
@ -88,7 +88,7 @@ func (f *Flags) Parse(args []string) {
|
|||
// 3. Start a web server and wait for Prometheus to poll the application for metrics.
|
||||
func (u *UnifiPoller) Run() error {
|
||||
if u.Flags.DumpJSON != "" {
|
||||
u.Config.Quiet = true
|
||||
u.Quiet = true
|
||||
if err := u.InitializeInputs(); err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
|
|||
|
|
@ -306,7 +306,7 @@ func (u *promUnifi) collect(ch chan<- prometheus.Metric, filter *poller.Filter)
|
|||
|
||||
r := &Report{
|
||||
Config: u.Config,
|
||||
ch: make(chan []*metric, u.Config.Buffer),
|
||||
ch: make(chan []*metric, u.Buffer),
|
||||
Start: time.Now(),
|
||||
}
|
||||
defer r.close()
|
||||
|
|
|
|||
|
|
@ -176,7 +176,7 @@ func (w *webPlugins) newInputEvent(plugin, id string, event *Event) {
|
|||
input.Events[id] = &EventGroup{}
|
||||
}
|
||||
|
||||
input.Events[id].add(event, int(w.Config.MaxEvents))
|
||||
input.Events[id].add(event, int(w.MaxEvents))
|
||||
}
|
||||
|
||||
func (w *webPlugins) newOutputEvent(plugin, id string, event *Event) {
|
||||
|
|
@ -196,7 +196,7 @@ func (w *webPlugins) newOutputEvent(plugin, id string, event *Event) {
|
|||
output.Events[id] = &EventGroup{}
|
||||
}
|
||||
|
||||
output.Events[id].add(event, int(w.Config.MaxEvents))
|
||||
output.Events[id].add(event, int(w.MaxEvents))
|
||||
}
|
||||
|
||||
func (w *webPlugins) newInput(config *Input) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue