node-ssh-df

0.1.1 • Public • Published

node-ssh-df

A Node.js module to check disk space on remote machines using ssh and df Unix program.

Installation

npm install node-ssh-df

Usage

Basic

var
    df = require('node-ssh-df'),
 
    config = {
        host: 'localhost',
        username: 'foo',
        password: 'bar'
    };
 
df(config, function (error, response) {
    if (error) { throw error; }
 
    console.log(JSON.stringify(response, null, 2));
});

See ssh2 page on GitHub for more info about config hash.

See node-df page on GitHub for more info about df output.

Advanced

var
    df = require('node-ssh-df'),
 
    config = {
        host: 'localhost',
        username: 'foo',
        password: 'bar'
    },
    options = {
        file: '/',
        prefixMultiplier: 'GB',
        isDisplayPrefixMultiplier: true,
        precision: 2
    };
 
df(config, options, function (error, response) {
    if (error) { throw error; }
 
    console.log(JSON.stringify(response, null, 2));
});

See node-df page on GitHub for more info about options hash.

Readme

Keywords

Package Sidebar

Install

npm i node-ssh-df

Weekly Downloads

0

Version

0.1.1

License

MIT

Last publish

Collaborators

  • adigiovanni