1.1.2 • Published 10 years ago

hwmon v1.1.2

Weekly downloads
1
License
MIT
Repository
github
Last release
10 years ago

hwmon

hwmon is a resource monitor written for node.js systems running on Linux.

hwmon emits an event for cpu, memory, and disk usage on a user-defined interval.

The current version is simply a wrapper around the 'df' and 'iostat' commands, and the contents of /proc/meminfo on Linux.

Usage:

var Hwmon = require('./index');
var hwmon = new Hwmon({interval: 2000});

hwmon.on('iostat', function(data){
  console.log('iostat:',data);
});

hwmon.on('meminfo', function(data){
  console.log('meminfo:',data);
});

hwmon.on('df', function(data){
  console.log('df:',data);
});

hwmon.start();

Output:

free: { mem:
   { total: 4048032,
     used: 233772,
     free: 3814260,
     shared: 420,
     buffers: 20768,
     cached: 109580 },
  swap: { total: 4191228, used: 0, free: 4191228 } }

iostat: { 'avg-cpu:':
   { '%user': 0.13,
     '%nice': 0,
     '%system': 0.25,
     '%iowait': 0,
     '%steal': 0,
     '%idle': 99.62 },
  devices: { sda: { tps: 0, 'kB_read/s': 0, 'kB_wrtn/s': 0, kB_read: 0, kB_wrtn: 0 } } }

  df: { '/dev/sda1':
   { '1M-blocks': '26079',
     Used: '1244',
     Available: '23488',
     'Use%': '6%',
     Mounted: '/' } }
1.1.2

10 years ago

1.1.0

10 years ago

1.0.1

10 years ago

1.0.0

10 years ago

0.0.5

10 years ago

0.0.4

10 years ago

0.0.3

10 years ago

0.0.2

10 years ago

0.0.1

10 years ago