.\" 
.TH mcsysinfoperl 3 "15 March 2002"
.ds ]W www.MagniComp.com
.SH NAME
mcsysinfoperl \- MagniComp(tm) SysInfo(tm) Perl API to obtain detailed system information in a platform neutral manner
.SH SYNOPSIS
use lib ('/opt/sysinfo/lib/mcSysInfo');
.br
use mcSysInfo;
.br
.sp
$mcSysInfo = mcSysInfo->New;
.br
.sp
# Optional: Specify pathname to sysinfo(1)
.br
$mcSysInfo->Program($SysInfoPath);
.br
# Optional: Use $InFile in place of sysinfo(1)
.br
$mcSysInfo->InputFile($InFile);
.br
# Optional: Limit data to class List
.br
$mcSysInfo->Class(@List);
.sp
.br
$mcSysInfo->Retrieve();
.br
.SH DESCRIPTION
The
.B mcSysInfo
.B perl(1)
interface is part of
.B SysInfo(tm)
from
.B MagniComp(tm).
It
provides a
.B perl(1)
object (API) for obtaining detailed data about the local system's
configuration via
a platform neutral interface.
.PP
Please see
.B mcsysinfoc(3)
if a C API is required.
.PP
When 
.B mcSysInfo->Retrieve
is called it runs the
.B sysinfo(1)
Limit the class of information retrieved and returned to 
.I @List.
The contents of
.I @List
should be valid class names as returned by
.B "sysinfo -list class"
The default is to return all class types.
.IP "\fBInputFile(\fIPath\fB)\fR"
Use the file specified by
.I Path
as input instead of running the
.B sysinfo(1)
program.
The file must be the output from
.B "sysinfo -repsep '|' -format report"
The default is to run the
.B sysinfo(1)
program.
.IP "\fBProgram(\fIPath\fB)\fR"
Use
.I Path
as the pathname to the 
.B sysinfo(1)
program.
The default is
.B /opt/sysinfo/bin/sysinfo
.RE
.PP
The following 
.I mcSysInfo
object members contain the system configuration data after
.B mcSysInfo->Retrieve
is called:
.RS
.IP "\fBGeneral\fR"
General system configuration data.  See
.B "OBJECT mcGeneral"
below.
.IP "\fBHardware\fR"
Hardware (device) configuration data.  See
.B "OBJECT mcHardware"
below.
.IP "\fBSoftware\fR"
Installed software data.  See
.B "OBJECT mcSoftware"
below.
.IP "\fBPartition\fR"
Disk partition data.  See
.B "OBJECT mcPartition"
below.
.IP "\fBPrinter\fR"
Printer queue data.  See
.B mcHardware
object contains data on what hardware (devices) is installed on the system.
The following are valid members:
.RS
.IP "\fBEntries\fR"
Returns a hash of 
.B mcDevInfo
objects each of which details an installed device.
The hash key is a unique device name.
The value is an
.B mcDevInfo
object.
See
.B "OBJECT mcDevInfo"
for details.
.RE
.PP
A special device entry with a key of
.B "TOTAL DISK"
contains the total amount of disk space on the system.
.SS "OBJECT mcDevInfo"
The table below specifies the valid members of the
.B mcDevInfo
object and describes their usage.
See
.B mcsysinfo(3)
for more details describing each member.
.br
.sp
.RS
.TS
l l l
l l l.
\fBMember	Description	Returns\fR
Aliases	Aliases	Array
AltName	AKA Name	Scalar
Bus	Bus no. of device	Scalar
Capacity	Capacity (size) of device	Scalar
ClassType	Class Type	Scalar
DescList	List of misc descriptions	Array
DevNum	Device no. on Bus	Scalar
DevSpec	Device type specific data	varies
Driver	Driver name	Scalar
Files	Files	Array
Ident	Identifier	Scalar
Model	Model	Scalar
ModelDesc	Model Description	Scalar
Name	Name of device	Scalar
Next	Next peer device	Scalar
NodeID	Node ID	Scalar
Part	Part #	Scalar
Port	Port no. on Bus	Scalar
.B mcCpuInfo
object is usually available via
.B mcDevInfo->DevSpec
when 
.B mcDevInfo->Type
is 
.B CPU.
See
.B mcsysinfo(3)
for more details describing each member.
.br
.sp
.RS
.TS
l l l
l l l.
\fBMember	Description	Returns\fR
Arch	Architecture	Scalar
ArchVer	Architecture Version	Scalar
BitSize	Bit Size	Scalar
Caches	List of onboard caches	Array
HasFPU	Has FPU	Scalar
Man	Manufacturer	Scalar
Model	Model	Scalar
Serial	Serial #	Scalar
Speed	Clock Speed	Scalar
Stepping	Stepping	Scalar
.TE
.RE

