From 3e272eaaab1126a7f6411a13583039fc461a424e Mon Sep 17 00:00:00 2001 From: MatthewHink Date: Thu, 8 Jul 2021 15:04:43 -0700 Subject: [PATCH] Version 2.1.3. (#69) Emit Well Known Alarm Info Time in scan. Fixes https://vaporio.atlassian.net/browse/VIO-1089. --- Makefile | 2 +- pkg/snmp/mibs/ups_mib/ups_alarms_table.go | 4 ++-- pkg/snmp/mibs/ups_mib/ups_alarms_table_test.go | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 8a5d974..ee2f63c 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ # PLUGIN_NAME := snmp -PLUGIN_VERSION := 2.1.2 +PLUGIN_VERSION := 2.1.3 IMAGE_NAME := vaporio/snmp-plugin BIN_NAME := synse-snmp-plugin diff --git a/pkg/snmp/mibs/ups_mib/ups_alarms_table.go b/pkg/snmp/mibs/ups_mib/ups_alarms_table.go index 7f42ec4..40e3ee4 100644 --- a/pkg/snmp/mibs/ups_mib/ups_alarms_table.go +++ b/pkg/snmp/mibs/ups_mib/ups_alarms_table.go @@ -11,7 +11,7 @@ import ( // upsAlarmsInfo is what the device info will be under SNMP OID // .1.3.6.1.2.1.33.1.6.3 view it in a MIB browser to see the names. var upsAlarmsInfo = []string{ - "upsAlarmBateryBad", + "upsAlarmBatteryBad", "upsAlarmOnBattery", "upsAlarmLowBattery", "upsAlarmDepletedBattery", @@ -148,7 +148,7 @@ func (enumerator UpsAlarmsTableDeviceEnumerator) DeviceEnumerator( } device = &config.DeviceInstance{ - Info: fmt.Sprintf("upsAlarmTime%d", i), + Info: fmt.Sprintf("%sTime", upsAlarmsInfo[i]), Data: deviceData, } statusProto.Instances = append(statusProto.Instances, device) diff --git a/pkg/snmp/mibs/ups_mib/ups_alarms_table_test.go b/pkg/snmp/mibs/ups_mib/ups_alarms_table_test.go index c2ccb90..697b516 100644 --- a/pkg/snmp/mibs/ups_mib/ups_alarms_table_test.go +++ b/pkg/snmp/mibs/ups_mib/ups_alarms_table_test.go @@ -13,7 +13,7 @@ import ( func TestUpsAlarmsInfo(t *testing.T) { var expected = []string{ - "upsAlarmBateryBad", + "upsAlarmBatteryBad", "upsAlarmOnBattery", "upsAlarmLowBattery", "upsAlarmDepletedBattery",