OS module on steroids with the SIGAR Node binding
By David WORMS
Jan 11, 2012
- Categories
- Node.js
- Tags
- C++
- CPU
- File system
- Metrics
- Monitoring
- Network
Never miss our publications about Open Source, big data and distributed systems, low frequency of one email every two months.
Today we are announcing the first release of the Node binding to the SIGAR library. Visit the project website or the source code repository on GitHub.
SIGAR is a cross platform interface for gathering system information. From the project website, such information include:
- System memory, swap, cpu, load average, uptime, logins
- Per-process memory, cpu, credential info, state, arguments, environment, open files
- File system detection and metrics
- Network interface detection, configuration info and metrics
- TCP and UDP connection tables
- Network route table
Please consult the SIGAR documentation (the documentation is no longer online) for a complete list of supported operating systems, architectures and versions.
The current version is a complete binding of the SIGAR API. There are still however a few minor issues left due to our lack of C++ skills and SIGAR understanding. Please give us some help if you are a knowledgeable Node C++ binder or an experienced SIGAR user.
Here is an example returning CPU information:
var sigar = require('sigar');
var cpus = sigar().cpuList()
for(var i = 0; i < cpus.length; i++){
console.log(cpus[i]);
}
Visit the Node SIGAR website for a complete view of the API.