From c68b1c6274065eac57bb277d1151196792974951 Mon Sep 17 00:00:00 2001 From: Matt Visnovsky Date: Mon, 6 May 2024 12:05:12 -0600 Subject: [PATCH] Remove unnecessary func getKey --- server/monitor-types/snmp.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server/monitor-types/snmp.js b/server/monitor-types/snmp.js index b1676f53e..3a734d2cf 100644 --- a/server/monitor-types/snmp.js +++ b/server/monitor-types/snmp.js @@ -1,5 +1,5 @@ const { MonitorType } = require("./monitor-type"); -const { UP, DOWN, log, getKey } = require("../../src/util"); +const { UP, DOWN, log } = require("../../src/util"); const snmp = require("net-snmp"); class SNMPMonitorType extends MonitorType { @@ -14,7 +14,7 @@ class SNMPMonitorType extends MonitorType { port: monitor.port || "161", retries: monitor.maxretries, timeout: monitor.timeout * 1000, - version: monitor.snmpVersion, + version: parseInt(monitor.snmpVersion), }; try { @@ -34,7 +34,7 @@ class SNMPMonitorType extends MonitorType { } }); }); - log.debug("monitor", `SNMP: Received varbinds (Type=${getKey(snmp.ObjectType, varbinds[0].type)}): ${varbinds[0].value}`); + log.debug("monitor", `SNMP: Received varbinds (Type: ${snmp.ObjectType[varbinds[0].type]} Value: ${varbinds[0].value}`); // Verify if any varbinds were returned from the SNMP session or if the varbind type indicates a non-existent instance. if (varbinds.length === 0 || varbinds[0].type === snmp.ObjectType.NoSuchInstance) {