Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
nogger-node-adapter
Advanced tools
This is an adapter for node.js to use nogger. It allows to export logs and metrics about the server like cpu and memory consumption. More on nogger at the main repository: https://github.com/paul-em/nogger
Install the module with: npm install nogger-node-adapter --save
In your project you simply include and initialize it by passing the config.
var nogger = require('nogger-node-adapter').init(config);
For the options in the config see the config part.
To use custom metrics you simply access objects from
var metrics = nogger.metrics;
The static metrics allows you to log a text or numbers you don't want to visualize in any chart.
Here is an example:
var staticMetric = new nogger.metrics.Static(function(){
return {
"TestStatic" : "This is a text that will appear on the page"
}
});
This will look like this on the dashboard:
Arguments:
Options:
staticMetric.getData() // returns the Data
staticMetric.update() // triggers an update
Counter for incrementing and decrementing numbers and showing this in a graph.
Here is an example:
var counter = new nogger.metrics.Counter('TestCounter');
counter.inc();
counter.dec();
This will look like this on the dashboard:
Arguments:
Options:
counter.inc() // increments the value
counter.dec() // decrements the value
counter.getData() // returns the Data
counter.update() // triggers an update
Meter for only upwards counting objects and visualising this in a graph.
Here is an example:
var meter = new nogger.metrics.Meter('TestMeter');
meter.mark();
This will look like this on the dashboard:
Arguments:
Options:
meter.mark() // increments the value
meter.getData() // returns the Data
meter.update() // triggers an update
Histogram allows to use different values each time. It is also allowed to combine different data model in one histogram.
Here is an example:
var histogram = new nogger.metrics.Histogram('TestHistogram2', ['alphaVal', 'betaVal'], function(){
return [
alphaVal,
betaVal
];
});
This will look like this on the dashboard:
Arguments:
Options:
histogram.getData() // returns the Data
histogram.update() // triggers an update
This class allows you to measure time in nanoseconds. The mean, max and min value in interval is stored.
Here is an example:
var timer = new nogger.metrics.Timer('TestTimer');
timer.start();
timer.end();
This will look like this on the dashboard:
Arguments:
Options:
timer.start() // starts the timer
timer.end() // stops the timer
timer.getData() // returns the Data
timer.update() // triggers an update
timer.runnning // is true or false
These are the default config options that can be overwritter
rotate: 'daily', // how often a new logFile should be generated
timezoneOffset: -60, // offset to your local timezone
maxLogLength: 250, // length of the string after it should be replaced with '...'
redisIP: '127.0.0.1', // ip of Redis database - preferably on your server
redisPort: 6379, // port of Redis database - 6379 is the default port for Redis
redisMetricsDb: 0, // Redis database where all metrics are saved
redisLogsDb: 1 // Redis database where all logs are saved
Copyright (c) 2014 Paul Em. Licensed under the MIT license.
FAQs
nogger - the node.js logger - node apdapter
We found that nogger-node-adapter 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.