Giter Club home page Giter Club logo

node-sigar's Introduction

Build Status

Node Sigar binding

A complete binding to the SIGAR library.

Documentation is available on the project website.

Note, documentation include important installation instruction for some platforms.

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
var sigar = require('sigar');
console.log(sigar.version()); // returns the version

// invoke the library
var Sigar = sigar.init();
console.log(sigar.cpu()); // {}

API

Sigar.mem();

> {
	ram: Number
	total: Number
	used: Number
	free: Number
	actual_used: Number
	actual_free: Number
	used_percent: Number
	free_percent: Number
}

Sigar.swap();

{
	total: Number
	used: Number
	free: Number
	page_in: Number
	page_out: Number
}

Sigar.uptime();

> 52883 // seconds

Sigar.loadavg();

[0.11, 0.13, 0.09]

Sigar.resourceLimit(); Sigar.whoList(); Sigar.sysInfo(); Sigar.fqdn(); // CPU Sigar.cpu(); Sigar.cpuList(); Sigar.cpuInfoList(); // Process Sigar.procList(); Sigar.procStat(); Sigar.procMem(); Sigar.procCred(); Sigar.procTime(); Sigar.procCpu(); Sigar.procState(); Sigar.procArgs(); Sigar.procEnv(); Sigar.procFd(); Sigar.procExe(); Sigar.procModules(); Sigar.procPort(); Sigar.threadCpu(); // Disk Sigar.fileSystemList(); Sigar.fileSystemUsage(); Sigar.fileSystemPing(); // Network Sigar.netInfo(); Sigar.netRouteList(); Sigar.netInterfaceList(); Sigar.netInterfaceConfig(); Sigar.netInterfaceConfigPrimary(); Sigar.netInterfaceStat(); Sigar.netConnectionList(); Sigar.netListenAddress(); Sigar.netStat(); Sigar.netStatPort(); Sigar.tcp(); Sigar.nfsClientV2(); Sigar.nfsServerV2(); Sigar.arpList(); // Misc Sigar.rpcPing();

TODO

  • compile the entire library with gyp
  • fix up the tests (and improve on them)
  • utilize / reimplement / remove sigar_format.c functions
  • convert functions without args to be getters
  • provide async funcs for long-running actions
  • old / broken code still exists for converting network addresses (see node_sigar_utils.cc::node_sigar_str2net_address())

LICENSE

Node Sigar is licensed under the BSD license.

node-sigar's People

Contributors

wdavidw avatar duralog avatar charlesb avatar

Watchers

Eric Litak avatar James Cloos avatar  avatar

Forkers

jamydev

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.