@@ -71,7 +71,7 @@ func (e *Exporter) exportFirmwareMetrics(body []byte) error {
7171 var dm = (* e .DeviceMetrics )["deviceInfo" ]
7272 err := json .Unmarshal (body , & mgr )
7373 if err != nil {
74- return fmt .Errorf ("Error Unmarshalling FirmwareMetrics - " + err .Error ())
74+ return fmt .Errorf ("Error Unmarshalling FirmwareMetrics - %s" , err .Error ())
7575 }
7676
7777 (* dm )["deviceInfo" ].WithLabelValues (e .systemHostname , e .ChassisSerialNumber , e .Model , mgr .FirmwareVersion , e .biosVersion ).Set (1.0 )
@@ -87,7 +87,7 @@ func (e *Exporter) exportPowerMetrics(body []byte) error {
8787 var bay int
8888 err := json .Unmarshal (body , & pm )
8989 if err != nil {
90- return fmt .Errorf ("Error Unmarshalling PowerMetrics - " + err .Error ())
90+ return fmt .Errorf ("Error Unmarshalling PowerMetrics - %s" , err .Error ())
9191 }
9292
9393 for _ , pc := range pm .PowerControl .PowerControl {
@@ -195,7 +195,7 @@ func (e *Exporter) exportThermalMetrics(body []byte) error {
195195 var therm = (* e .DeviceMetrics )["thermalMetrics" ]
196196 err := json .Unmarshal (body , & tm )
197197 if err != nil {
198- return fmt .Errorf ("Error Unmarshalling ThermalMetrics - " + err .Error ())
198+ return fmt .Errorf ("Error Unmarshalling ThermalMetrics - %s" , err .Error ())
199199 }
200200
201201 if tm .Status .State == "Enabled" {
@@ -277,7 +277,7 @@ func (e *Exporter) exportPhysicalDriveMetrics(body []byte) error {
277277 var cap int
278278 err := json .Unmarshal (body , & dlphysical )
279279 if err != nil {
280- return fmt .Errorf ("Error Unmarshalling DiskDriveMetrics - " + err .Error ())
280+ return fmt .Errorf ("Error Unmarshalling DiskDriveMetrics - %s" , err .Error ())
281281 }
282282 // Check physical drive is enabled then check status and convert string to numeric values
283283 if dlphysical .Status .State == "Absent" {
@@ -323,7 +323,7 @@ func (e *Exporter) exportLogicalDriveMetrics(body []byte) error {
323323 var volIdentifier string
324324 err := json .Unmarshal (body , & dllogical )
325325 if err != nil {
326- return fmt .Errorf ("Error Unmarshalling LogicalDriveMetrics - " + err .Error ())
326+ return fmt .Errorf ("Error Unmarshalling LogicalDriveMetrics - %s" , err .Error ())
327327 }
328328 if dllogical .Raid == "" {
329329 ldName = dllogical .DisplayName
@@ -358,7 +358,7 @@ func (e *Exporter) exportNVMeDriveMetrics(body []byte) error {
358358 var dlnvmedrive = (* e .DeviceMetrics )["nvmeMetrics" ]
359359 err := json .Unmarshal (body , & dlnvme )
360360 if err != nil {
361- return fmt .Errorf ("Error Unmarshalling NVMeDriveMetrics - " + err .Error ())
361+ return fmt .Errorf ("Error Unmarshalling NVMeDriveMetrics - %s" , err .Error ())
362362 }
363363
364364 // Check nvme drive is enabled then check status and convert string to numeric values
@@ -382,18 +382,18 @@ func (e *Exporter) exportUnknownDriveMetrics(body []byte) error {
382382 var protocol oem.DriveProtocol
383383 err := json .Unmarshal (body , & protocol )
384384 if err != nil {
385- return fmt .Errorf ("Error Unmarshalling for drive protocol - " + err .Error ())
385+ return fmt .Errorf ("Error Unmarshalling for drive protocol - %s" , err .Error ())
386386 }
387387
388388 if protocol .Protocol == "NVMe" {
389389 err = e .exportNVMeDriveMetrics (body )
390390 if err != nil {
391- return fmt .Errorf ("Error Unmarshalling NVMeDriveMetrics - " + err .Error ())
391+ return fmt .Errorf ("Error Unmarshalling NVMeDriveMetrics - %s" , err .Error ())
392392 }
393393 } else {
394394 err = e .exportPhysicalDriveMetrics (body )
395395 if err != nil {
396- return fmt .Errorf ("Error Unmarshalling DiskDriveMetrics - " + err .Error ())
396+ return fmt .Errorf ("Error Unmarshalling DiskDriveMetrics - %s" , err .Error ())
397397 }
398398 }
399399
@@ -408,7 +408,7 @@ func (e *Exporter) exportStorageControllerMetrics(body []byte) error {
408408 var drv = (* e .DeviceMetrics )["storageCtrlMetrics" ]
409409 err := json .Unmarshal (body , & scm )
410410 if err != nil {
411- return fmt .Errorf ("Error Unmarshalling StorageControllerMetrics - " + err .Error ())
411+ return fmt .Errorf ("Error Unmarshalling StorageControllerMetrics - %s" , err .Error ())
412412 }
413413
414414 for _ , sc := range scm .StorageController .StorageController {
@@ -447,7 +447,7 @@ func (e *Exporter) exportMemorySummaryMetrics(body []byte) error {
447447 var totalSystemMemoryGiB string
448448 err := json .Unmarshal (body , & dlm )
449449 if err != nil {
450- return fmt .Errorf ("Error Unmarshalling MemorySummaryMetrics - " + err .Error ())
450+ return fmt .Errorf ("Error Unmarshalling MemorySummaryMetrics - %s" , err .Error ())
451451 }
452452 // Check memory status and convert string to numeric values
453453 // Ignore memory summary if status is not present
@@ -479,7 +479,7 @@ func (e *Exporter) exportStorageBattery(body []byte) error {
479479 var storBattery = (* e .DeviceMetrics )["storBatteryMetrics" ]
480480 err := json .Unmarshal (body , & chasStorBatt )
481481 if err != nil {
482- return fmt .Errorf ("Error Unmarshalling Storage Battery Metrics - " + err .Error ())
482+ return fmt .Errorf ("Error Unmarshalling Storage Battery Metrics - %s" , err .Error ())
483483 }
484484
485485 if fmt .Sprint (chasStorBatt .Oem .Hp .Battery ) != "null" && len (chasStorBatt .Oem .Hp .Battery ) > 0 {
@@ -540,7 +540,7 @@ func (e *Exporter) exportMemoryMetrics(body []byte) error {
540540 var mem = (* e .DeviceMetrics )["memoryMetrics" ]
541541 err := json .Unmarshal (body , & mm )
542542 if err != nil {
543- return fmt .Errorf ("Error Unmarshalling MemoryMetrics - " + err .Error ())
543+ return fmt .Errorf ("Error Unmarshalling MemoryMetrics - %s" , err .Error ())
544544 }
545545
546546 if mm .DIMMStatus != "" {
@@ -620,7 +620,7 @@ func (e *Exporter) exportProcessorMetrics(body []byte) error {
620620 var proc = (* e .DeviceMetrics )["processorMetrics" ]
621621 err := json .Unmarshal (body , & pm )
622622 if err != nil {
623- return fmt .Errorf ("Error Unmarshalling ProcessorMetrics - " + err .Error ())
623+ return fmt .Errorf ("Error Unmarshalling ProcessorMetrics - %s" , err .Error ())
624624 }
625625
626626 switch pm .TotalCores .(type ) {
@@ -654,7 +654,7 @@ func (e *Exporter) exportFirmwareInventoryMetrics(body []byte) error {
654654
655655 err := json .Unmarshal (body , & fwcomponent )
656656 if err != nil {
657- return fmt .Errorf ("Error Unmarshalling FirmwareInventoryMetrics - " + err .Error ())
657+ return fmt .Errorf ("Error Unmarshalling FirmwareInventoryMetrics - %s" , err .Error ())
658658 }
659659 // Export for iLO4 since it has a different structure
660660 if len (fwcomponent .Current .Firmware ) > 0 {
@@ -666,7 +666,7 @@ func (e *Exporter) exportFirmwareInventoryMetrics(body []byte) error {
666666 var fwcomponent oem.GenericFirmware
667667 err := json .Unmarshal (body , & fwcomponent )
668668 if err != nil {
669- return fmt .Errorf ("Error Unmarshalling FirmwareInventoryMetrics - " + err .Error ())
669+ return fmt .Errorf ("Error Unmarshalling FirmwareInventoryMetrics - %s" , err .Error ())
670670 }
671671
672672 (* component )["componentFirmware" ].WithLabelValues (fwcomponent .Id , strings .TrimRight (fwcomponent .Name , " " ), fwcomponent .Description , fwcomponent .Version ).Set (1.0 )
@@ -682,7 +682,7 @@ func (e *Exporter) exportIloSelfTest(body []byte) error {
682682 var iloSelfTst = (* e .DeviceMetrics )["iloSelfTestMetrics" ]
683683 err := json .Unmarshal (body , & sysm )
684684 if err != nil {
685- return fmt .Errorf ("Error Unmarshalling iLO Self Test Metrics - " + err .Error ())
685+ return fmt .Errorf ("Error Unmarshalling iLO Self Test Metrics - %s" , err .Error ())
686686 }
687687
688688 if fmt .Sprint (sysm .Oem .Hp .IloSelfTest ) != "null" && len (sysm .Oem .Hp .IloSelfTest ) > 0 {
0 commit comments