DBD::Sys::Plugin::Unix::Lsof - provides a table containing open files
$openfiles = $dbh->selectall_hashref("select * from openfiles", ["pid","filename"]);
DBD::Sys::Plugin::Unix::Lsof; ISA DBD::Sys::Table
This module provides the table openfiles filled with the list of open files.
Process ID of the process opened the file
Parent process ID of the process opened the file
Process Group ID of the process opened the file
User ID
Name of the user who owns the process which has opened the file
executed command (process executable)
Full qualified path name of the open file
File type (VDIR, VREG, ...) of the open file
Inode number of the open file
Link count of the open file
Mount point of the file system where the file resides
Returns 'grent'.
Returns the column names of the table as named in "Columns"
Return the attributes supported by this module:
Allows restricting the user ids (see lsof(8) for the -u parameter).
-u
$dbh->{sys_openfiles_uids} = [scalar getpwuid $<]; $dbh->{sys_openfiles_uids} = [$<]; # all opened by myself
Allows restricting the process ids (see lsof(8) for the -p parameter).
-p
$dbh->{sys_openfiles_pids} = ['^' . $$]; # everything except the current process
Allows restricting the scanned file systems (see lsof(8) for the +f parameter).
+f
$dbh->{sys_openfiles_filesys} = [qw(/usr /var)];
Retrieves the data from the lsof command and put it into fetchable rows.
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.
Jens Rehsack CPAN ID: REHSACK rehsack@cpan.org http://www.rehsack.de/
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.
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.
To install DBD::Sys, copy and paste the appropriate command in to your terminal.
cpanm
cpanm DBD::Sys
CPAN shell
perl -MCPAN -e shell install DBD::Sys
For more information on module installation, please visit the detailed CPAN module installation guide.