.SS "OBJECT mcCacheInfo"
The table below specifies the valid members of the
.B mcCacheInfo
object and describes their usage.
A
.B mcCacheInfo
object is usually available via the
.B mcDevInfo->DevSpec->Caches
array when 
.B mcDevInfo->Type
is 
.B processor.
See
.B mcsysinfo(3)
for more details describing each member.
.br
.sp
.RS
.TS
l l l
l l l.
\fBMember	Description	Returns\fR
EccType	ECC Type	Scalar
Mode	Mode of operation	Scalar
.TE
.RE

.SS "OBJECT mcGeneral"
The
.B mcGeneral
object contains general system configuration data.
The table below specifies the valid members of the
.B mcGeneral
object and describes their usage.
See
.B mcsysinfo(3)
for more details describing each member.
.br
.sp
.RS
.TS
l l l
l l l.
\fBMember	Description	Returns\fR
Hostname	Host Name	Scalar
HostAliases	Host Aliases	Array
HostAddrs	Host Addresses	Array
HostId	Host ID	Scalar
Serial	Serial #	Scalar
ManShort	Manufacturer (Short)	Scalar
ManLong	Manufacturer (Long)	Scalar
Man	Manufacturer	Scalar
Model	Model	Scalar
PhysMem	Physical Memory	Scalar
VirtMem	Virtual Memory	Scalar
RomVer	ROM Version	Scalar
NumCpu	Number of CPU	Scalar
CpuType	CPU Type	Scalar
CpuSpeed	CPU Speed	Scalar
AppArch	App Architecture	Scalar
KernArch	Kernel Architecture	Scalar
KernBits	Kernel Bit Size	Scalar
OSname	OS Name	Scalar
OSver	OS Version	Scalar
OSdist	OS Distribution	Scalar
KernVer	Kernel Version	Scalar
BootTime	Boot Time	Scalar
CurrentTime	Current Time	Scalar
LibcName	Libc Name	Scalar
LibcVer	Libc Version	Scalar
.TE
.RE

.SS "OBJECT mcKernel"
.B "OBJECT mcName"
for details.
.RE

.SS "OBJECT mcNetIf"
The table below specifies the valid members of the
.B mcNetIf
object and describes their usage.
A
.B mcNetIf
object is usually available via
.B mcDevInfo->DevSpec
when 
.B mcDevInfo->Type
is 
.B netif.
See
.B mcsysinfo(3)
for more details describing each member.
.br
.sp
.RS
.TS
l l l
l l l.
\fBMember	Description	Returns\fR
Type	NIC Address Type	Scalar
HostAddr	NIC Host Address	Scalar
HostName	NIC Host Name	Scalar
MACaddr	NIC MAC Current Address	Scalar
MACname	NIC MAC Current Name	Scalar
FacMACaddr	NIC MAC Factory Address	Scalar
FacMACname	NIC MAC Factory Name	Scalar
NetAddr	NIC Network Address	Scalar
NetName	NIC Network Name	Scalar
.TE
.RE

