From d92ad58ce9a664fadc8d1e0a383efad214eaf5c5 Mon Sep 17 00:00:00 2001 From: xtan <286809395@qq.com> Date: Thu, 13 Jun 2024 20:08:52 +0800 Subject: [PATCH 1/4] refactor: reduce ipmi log --- inputs/ipmi/exporter/collector_ipmi.go | 7 +++++-- inputs/ipmi/exporter/collector_notwindows.go | 10 ++++++++-- inputs/ipmi/exporter/freeipmi/freeipmi.go | 7 ++++++- 3 files changed, 19 insertions(+), 5 deletions(-) diff --git a/inputs/ipmi/exporter/collector_ipmi.go b/inputs/ipmi/exporter/collector_ipmi.go index eda86eed..7532e1c0 100644 --- a/inputs/ipmi/exporter/collector_ipmi.go +++ b/inputs/ipmi/exporter/collector_ipmi.go @@ -24,6 +24,7 @@ import ( "github.com/prometheus/client_golang/prometheus" + cfg "flashcat.cloud/categraf/config" "flashcat.cloud/categraf/inputs/ipmi/exporter/freeipmi" ) @@ -167,11 +168,13 @@ func (c IPMICollector) Collect(result freeipmi.Result, ch chan<- prometheus.Metr case "N/A": state = math.NaN() default: - log.Println("msg", "Unknown sensor state", "target", targetHost, "state", data.State) + log.Println("W!", "Unknown sensor state", "target", targetHost, "state", data.State) state = math.NaN() } - log.Println("msg", "Got values", "target", targetHost, "data", fmt.Sprintf("%+v", data)) + if cfg.Config.DebugMode { + log.Println("D!", "Got values", "target", targetHost, "data", fmt.Sprintf("%+v", data)) + } switch data.Unit { case "RPM": diff --git a/inputs/ipmi/exporter/collector_notwindows.go b/inputs/ipmi/exporter/collector_notwindows.go index 5b7234f7..721c5760 100644 --- a/inputs/ipmi/exporter/collector_notwindows.go +++ b/inputs/ipmi/exporter/collector_notwindows.go @@ -23,6 +23,7 @@ import ( "github.com/prometheus/client_golang/prometheus" + cfg "flashcat.cloud/categraf/config" "flashcat.cloud/categraf/inputs/ipmi/exporter/freeipmi" ) @@ -84,7 +85,10 @@ func Collect(ch chan<- prometheus.Metric, host, binPath string, config IPMIConfi start := time.Now() defer func() { duration := time.Since(start).Seconds() - log.Println("msg", "Scrape duration", "target", targetName(host), "duration", duration) + + if cfg.Config.DebugMode { + log.Println("D!", "Scrape duration", "target", targetName(host), "duration", duration) + } ch <- prometheus.MustNewConstMetric( durationDesc, prometheus.GaugeValue, @@ -99,7 +103,9 @@ func Collect(ch chan<- prometheus.Metric, host, binPath string, config IPMIConfi for _, collector := range config.GetCollectors() { var up int - log.Println("msg", "Running collector", "target", target.host, "collector", collector.Name()) + if cfg.Config.DebugMode { + log.Println("D!", "Running collector", "target", target.host, "collector", collector.Name()) + } fqcmd := path.Join(binPath, collector.Cmd()) args := collector.Args() diff --git a/inputs/ipmi/exporter/freeipmi/freeipmi.go b/inputs/ipmi/exporter/freeipmi/freeipmi.go index a338048c..adfd5f15 100644 --- a/inputs/ipmi/exporter/freeipmi/freeipmi.go +++ b/inputs/ipmi/exporter/freeipmi/freeipmi.go @@ -31,6 +31,8 @@ import ( "strconv" "strings" "syscall" + + cfg "flashcat.cloud/categraf/config" ) var ( @@ -152,7 +154,10 @@ func Execute(cmd string, args []string, config string, target string) Result { args = append(args, "-h", target) } - log.Println("msg", "Executing", "command", cmd, "args", fmt.Sprintf("%+v", args)) + if cfg.Config.DebugMode { + log.Println("D!", "Executing", "command", cmd, "args", fmt.Sprintf("%+v", args)) + } + out, err := exec.Command(cmd, args...).CombinedOutput() if err != nil { err = fmt.Errorf("error running %s: %s", cmd, err) From f535c74b01c2adb4b2c27958b5241f741556155b Mon Sep 17 00:00:00 2001 From: xtan <286809395@qq.com> Date: Fri, 14 Jun 2024 12:11:49 +0800 Subject: [PATCH 2/4] refactor: reduce ipmi log --- inputs/ipmi/exporter/collector_bmc.go | 10 ++++---- .../ipmi/exporter/collector_bmc_watchdog.go | 23 ++++++++++-------- inputs/ipmi/exporter/collector_chassis.go | 10 ++++---- inputs/ipmi/exporter/collector_dcmi.go | 6 +++-- inputs/ipmi/exporter/collector_ipmi.go | 9 +++---- inputs/ipmi/exporter/collector_notwindows.go | 9 ++++--- inputs/ipmi/exporter/collector_sel.go | 8 ++++--- inputs/ipmi/exporter/collector_sm_lan_mode.go | 10 ++++---- inputs/ipmi/exporter/config.go | 24 +++++++++---------- inputs/ipmi/instances.go | 2 +- 10 files changed, 62 insertions(+), 49 deletions(-) diff --git a/inputs/ipmi/exporter/collector_bmc.go b/inputs/ipmi/exporter/collector_bmc.go index 94816957..db77f910 100644 --- a/inputs/ipmi/exporter/collector_bmc.go +++ b/inputs/ipmi/exporter/collector_bmc.go @@ -37,7 +37,9 @@ var ( ) ) -type BMCCollector struct{} +type BMCCollector struct { + debugMod bool +} func (c BMCCollector) Name() CollectorName { return BMCCollectorName @@ -54,18 +56,18 @@ func (c BMCCollector) Args() []string { func (c BMCCollector) Collect(result freeipmi.Result, ch chan<- prometheus.Metric, target ipmiTarget) (int, error) { firmwareRevision, err := freeipmi.GetBMCInfoFirmwareRevision(result) if err != nil { - log.Println("msg", "Failed to collect BMC data", "target", targetName(target.host), "error", err) + log.Println("E!", "Failed to collect BMC data", "target", targetName(target.host), "error", err) return 0, err } manufacturerID, err := freeipmi.GetBMCInfoManufacturerID(result) if err != nil { - log.Println("msg", "Failed to collect BMC data", "target", targetName(target.host), "error", err) + log.Println("E!", "Failed to collect BMC data", "target", targetName(target.host), "error", err) return 0, err } systemFirmwareVersion, err := freeipmi.GetBMCInfoSystemFirmwareVersion(result) if err != nil { // This one is not always available. - log.Println("msg", "Failed to parse bmc-info data", "target", targetName(target.host), "error", err) + log.Println("E!", "Failed to parse bmc-info data", "target", targetName(target.host), "error", err) systemFirmwareVersion = "N/A" } ch <- prometheus.MustNewConstMetric( diff --git a/inputs/ipmi/exporter/collector_bmc_watchdog.go b/inputs/ipmi/exporter/collector_bmc_watchdog.go index 0c6269de..ec2bc0ec 100644 --- a/inputs/ipmi/exporter/collector_bmc_watchdog.go +++ b/inputs/ipmi/exporter/collector_bmc_watchdog.go @@ -17,9 +17,10 @@ package exporter import ( - "github.com/prometheus/client_golang/prometheus" "log" + "github.com/prometheus/client_golang/prometheus" + "flashcat.cloud/categraf/inputs/ipmi/exporter/freeipmi" ) @@ -81,7 +82,9 @@ var ( ) ) -type BMCWatchdogCollector struct{} +type BMCWatchdogCollector struct { + debugMod bool +} func (c BMCWatchdogCollector) Name() CollectorName { return BMCWatchdogCollectorName @@ -98,42 +101,42 @@ func (c BMCWatchdogCollector) Args() []string { func (c BMCWatchdogCollector) Collect(result freeipmi.Result, ch chan<- prometheus.Metric, target ipmiTarget) (int, error) { timerState, err := freeipmi.GetBMCWatchdogTimerState(result) if err != nil { - log.Println("msg", "Failed to collect BMC watchdog timer", "target", targetName(target.host), "error", err) + log.Println("E!", "Failed to collect BMC watchdog timer", "target", targetName(target.host), "error", err) return 0, err } currentTimerUse, err := freeipmi.GetBMCWatchdogTimerUse(result) if err != nil { - log.Println("msg", "Failed to collect BMC watchdog timer use", "target", targetName(target.host), "error", err) + log.Println("E!", "Failed to collect BMC watchdog timer use", "target", targetName(target.host), "error", err) return 0, err } loggingState, err := freeipmi.GetBMCWatchdogLoggingState(result) if err != nil { - log.Println("msg", "Failed to collect BMC watchdog logging", "target", targetName(target.host), "error", err) + log.Println("E!", "Failed to collect BMC watchdog logging", "target", targetName(target.host), "error", err) return 0, err } currentTimeoutAction, err := freeipmi.GetBMCWatchdogTimeoutAction(result) if err != nil { - log.Println("msg", "Failed to collect BMC watchdog timeout action", "target", targetName(target.host), "error", err) + log.Println("E!", "Failed to collect BMC watchdog timeout action", "target", targetName(target.host), "error", err) return 0, err } currentPretimeoutInterrupt, err := freeipmi.GetBMCWatchdogPretimeoutInterrupt(result) if err != nil { - log.Println("msg", "Failed to collect BMC watchdog pretimeout interrupt", "target", targetName(target.host), "error", err) + log.Println("E!", "Failed to collect BMC watchdog pretimeout interrupt", "target", targetName(target.host), "error", err) return 0, err } pretimeoutInterval, err := freeipmi.GetBMCWatchdogPretimeoutInterval(result) if err != nil { - log.Println("msg", "Failed to collect BMC watchdog pretimeout interval", "target", targetName(target.host), "error", err) + log.Println("E!", "Failed to collect BMC watchdog pretimeout interval", "target", targetName(target.host), "error", err) return 0, err } initialCountdown, err := freeipmi.GetBMCWatchdogInitialCountdown(result) if err != nil { - log.Println("msg", "Failed to collect BMC watchdog initial countdown", "target", targetName(target.host), "error", err) + log.Println("E!", "Failed to collect BMC watchdog initial countdown", "target", targetName(target.host), "error", err) return 0, err } currentCountdown, err := freeipmi.GetBMCWatchdogCurrentCountdown(result) if err != nil { - log.Println("msg", "Failed to collect BMC watchdog current countdown", "target", targetName(target.host), "error", err) + log.Println("E!", "Failed to collect BMC watchdog current countdown", "target", targetName(target.host), "error", err) return 0, err } diff --git a/inputs/ipmi/exporter/collector_chassis.go b/inputs/ipmi/exporter/collector_chassis.go index 63a221c5..da80f5bf 100644 --- a/inputs/ipmi/exporter/collector_chassis.go +++ b/inputs/ipmi/exporter/collector_chassis.go @@ -49,7 +49,9 @@ var ( ) ) -type ChassisCollector struct{} +type ChassisCollector struct { + debugMod bool +} func (c ChassisCollector) Name() CollectorName { return ChassisCollectorName @@ -66,17 +68,17 @@ func (c ChassisCollector) Args() []string { func (c ChassisCollector) Collect(result freeipmi.Result, ch chan<- prometheus.Metric, target ipmiTarget) (int, error) { currentChassisPowerState, err := freeipmi.GetChassisPowerState(result) if err != nil { - log.Println("msg", "Failed to collect chassis data", "target", targetName(target.host), "error", err) + log.Println("E!", "Failed to collect chassis data", "target", targetName(target.host), "error", err) return 0, err } currentChassisDriveFault, err := freeipmi.GetChassisDriveFault(result) if err != nil { - log.Println("msg", "Failed to collect chassis data", "target", targetName(target.host), "error", err) + log.Println("E!", "Failed to collect chassis data", "target", targetName(target.host), "error", err) return 0, err } currentChassisCoolingFault, err := freeipmi.GetChassisCoolingFault(result) if err != nil { - log.Println("msg", "Failed to collect chassis data", "target", targetName(target.host), "error", err) + log.Println("E!", "Failed to collect chassis data", "target", targetName(target.host), "error", err) return 0, err } ch <- prometheus.MustNewConstMetric( diff --git a/inputs/ipmi/exporter/collector_dcmi.go b/inputs/ipmi/exporter/collector_dcmi.go index 61a6014b..70059cc8 100644 --- a/inputs/ipmi/exporter/collector_dcmi.go +++ b/inputs/ipmi/exporter/collector_dcmi.go @@ -37,7 +37,9 @@ var ( ) ) -type DCMICollector struct{} +type DCMICollector struct { + debugMod bool +} func (c DCMICollector) Name() CollectorName { return DCMICollectorName @@ -54,7 +56,7 @@ func (c DCMICollector) Args() []string { func (c DCMICollector) Collect(result freeipmi.Result, ch chan<- prometheus.Metric, target ipmiTarget) (int, error) { currentPowerConsumption, err := freeipmi.GetCurrentPowerConsumption(result) if err != nil { - log.Println("msg", "Failed to collect DCMI data", "target", targetName(target.host), "error", err) + log.Println("E!", "Failed to collect DCMI data", "target", targetName(target.host), "error", err) return 0, err } // Returned value negative == Power Measurement is not avail diff --git a/inputs/ipmi/exporter/collector_ipmi.go b/inputs/ipmi/exporter/collector_ipmi.go index 7532e1c0..0b1ba8de 100644 --- a/inputs/ipmi/exporter/collector_ipmi.go +++ b/inputs/ipmi/exporter/collector_ipmi.go @@ -24,7 +24,6 @@ import ( "github.com/prometheus/client_golang/prometheus" - cfg "flashcat.cloud/categraf/config" "flashcat.cloud/categraf/inputs/ipmi/exporter/freeipmi" ) @@ -125,7 +124,9 @@ var ( ) ) -type IPMICollector struct{} +type IPMICollector struct { + debugMod bool +} func (c IPMICollector) Name() CollectorName { return IPMICollectorName @@ -152,7 +153,7 @@ func (c IPMICollector) Collect(result freeipmi.Result, ch chan<- prometheus.Metr targetHost := targetName(target.host) results, err := freeipmi.GetSensorData(result, excludeIds) if err != nil { - log.Println("msg", "Failed to collect sensor data", "target", targetHost, "error", err) + log.Println("E!", "Failed to collect sensor data", "target", targetHost, "error", err) return 0, err } for _, data := range results { @@ -172,7 +173,7 @@ func (c IPMICollector) Collect(result freeipmi.Result, ch chan<- prometheus.Metr state = math.NaN() } - if cfg.Config.DebugMode { + if c.debugMod { log.Println("D!", "Got values", "target", targetHost, "data", fmt.Sprintf("%+v", data)) } diff --git a/inputs/ipmi/exporter/collector_notwindows.go b/inputs/ipmi/exporter/collector_notwindows.go index 721c5760..58bd10f9 100644 --- a/inputs/ipmi/exporter/collector_notwindows.go +++ b/inputs/ipmi/exporter/collector_notwindows.go @@ -23,7 +23,6 @@ import ( "github.com/prometheus/client_golang/prometheus" - cfg "flashcat.cloud/categraf/config" "flashcat.cloud/categraf/inputs/ipmi/exporter/freeipmi" ) @@ -81,12 +80,12 @@ func markCollectorUp(ch chan<- prometheus.Metric, name string, up int) { } // Collect implements Prometheus.Collector. -func Collect(ch chan<- prometheus.Metric, host, binPath string, config IPMIConfig) { +func Collect(ch chan<- prometheus.Metric, host, binPath string, config IPMIConfig, debugMod bool) { start := time.Now() defer func() { duration := time.Since(start).Seconds() - if cfg.Config.DebugMode { + if debugMod { log.Println("D!", "Scrape duration", "target", targetName(host), "duration", duration) } ch <- prometheus.MustNewConstMetric( @@ -101,9 +100,9 @@ func Collect(ch chan<- prometheus.Metric, host, binPath string, config IPMIConfi config: config, } - for _, collector := range config.GetCollectors() { + for _, collector := range config.GetCollectors(debugMod) { var up int - if cfg.Config.DebugMode { + if debugMod { log.Println("D!", "Running collector", "target", target.host, "collector", collector.Name()) } diff --git a/inputs/ipmi/exporter/collector_sel.go b/inputs/ipmi/exporter/collector_sel.go index feb6cb6e..7ea7e61d 100644 --- a/inputs/ipmi/exporter/collector_sel.go +++ b/inputs/ipmi/exporter/collector_sel.go @@ -44,7 +44,9 @@ var ( ) ) -type SELCollector struct{} +type SELCollector struct { + debugMod bool +} func (c SELCollector) Name() CollectorName { return SELCollectorName @@ -61,12 +63,12 @@ func (c SELCollector) Args() []string { func (c SELCollector) Collect(result freeipmi.Result, ch chan<- prometheus.Metric, target ipmiTarget) (int, error) { entriesCount, err := freeipmi.GetSELInfoEntriesCount(result) if err != nil { - log.Println("msg", "Failed to collect SEL data", "target", targetName(target.host), "error", err) + log.Println("E!", "Failed to collect SEL data", "target", targetName(target.host), "error", err) return 0, err } freeSpace, err := freeipmi.GetSELInfoFreeSpace(result) if err != nil { - log.Println("msg", "Failed to collect SEL data", "target", targetName(target.host), "error", err) + log.Println("E!", "Failed to collect SEL data", "target", targetName(target.host), "error", err) return 0, err } ch <- prometheus.MustNewConstMetric( diff --git a/inputs/ipmi/exporter/collector_sm_lan_mode.go b/inputs/ipmi/exporter/collector_sm_lan_mode.go index 028e1a92..2e384a20 100644 --- a/inputs/ipmi/exporter/collector_sm_lan_mode.go +++ b/inputs/ipmi/exporter/collector_sm_lan_mode.go @@ -39,7 +39,9 @@ var ( ) ) -type SMLANModeCollector struct{} +type SMLANModeCollector struct { + debugMod bool +} func (c SMLANModeCollector) Name() CollectorName { return SMLANModeCollectorName @@ -56,11 +58,11 @@ func (c SMLANModeCollector) Args() []string { func (c SMLANModeCollector) Collect(result freeipmi.Result, ch chan<- prometheus.Metric, target ipmiTarget) (int, error) { octets, err := freeipmi.GetRawOctets(result) if err != nil { - log.Println("msg", "Failed to collect LAN mode data", "target", targetName(target.host), "error", err) + log.Println("E!", "Failed to collect LAN mode data", "target", targetName(target.host), "error", err) return 0, err } if len(octets) != 3 { - log.Println("msg", "Unexpected number of octets", "target", targetName(target.host), "octets", octets) + log.Println("E!", "Unexpected number of octets", "target", targetName(target.host), "octets", octets) return 0, fmt.Errorf("unexpected number of octets in raw response: %d", len(octets)) } @@ -69,7 +71,7 @@ func (c SMLANModeCollector) Collect(result freeipmi.Result, ch chan<- prometheus value, _ := strconv.Atoi(octets[2]) ch <- prometheus.MustNewConstMetric(lanModeDesc, prometheus.GaugeValue, float64(value)) default: - log.Println("msg", "Unexpected lan mode status (ipmi-raw)", "target", targetName(target.host), "sgatus", octets[2]) + log.Println("E!", "Unexpected lan mode status (ipmi-raw)", "target", targetName(target.host), "sgatus", octets[2]) return 0, fmt.Errorf("unexpected lan mode status: %s", octets[2]) } diff --git a/inputs/ipmi/exporter/config.go b/inputs/ipmi/exporter/config.go index 60f06355..7dfbbad1 100644 --- a/inputs/ipmi/exporter/config.go +++ b/inputs/ipmi/exporter/config.go @@ -67,29 +67,29 @@ func (c ConfiguredCollector) Collect(output freeipmi.Result, ch chan<- prometheu return c.collector.Collect(output, ch, target) } -func (c CollectorName) GetInstance() (Collector, error) { +func (c CollectorName) GetInstance(debugMod bool) (Collector, error) { // This is where a new Collector would have to be "registered" switch c { case IPMICollectorName: - return IPMICollector{}, nil + return IPMICollector{debugMod: debugMod}, nil case BMCCollectorName: - return BMCCollector{}, nil + return BMCCollector{debugMod: debugMod}, nil case BMCWatchdogCollectorName: - return BMCWatchdogCollector{}, nil + return BMCWatchdogCollector{debugMod: debugMod}, nil case SELCollectorName: - return SELCollector{}, nil + return SELCollector{debugMod: debugMod}, nil case DCMICollectorName: - return DCMICollector{}, nil + return DCMICollector{debugMod: debugMod}, nil case ChassisCollectorName: - return ChassisCollector{}, nil + return ChassisCollector{debugMod: debugMod}, nil case SMLANModeCollectorName: - return SMLANModeCollector{}, nil + return SMLANModeCollector{debugMod: debugMod}, nil } return nil, fmt.Errorf("invalid Collector: %s", string(c)) } -func (c CollectorName) IsValid() error { - _, err := c.GetInstance() +func (c CollectorName) IsValid(debugMod bool) error { + _, err := c.GetInstance(debugMod) return err } @@ -141,11 +141,11 @@ func checkOverflow(m map[string]interface{}, ctx string) error { return nil } -func (c IPMIConfig) GetCollectors() []Collector { +func (c IPMIConfig) GetCollectors(debugMod bool) []Collector { result := []Collector{} for _, co := range c.Collectors { // At this point validity has already been checked - i, _ := co.GetInstance() + i, _ := co.GetInstance(debugMod) cc := ConfiguredCollector{ collector: i, command: c.CollectorCmd[i.Name()], diff --git a/inputs/ipmi/instances.go b/inputs/ipmi/instances.go index 12dca7c2..ebdd1e4e 100644 --- a/inputs/ipmi/instances.go +++ b/inputs/ipmi/instances.go @@ -39,7 +39,7 @@ func (m *Instance) Gather(slist *types.SampleList) { metricChan := make(chan prometheus.Metric, 500) go func() { - exporter.Collect(metricChan, m.Target, m.Path, m.IPMIConfig) + exporter.Collect(metricChan, m.Target, m.Path, m.IPMIConfig, m.DebugMod) close(metricChan) }() for metric := range metricChan { From 0a773cb47cead9411596fa4874a3e343c5e9b480 Mon Sep 17 00:00:00 2001 From: xtan <286809395@qq.com> Date: Fri, 14 Jun 2024 12:14:28 +0800 Subject: [PATCH 3/4] refactor: reduce ipmi log --- inputs/ipmi/exporter/collector_notwindows.go | 2 +- inputs/ipmi/exporter/freeipmi/freeipmi.go | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/inputs/ipmi/exporter/collector_notwindows.go b/inputs/ipmi/exporter/collector_notwindows.go index 58bd10f9..b6b59961 100644 --- a/inputs/ipmi/exporter/collector_notwindows.go +++ b/inputs/ipmi/exporter/collector_notwindows.go @@ -110,7 +110,7 @@ func Collect(ch chan<- prometheus.Metric, host, binPath string, config IPMIConfi args := collector.Args() cfg := config.GetFreeipmiConfig() - result := freeipmi.Execute(fqcmd, args, cfg, target.host) + result := freeipmi.Execute(fqcmd, args, cfg, target.host, debugMod) up, _ = collector.Collect(result, ch, target) markCollectorUp(ch, string(collector.Name()), up) diff --git a/inputs/ipmi/exporter/freeipmi/freeipmi.go b/inputs/ipmi/exporter/freeipmi/freeipmi.go index adfd5f15..b110a108 100644 --- a/inputs/ipmi/exporter/freeipmi/freeipmi.go +++ b/inputs/ipmi/exporter/freeipmi/freeipmi.go @@ -31,8 +31,6 @@ import ( "strconv" "strings" "syscall" - - cfg "flashcat.cloud/categraf/config" ) var ( @@ -138,7 +136,7 @@ func freeipmiConfigPipe(config string) (string, error) { return pipe, nil } -func Execute(cmd string, args []string, config string, target string) Result { +func Execute(cmd string, args []string, config string, target string, debugMod bool) Result { pipe, err := freeipmiConfigPipe(config) if err != nil { return Result{nil, err} @@ -154,7 +152,7 @@ func Execute(cmd string, args []string, config string, target string) Result { args = append(args, "-h", target) } - if cfg.Config.DebugMode { + if debugMod { log.Println("D!", "Executing", "command", cmd, "args", fmt.Sprintf("%+v", args)) } From a5b8a89fc7e25a8540367be34366aceb250e859e Mon Sep 17 00:00:00 2001 From: xtan <286809395@qq.com> Date: Fri, 14 Jun 2024 12:58:34 +0800 Subject: [PATCH 4/4] refactor: reduce ipmi log --- inputs/ipmi/exporter/collector_windows.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inputs/ipmi/exporter/collector_windows.go b/inputs/ipmi/exporter/collector_windows.go index 3756fed1..40134dcd 100644 --- a/inputs/ipmi/exporter/collector_windows.go +++ b/inputs/ipmi/exporter/collector_windows.go @@ -11,6 +11,6 @@ type IPMIConfig struct { Timeout uint32 } -func Collect(ch chan<- prometheus.Metric, host, binPath string, config IPMIConfig) { +func Collect(ch chan<- prometheus.Metric, host, binPath string, config IPMIConfig, debugMod bool) { return }