0.1.1 • Published 10 years ago

node-ssh-df v0.1.1

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

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.