NAME
Parse::CPinfo - Perl extension to parse output from cpinfo
SYNOPSIS
use
Parse::CPinfo;
my
$p
= Parse::CPinfo->new();
$p
->readfile(
'cpinfofile'
);
# print the section containing the fwm version string
$p
->getSection(
'FireWall-1 Management (fwm) Version Information'
);
# Get a list of interfaces
my
@l
=
$p
->getInterfaceList();
foreach
my
$int
(
@l
) {
"Interface $int\n"
;
"IP Address: "
.
$int
->{
'inetaddr'
} .
"\n"
;
}
DESCRIPTION
This module parses the output from cpinfo. cpinfo is a utility provided by Check Point Software, used for diagnostic purposes.
SUBROUTINES/METHODS
The following are the object methods:
new
Create a new parser object like this: my $p = Parse::CPinfo->new();
readfile
After creating the parser object, ask it to read the cpinfo file for you: $parser->readfile('/full/path/to/cpinfofile');
getSectionList
Use this method to get a list of valid sections. Returns an array.
getSection
Use this method to get a section of the cpinfo file. Returns a scalar.
getHostname
Use this method to get the hostname of the server. Returns a scalar.
getInterfaceList
Use this method to get a list of the active interfaces. Returns an array.
getInterfaceInfo
Use this method to get information about a specific interface. Takes a scalar (interface name) and returns a hash.
SEE ALSO
Check Point Software Technologies, Ltd., at http://www.checkpoint.com/
AUTHOR
Matthew M. Lange, <mmlange@cpan.org>
BUGS AND LIMITATIONS
This library hasn't been extensively tested. I'm sure there are bugs in the code. Please file a bug report at http://rt.cpan.org/ if you find a bug.
LICENSE AND COPYRIGHT
Copyright (C) 2007 by Matthew M. Lange
This library is released under the GNU Public License.