NAME

Linux::Info::SockStats - Collect linux socket statistics.

VERSION

version 2.16

SYNOPSIS

use Linux::Info::SockStats;

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

DESCRIPTION

Linux::Info::SockStats gathers socket statistics from the virtual /proc filesystem (procfs).

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

SOCKET STATISTICS

Generated by /proc/net/sockstat.

used    -  Total number of used sockets.
tcp     -  Number of tcp sockets in use.
udp     -  Number of udp sockets in use.
raw     -  Number of raw sockets in use.
ipfrag  -  Number of ip fragments in use (only available by kernels > 2.2).

METHODS

new()

Call new() to create a new object.

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

It's possible to set the path to the proc filesystem.

 Linux::Info::SockStats->new(
    files => {
        # This is the default
        path => '/proc',
        sockstat => 'net/sockstat',
    }
);

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 <glasswalk3r@yahoo.com.br>

COPYRIGHT AND LICENSE

This software is Copyright (c) 2015 by Alceu Rodrigues de Freitas Junior.

This is free software, licensed under:

The GNU General Public License, Version 3, June 2007