From a3cdd69995a138a27fac31866e3993b3a44d3c67 Mon Sep 17 00:00:00 2001 From: Matt Visnovsky Date: Mon, 29 Apr 2024 13:56:32 -0600 Subject: [PATCH] Use net-snmp instead of snmp-native net-snmp over snmp-native is: -more robust -more popular -better documented -supports v3 --- package-lock.json | 16 ++++++++++------ package.json | 2 +- server/monitor-types/snmp.js | 2 +- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index 7728a0cfe..0e09c595c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -54,6 +54,7 @@ "mssql": "~8.1.4", "mysql2": "~3.6.2", "nanoid": "~3.3.4", + "net-snmp": "^3.11.2", "node-cloudflared-tunnel": "~1.0.9", "node-radius-client": "~1.0.0", "nodemailer": "~6.9.13", @@ -72,7 +73,6 @@ "redbean-node": "~0.3.0", "redis": "~4.5.1", "semver": "~7.5.4", - "snmp-native": "^1.2.0", "socket.io": "~4.6.1", "socket.io-client": "~4.6.1", "socks-proxy-agent": "6.1.1", @@ -10337,6 +10337,15 @@ "node": ">= 0.6" } }, + "node_modules/net-snmp": { + "version": "3.11.2", + "resolved": "https://registry.npmjs.org/net-snmp/-/net-snmp-3.11.2.tgz", + "integrity": "sha512-QKy2JQHIBsSK344dUxYRZv7tU0ANk8f8fzKD/Mmq/cCxm/cPbtiT7009QEgxdViW/gGjqGIOiLHxkCc+JhZltg==", + "dependencies": { + "asn1-ber": "^1.2.1", + "smart-buffer": "^4.1.0" + } + }, "node_modules/node-abort-controller": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/node-abort-controller/-/node-abort-controller-3.1.1.tgz", @@ -12610,11 +12619,6 @@ "npm": ">= 3.0.0" } }, - "node_modules/snmp-native": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/snmp-native/-/snmp-native-1.2.0.tgz", - "integrity": "sha512-JIyuLX3bQmuAI4gHztHSQd3M/M2hqgLhiHBZYEk8YnYRJ2ooxqwON4gUQfgp/WCZVDca4tIX3vFJgv6lz5iY+g==" - }, "node_modules/socket.io": { "version": "4.6.2", "resolved": "https://registry.npmjs.org/socket.io/-/socket.io-4.6.2.tgz", diff --git a/package.json b/package.json index 7ee8afb41..49cc56ffc 100644 --- a/package.json +++ b/package.json @@ -119,6 +119,7 @@ "mssql": "~8.1.4", "mysql2": "~3.6.2", "nanoid": "~3.3.4", + "net-snmp": "^3.11.2", "node-cloudflared-tunnel": "~1.0.9", "node-radius-client": "~1.0.0", "nodemailer": "~6.9.13", @@ -137,7 +138,6 @@ "redbean-node": "~0.3.0", "redis": "~4.5.1", "semver": "~7.5.4", - "snmp-native": "^1.2.0", "socket.io": "~4.6.1", "socket.io-client": "~4.6.1", "socks-proxy-agent": "6.1.1", diff --git a/server/monitor-types/snmp.js b/server/monitor-types/snmp.js index 4ddc88230..433fc527f 100644 --- a/server/monitor-types/snmp.js +++ b/server/monitor-types/snmp.js @@ -1,6 +1,6 @@ const { MonitorType } = require("./monitor-type"); const { UP, DOWN } = require("../../src/util"); -const snmp = require("snmp-native"); +const snmp = require("net-snmp"); class SNMPMonitorType extends MonitorType { name = "snmp";