.SS "OBJECT mcPartition"
The
.B mcPartition
object contains data on what disk partitions are on the system.
The following are valid members:
.RS
.IP "\fBEntries\fR"
Returns a hash of 
.B mcPartInfo
objects each of which details a partition entry.
The hash key is a unique partition name.
The value is an
.B mcPartInfo
object.
.TS
l l l
l l l.
\fBMember	Description	Returns\fR
Name	Partition Name	Scalar
DevName	Device Name	Scalar
DevPath	Device Path	Scalar
DevPathRaw	Device Path Raw	Scalar
BaseName	Base Name	Scalar
Slice	Slice	Scalar
Num	Partition #	Scalar
Type	Type	Scalar
TypeDesc	Type Description	Scalar
TypeNum	Type Number	Scalar
UsageStatus	Usage Status	Scalar
MntName	Mount Name	Scalar
MntOpts	Mount Options	Array
Size	Size (MB)	Scalar
AmtUsed	Amount Used (MB)	Scalar
SecSize	Sector Size (bytes)	Scalar
StartSect	Starting Sector	Scalar
EndSect	Ending Sector	Scalar
NumSect	Number of Sectors	Scalar
.TE
.RE
.SS "OBJECT mcPrinter"
The
.B mcPrinter
object contains data on what printer queues are on the system.
The following are valid members:
.RS
.IP "\fBEntries\fR"
Returns a hash of 
.B mcPrinterInfo
objects each of which details a printer queue.
The hash key is a unique printer name.
The value is an
.B mcPrinterInfo
object.
See
.B "OBJECT mcPrinterInfo"
for details.
.RE
.SS "OBJECT mcPrinterInfo"
The table below specifies the valid members of the
.B mcPrinterInfo
object and describes their usage.
See
.B mcsysinfo(3)
for more details describing each member.
.br
.sp
Langs	Supported printer languages	Array
SpoolDir	Spool Directory	Scalar
MaxJobSize	Max size of each job	Scalar
DescList	Misc descriptions	Array
.TE
.RE

.SS "OBJECT mcSoftware"
The
.B mcSoftware
object contains data on what software is installed on the system.
The following are valid members:
.RS
.IP "\fBEntries\fR"
Returns a hash of 
.B mcSoftInfo
objects each of which details an installed software package.
The hash key is a unique package name.
The value is an
.B mcSoftInfo
object.
See
.B "OBJECT mcSoftInfo"
for details.
.RE
.SS "OBJECT mcSoftInfo"
The table below specifies the valid members of the
.B mcSoftInfo
object and describes their usage.
See
.B mcsysinfo(3)
for more details describing each member.
.br
.sp
.RS
.TS
l l l
l l l.
\fBMember	Description	Returns\fR
Name	Name of package	Scalar
EntryType	Entry Type	Scalar
Version	Version	Scalar
Revision	Revision	Scalar
Description	Description	Scalar
DescVerbose	Description (Verbose)	Scalar
URL	URL	Scalar
License	License	Scalar
Copyright	Copyright	Scalar
Category	Category	Scalar
SubCategory	Sub-Category	Scalar
OSname	Requires OS Name	Scalar
OSversion	Requires OS Version	Scalar
MasterVer	Version of master	Scalar
MasterRev	Revisionof master	Scalar
Slaves	List of child packages	Array
Next	Next peer package	Scalar
.TE
.RE

.SS "OBJECT mcSysConf"
The
.B mcSysConf
object contains data on system configuration data obtained via
.B sysconf(3).
The following are valid members:
.RS
.IP "\fBEntries\fR"
Returns a hash of 
.B mcName
objects each of which details a SysConf entry.
The hash key is a unique SysConf variable name.
The value is an
.B mcName
object.
See
.B "OBJECT mcName"
for details.
.RE
.SS "OBJECT mcName"
The table below specifies the valid members of the
.B mcName
object and describes their usage.
See
.B mcsysinfo(3)
for more details describing each member.
.br
.sp
.RS
.TS
l l l
l l l.
\fBMember	Description	Returns\fR
Name	Variable name	Scalar
Desc	Description of entry	Scalar
Value	Value of this variable	Scalar
.TE
.RE
.SH "EXAMPLES"
.PP
For detailed examples please take a look at
.B /opt/sysinfo/lib/ui/uiGUI.pm
This is the main model which implements the GUI
for
.I sysinfo(1)
$si->Retrieve();

printf ("System hostname is %s\\n", $si->General->Hostname);
printf ("System model is %s\\n", $si->General->Model);
.RE
.fi
.PP
The following example displays a list of all device names and
their model (if known):
.RS
.nf
.sp
use lib ('/opt/sysinfo/lib/mcSysInfo');

use mcSysInfo;

$si = mcSysInfo->New;
# Only retrieve the info we need
$si->Class('Hardware');
$si->Retrieve();

foreach my $Key (keys %{ $si->Hardware->Entries }) {
	my $di = $si->Hardware->Entries->{$Key};
	printf ("Device %s is a %s\\n", $Key, $di->Model);
}

.fi
.RE
.SH FILES
/opt/sysinfo/bin/sysinfo 	\- Path to sysinfo program
.SH "SEE ALSO"
sysinfo(1)
perl(1)
mcsysinfoc(3)
.SH URL
http://www.MagniComp.com/sysinfo