The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

DBD::Sys::Plugin::Unix::Lsof - provides a table containing open files

SYNOPSIS

  $openfiles = $dbh->selectall_hashref("select * from openfiles", ["pid","filename"]);

ISA

  DBD::Sys::Plugin::Unix::Lsof;
  ISA DBD::Sys::Table

DESCRIPTION

This module provides the table openfiles filled with the list of open files.

COLUMNS

pid

Process ID of the process opened the file

ppid

Parent process ID of the process opened the file

pgrp

Process Group ID of the process opened the file

uid

User ID

username

Name of the user who owns the process which has opened the file

command

executed command (process executable)

filename

Full qualified path name of the open file

filetype

File type (VDIR, VREG, ...) of the open file

inode

Inode number of the open file

linkcount

Link count of the open file

mountpoint

Mount point of the file system where the file resides

METHODS

get_table_name

Returns 'grent'.

get_col_names

Returns the column names of the table as named in "Columns"

get_attributes

Return the attributes supported by this module:

uids

Allows restricting the user ids (see lsof(8) for the -u parameter).

    $dbh->{sys_openfiles_uids} = [scalar getpwuid $<];
    $dbh->{sys_openfiles_uids} = [$<]; # all opened by myself

pids

Allows restricting the process ids (see lsof(8) for the -p parameter).

    $dbh->{sys_openfiles_pids} = ['^' . $$]; # everything except the current process

filesys

Allows restricting the scanned file systems (see lsof(8) for the +f parameter).

    $dbh->{sys_openfiles_filesys} = [qw(/usr /var)];

collect_data

Retrieves the data from the lsof command and put it into fetchable rows.

PREREQUISITES

The module Unix::Lsof is required to provide data for the table. The column mountpoint can be filled only if the module Sys::Filesystem::MountPoint is installed.

AUTHOR

    Jens Rehsack
    CPAN ID: REHSACK
    rehsack@cpan.org
    http://www.rehsack.de/

COPYRIGHT

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

The full text of the license can be found in the LICENSE file included with this module.

SUPPORT

Free support can be requested via regular CPAN bug-tracking system. There is no guaranteed reaction time or solution time, but it's always tried to give accept or reject a reported ticket within a week. It depends on business load. That doesn't mean that ticket via rt aren't handles as soon as possible, that means that soon depends on how much I have to do.

Business and commercial support should be acquired from the authors via preferred freelancer agencies.