![Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility](https://cdn.sanity.io/images/cgdhsj6q/production/97774ea8c88cc8f4bed2766c31994ebc38116948-1664x1366.png?w=400&fit=max&auto=format)
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
An snmp trap receiver router, similar in concept to the HTTP request routing in the likes of Expressjs.
It's a trap...receiver router similar in concept to how Expressjs routes HTTP requests. Has been tested and works with SNMPv2c.
Makes use of the snmp-native package for parsing SNMP messages.
var snmprouter = require('itsnmptrap');
var trapper = new snmprouter({once: true});
trapper.use(function(trap, next) {
//only allow traps from
next(/192\.168\.1\./.test(trap.remote.address));
});
trapper.trap('1.3.6.1.4.1.20632.2.3', function(trap) {
console.log("Barracuda out queue:", trap.value);
})
##Methods
####constructor([opts])
opts: {
once: false // If true, only executes the first matching trap() callback.
// Sets the default for all trap()s.
}
Somewhat similar to Expressjs and it's use(). This can filter the incoming SNMP messages before getting the trap()s.
/./
.If oid is a string, it must match against entire oid from the snmp message. OIDs for specific hosts can be defined by using the ipaddress@oid format. When using the ipaddress@oid format, the ip address portion can be a regex that does not make use of the @ sign.
Alternatively, RegExp can be used for matching oids.
callback(trap, next)
//next takes a boolean or no value.
//True or undefined proceeds to the next filter
//False or not calling next() stops processing the chain and will
// prevent further processing of the SNMP message.
trap = {
oid: 'oid'
,value: 'value'
,varbind: 'raw varbind provided by snmp-native'
,msg: 'entire snmp-native object of original message'
,remote: {address: 'remote ip address', port: 'remote port'}
}
#####example
//don't process any oids starting with 1.3
use(/1\.3/, function(trap, next) { next(false); });
//don't process any oid's with the remote ip address 1.1.1.1.
use(function(trap, next) { next(trap.remote.address == '1.1.1.1'); });
trap(oid, callback)
trap(opt, callback)
trap(oid, opt, callback)
callback(trap) //trap is the same as the one from use().
Start listening on a port for SNMP traps
Stops the UDP socket.
MIT
FAQs
An snmp trap receiver router, similar in concept to the HTTP request routing in the likes of Expressjs.
The npm package itsnmptrap receives a total of 4 weekly downloads. As such, itsnmptrap popularity was classified as not popular.
We found that itsnmptrap demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.