NAME

Linux::Info::DiskUsage - Collect linux disk usage.

SYNOPSIS

use Linux::Info::DiskUsage;

my $lxs  = new Linux::Info::DiskUsage;
my $stat = $lxs->get;

DESCRIPTION

Linux::Info::DiskUsage gathers the disk usage with the command df.

For more information read the documentation of the front-end module Linux::Info.

DISK USAGE INFORMATIONS

Generated by /bin/df -kP.

total       -  The total size of the disk.
usage       -  The used disk space in kilobytes.
free        -  The free disk space in kilobytes.
usageper    -  The used disk space in percent.
mountpoint  -  The moint point of the disk.

GLOBAL VARS

If you want to change the path or arguments for df you can use the following variables...

$Linux::Info::DiskUsage::DF_PATH = '/bin';
$Linux::Info::DiskUsage::DF_CMD  = 'df -akP';

Example:

use Linux::Info;
use Linux::Info::DiskUsage;
$Linux::Info::DiskUsage::DF_CMD = 'df -akP';

my $sys  = Linux::Info->new(diskusage => 1);
my $disk = $sys->get;

METHODS

new()

Call new() to create a new object.

my $lxs = Linux::Info::DiskUsage->new;

It's possible to set the path to df.

 Linux::Info::DiskUsage->new(
    cmd => {
        # This is the default
        path => '/bin',
        df   => 'df -kP 2>/dev/null',
    }
);

get()

Call get() to get the statistics. get() returns the statistics as a hash reference.

my $stat = $lxs->get;

EXPORTS

Nothing.

SEE ALSO

AUTHOR

Alceu Rodrigues de Freitas Junior, <arfreitas@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2015 of Alceu Rodrigues de Freitas Junior, <arfreitas@cpan.org>

This file is part of Linux Info project.

Linux Info is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

Linux Info is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with Linux Info. If not, see <http://www.gnu.org/licenses/>.