Merge pull request #21 from dannyk81/log_rmcp_host

Add rmcp host info to log messages
This commit is contained in:
Conrad Hoffmann 2019-03-21 13:57:02 +01:00 committed by GitHub
commit 0c4d5f0ea2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 8 deletions

View File

@ -228,7 +228,7 @@ func freeipmiOutput(cmd string, target ipmiTarget, arg ...string) ([]byte, error
log.Debugf("Executing %s %v", fqcmd, args) log.Debugf("Executing %s %v", fqcmd, args)
out, err := exec.Command(fqcmd, args...).CombinedOutput() out, err := exec.Command(fqcmd, args...).CombinedOutput()
if err != nil { if err != nil {
log.Errorf("Error while calling %s: %s", cmd, out) log.Errorf("Error while calling %s for %s: %s", cmd, targetName(target.host), out)
} }
return out, err return out, err
} }
@ -370,13 +370,13 @@ func collectGenericSensor(ch chan<- prometheus.Metric, state float64, data senso
func collectMonitoring(ch chan<- prometheus.Metric, target ipmiTarget) (int, error) { func collectMonitoring(ch chan<- prometheus.Metric, target ipmiTarget) (int, error) {
output, err := ipmiMonitoringOutput(target) output, err := ipmiMonitoringOutput(target)
if err != nil { if err != nil {
log.Errorf("Failed to collect ipmimonitoring data: %s", err) log.Errorf("Failed to collect ipmimonitoring data from %s: %s", targetName(target.host), err)
return 0, err return 0, err
} }
excludeIds := target.config.ExcludeSensorIDs excludeIds := target.config.ExcludeSensorIDs
results, err := splitMonitoringOutput(output, excludeIds) results, err := splitMonitoringOutput(output, excludeIds)
if err != nil { if err != nil {
log.Errorf("Failed to parse ipmimonitoring data: %s", err) log.Errorf("Failed to parse ipmimonitoring data from %s: %s", targetName(target.host), err)
return 0, err return 0, err
} }
for _, data := range results { 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) { func collectDCMI(ch chan<- prometheus.Metric, target ipmiTarget) (int, error) {
output, err := ipmiDCMIOutput(target) output, err := ipmiDCMIOutput(target)
if err != nil { if err != nil {
log.Debugf("Failed to collect ipmi-dcmi data: %s", err) log.Debugf("Failed to collect ipmi-dcmi data from %s: %s", targetName(target.host), err)
return 0, err return 0, err
} }
currentPowerConsumption, err := getCurrentPowerConsumption(output) currentPowerConsumption, err := getCurrentPowerConsumption(output)
if err != nil { if err != nil {
log.Errorf("Failed to parse ipmi-dcmi data: %s", err) log.Errorf("Failed to parse ipmi-dcmi data from %s: %s", targetName(target.host), err)
return 0, err return 0, err
} }
ch <- prometheus.MustNewConstMetric( 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) { func collectBmcInfo(ch chan<- prometheus.Metric, target ipmiTarget) (int, error) {
output, err := bmcInfoOutput(target) output, err := bmcInfoOutput(target)
if err != nil { if err != nil {
log.Debugf("Failed to collect bmc-info data: %s", err) log.Debugf("Failed to collect bmc-info data from %s: %s", targetName(target.host), err)
return 0, err return 0, err
} }
firmwareRevision, err := getBMCInfoFirmwareRevision(output) firmwareRevision, err := getBMCInfoFirmwareRevision(output)
if err != nil { if err != nil {
log.Errorf("Failed to parse bmc-info data: %s", err) log.Errorf("Failed to parse bmc-info data from %s: %s", targetName(target.host), err)
return 0, err return 0, err
} }
manufacturerID, err := getBMCInfoManufacturerID(output) manufacturerID, err := getBMCInfoManufacturerID(output)
if err != nil { if err != nil {
log.Errorf("Failed to parse bmc-info data: %s", err) log.Errorf("Failed to parse bmc-info data from %s: %s", targetName(target.host), err)
return 0, err return 0, err
} }
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(