mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-09-12 22:47:00 +08:00
Refactor line for conciseness
This commit is contained in:
@@ -29,11 +29,7 @@ class SNMPMonitorType extends MonitorType {
|
|||||||
|
|
||||||
const varbinds = await new Promise((resolve, reject) => {
|
const varbinds = await new Promise((resolve, reject) => {
|
||||||
session.get([ monitor.snmpOid ], (error, varbinds) => {
|
session.get([ monitor.snmpOid ], (error, varbinds) => {
|
||||||
if (error) {
|
error ? reject(error) : resolve(varbinds);
|
||||||
reject(error);
|
|
||||||
} else {
|
|
||||||
resolve(varbinds);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
log.debug("monitor", `SNMP: Received varbinds (Type: ${snmp.ObjectType[varbinds[0].type]} Value: ${varbinds[0].value}`);
|
log.debug("monitor", `SNMP: Received varbinds (Type: ${snmp.ObjectType[varbinds[0].type]} Value: ${varbinds[0].value}`);
|
||||||
|
Reference in New Issue
Block a user