From 7e5c643b90f118133d5ee7e5b94c501254232d04 Mon Sep 17 00:00:00 2001 From: Danny Kulchinsky Date: Sat, 16 Mar 2019 12:41:05 -0400 Subject: [PATCH] adding rcmp.host to error log messages --- collector.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/collector.go b/collector.go index d2bb25e..12883a6 100644 --- a/collector.go +++ b/collector.go @@ -370,13 +370,13 @@ func collectGenericSensor(ch chan<- prometheus.Metric, state float64, data senso func collectMonitoring(ch chan<- prometheus.Metric, target ipmiTarget) (int, error) { output, err := ipmiMonitoringOutput(target) if err != nil { - log.Errorf("Failed to collect ipmimonitoring data: %s", err) + log.Errorf("Failed to collect ipmimonitoring data from %s: %s", rcmp.host, err) return 0, err } excludeIds := target.config.ExcludeSensorIDs results, err := splitMonitoringOutput(output, excludeIds) if err != nil { - log.Errorf("Failed to parse ipmimonitoring data: %s", err) + log.Errorf("Failed to parse ipmimonitoring data from %s: %s", rcmp.host, err) return 0, err } for _, data := range results { @@ -419,12 +419,12 @@ func collectMonitoring(ch chan<- prometheus.Metric, target ipmiTarget) (int, err func collectDCMI(ch chan<- prometheus.Metric, target ipmiTarget) (int, error) { output, err := ipmiDCMIOutput(target) if err != nil { - log.Debugf("Failed to collect ipmi-dcmi data: %s", err) + log.Debugf("Failed to collect ipmi-dcmi data from %s: %s", rcmp.host, err) return 0, err } currentPowerConsumption, err := getCurrentPowerConsumption(output) if err != nil { - log.Errorf("Failed to parse ipmi-dcmi data: %s", err) + log.Errorf("Failed to parse ipmi-dcmi data from %s: %s", rcmp.host, err) return 0, err } ch <- prometheus.MustNewConstMetric( @@ -438,17 +438,17 @@ func collectDCMI(ch chan<- prometheus.Metric, target ipmiTarget) (int, error) { func collectBmcInfo(ch chan<- prometheus.Metric, target ipmiTarget) (int, error) { output, err := bmcInfoOutput(target) if err != nil { - log.Debugf("Failed to collect bmc-info data: %s", err) + log.Debugf("Failed to collect bmc-info data from %s: %s", rcmp.host, err) return 0, err } firmwareRevision, err := getBMCInfoFirmwareRevision(output) if err != nil { - log.Errorf("Failed to parse bmc-info data: %s", err) + log.Errorf("Failed to parse bmc-info data from %s: %s", rcmp.host, err) return 0, err } manufacturerID, err := getBMCInfoManufacturerID(output) if err != nil { - log.Errorf("Failed to parse bmc-info data: %s", err) + log.Errorf("Failed to parse bmc-info data from %s: %s", rcmp.host, err) return 0, err } ch <- prometheus.MustNewConstMetric(