Content-type: text/html Manpage of mcsysinfoperl

mcsysinfoperl

Section: C Library Functions (3)
Updated: 26 June 2001
Index Return to Main Contents
 

NAME

mcsysinfoperl - MagniComp(tm) SysInfo(tm) Perl API to obtain detailed system information in a platform neutral manner  

SYNOPSIS

use lib ('/usr/local/sysinfo/lib/mcSysInfo');
use mcSysInfo;

$mcSysInfo = mcSysInfo->New;

# Optional: Specify pathname to sysinfo(1)
$mcSysInfo->Program($SysInfoPath);
# Optional: Use $InFile in place of sysinfo(1)
$mcSysInfo->InputFile($InFile);
# Optional: Limit data to class List
$mcSysInfo->Class(@List);


$mcSysInfo->Retrieve();
 

DESCRIPTION

The mcSysInfo perl(1) interface is part of SysInfo(tm) from MagniComp(tm). It provides a perl(1) object (API) for obtaining detailed data about the local system's configuration via a platform neutral interface.

Please see mcsysinfoc(3) if a C API is required.

When mcSysInfo->Retrieve is called it runs the sysinfo(1) command by default to obtain the system configuration data. The data is parsed into perl(1) objects and made available as members of mcSysInfo (see below for details).  

OBJECT DEFINETIONS

 

OBJECT mcSysInfo

The following is a list of object members available for the mcSysInfo object:

Class(@List)
Limit the class of information retrieved and returned to @List. The contents of @List should be valid class names as returned by sysinfo -list class The default is to return all class types.
InputFile(Path)
Use the file specified by Path as input instead of running the sysinfo(1) program. The file must be the output from sysinfo -repsep '|' -format report The default is to run the sysinfo(1) program.
Program(Path)
Use Path as the pathname to the sysinfo(1) program. The default is /usr/local/sysinfo/bin/sysinfo

The following mcSysInfo object members contain the system configuration data after mcSysInfo->Retrieve is called:

General
General system configuration data. See OBJECT mcGeneral below.
Hardware
Hardware (device) configuration data. See OBJECT mcHardware below.
Software
Installed software data. See OBJECT mcSoftware below.
Partition
Disk partition data. See OBJECT mcPartition below.
SysConf
System configuration data. See OBJECT mcSysConf below.
Kernel
Kernel configuration data. See OBJECT mcKernel below.
 

OBJECT mcGeneral

The mcGeneral object contains general system configuration data. The table below specifies the valid members of the mcGeneral object and describes their usage. See mcsysinfo(3) for more details describing each member.

MemberDescriptionReturns
HostnameHost NameScalar
HostAliasesHost AliasesArray
HostAddrsHost AddressesArray
HostIdHost IDScalar
SerialSerial #Scalar
ManShortManufacturer (Short)Scalar
ManLongManufacturer (Long)Scalar
ManManufacturerScalar
ModelModelScalar
PhysMemPhysical MemoryScalar
VirtMemVirtual MemoryScalar
RomVerROM VersionScalar
NumCpuNumber of CPUScalar
CpuTypeCPU TypeScalar
CpuSpeedCPU SpeedScalar
AppArchApp ArchitectureScalar
KernArchKernel ArchitectureScalar
OSnameOS NameScalar
OSverOS VersionScalar
OSdistOS DistributionScalar
KernVerKernel VersionScalar
BootTimeBoot TimeScalar
CurrentTimeCurrent TimeScalar
LibcNameLibc NameScalar
LibcVerLibc VersionScalar
 

OBJECT mcHardware

The mcHardware object contains data on what hardware (devices) is installed on the system. The following are valid members:
Entries
Returns a hash of mcDevInfo objects each of which details an installed device. The hash key is a unique device name. The value is an mcDevInfo object. See OBJECT mcDevInfo for details.

A special device entry with a key of TOTAL DISK contains the total amount of disk space on the system.  

OBJECT mcDevInfo

The table below specifies the valid members of the mcDevInfo object and describes their usage. See mcsysinfo(3) for more details describing each member.

MemberDescriptionReturns
NameName of deviceScalar
DriverDriver nameScalar
AliasesAliasesArray
AltNameAKA NameScalar
FilesFilesArray
TypeTypeScalar
ClassTypeClass TypeScalar
VendorManufacturerScalar
ModelModelScalar
ModelDescModel DescriptionScalar
PartPart #Scalar
SerialSerial #Scalar
IdentIdentifierScalar
RevisionRevisionScalar
UnitUnitScalar
NodeIDNode IDScalar
DescListList of misc descriptionsArray
DevSpecDevice type specific datavaries
SlavesList of child devicesArray
NextNext peer deviceScalar
 

OBJECT mcCpuInfo

The table below specifies the valid members of the mcCpuInfo object and describes their usage. A mcCpuInfo object is usually available via mcDevInfo->DevSpec when mcDevInfo->Type is CPU. See mcsysinfo(3) for more details describing each member.

MemberDescriptionReturns
ManManufacturerScalar
ModelModelScalar
ArchArchitectureScalar
ArchVerArchitecture VersionScalar
SerialSerial #Scalar
BitSizeBit SizeScalar
SpeedClock SpeedScalar
L1iCacheSizeL1 Instruction Cache SizeScalar
L1iAssocL1 Instruction AssociativetyScalar
L1iLinesL1 Instruction LinesScalar
L1iLineSizeL1 Instruction Line SizeScalar
InstTLBInstruction TLBScalar
InstTLBAssocInstruction TLB AssociativetyScalar
L1dCacheSizeL1 Data Cache SizeScalar
L1dAssocL1 Data AssociativetyScalar
L1dLinesL1 Data LinesScalar
L1dLineSizeL1 Data Line SizeScalar
DataTLBData TLBScalar
DataTLBAssocData TLB AssociativetyScalar
L2CacheSizeL2 Cache SizeScalar
L2AssocL2 AssociativetyScalar
L2LinesL2 LinesScalar
L2LineSizeL2 Line SizeScalar
HasFPUHas FPUScalar
SteppingSteppingScalar

 

OBJECT mcNetIf

The table below specifies the valid members of the mcNetIf object and describes their usage. A mcNetIf object is usually available via mcDevInfo->DevSpec when mcDevInfo->Type is netif. See mcsysinfo(3) for more details describing each member.

MemberDescriptionReturns
TypeNIC Address TypeScalar
HostAddrNIC Host AddressScalar
HostNameNIC Host NameScalar
MACaddrNIC MAC Current AddressScalar
MACnameNIC MAC Current NameScalar
FacMACaddrNIC MAC Factory AddressScalar
FacMACnameNIC MAC Factory NameScalar
NetAddrNIC Network AddressScalar
NetNameNIC Network NameScalar

 

OBJECT mcSoftware

The mcSoftware object contains data on what software is installed on the system. The following are valid members:
Entries
Returns a hash of mcSoftInfo objects each of which details an installed software package. The hash key is a unique package name. The value is an mcSoftInfo object. See OBJECT mcSoftInfo for details.
 

OBJECT mcSoftInfo

The table below specifies the valid members of the mcSoftInfo object and describes their usage. See mcsysinfo(3) for more details describing each member.

MemberDescriptionReturns
NameName of packageScalar
EntryTypeEntry TypeScalar
VersionVersionScalar
RevisionRevisionScalar
DescriptionDescriptionScalar
DescVerboseDescription (Verbose)Scalar
URLURLScalar
LicenseLicenseScalar
CopyrightCopyrightScalar
CategoryCategoryScalar
SubCategorySub-CategoryScalar
OSnameRequires OS NameScalar
OSversionRequires OS VersionScalar
ArchRequires ArchitectureScalar
ISArchRequires Inst Set ArchScalar
InstDateInstallation DateScalar
BuildDateBuild DateScalar
ProdStampProduction StampScalar
BaseDirBase DirectoryScalar
DiskUsageDisk UsageScalar
FileListFile ListArray
VendorNameVendor NameScalar
VendorEmailVendor EmailScalar
VendorPhoneVendor Phone #Scalar
VendorStockVendor Stock #Scalar
DescListList of misc description dataArray
MasterName of master packageScalar
MasterVerVersion of masterScalar
MasterRevRevisionof masterScalar
SlavesList of child packagesArray
NextNext peer packageScalar
 

OBJECT mcPartition

The mcPartition object contains data on what disk partitions are on the system. The following are valid members:
Entries
Returns a hash of mcPartInfo objects each of which details a partition entry. The hash key is a unique partition name. The value is an mcPartInfo object. See OBJECT mcPartInfo for details.
 

OBJECT mcPartInfo

The table below specifies the valid members of the mcPartInfo object and describes their usage. See mcsysinfo(3) for more details describing each member.

MemberDescriptionReturns
NamePartition NameScalar
DevNameDevice NameScalar
DevPathDevice PathScalar
DevPathRawDevice Path RawScalar
BaseNameBase NameScalar
SliceSliceScalar
NumPartition #Scalar
TypeTypeScalar
TypeDescType DescriptionScalar
TypeNumType NumberScalar
UsageStatusUsage StatusScalar
MntNameMount NameScalar
MntOptsMount OptionsArray
SizeSize (MB)Scalar
AmtUsedAmount Used (MB)Scalar
SecSizeSector Size (bytes)Scalar
StartSectStarting SectorScalar
EndSectEnding SectorScalar
NumSectNumber of SectorsScalar
 

OBJECT mcKernel

The mcKernel object contains data on kernel variables and configuration. The following are valid members:
Entries
Returns a hash of mcName objects each of which details a kernel entry. The hash key is a unique variable name. The value is an mcName object. See OBJECT mcName for details.
 

OBJECT mcSysConf

The mcSysConf object contains data on system configuration data obtained via sysconf(3). The following are valid members:
Entries
Returns a hash of mcName objects each of which details a SysConf entry. The hash key is a unique SysConf variable name. The value is an mcName object. See OBJECT mcName for details.
 

OBJECT mcName

The table below specifies the valid members of the mcName object and describes their usage. See mcsysinfo(3) for more details describing each member.

MemberDescriptionReturns
NameVariable nameScalar
DescDescription of entryScalar
ValueValue of this variableScalar
 

EXAMPLES

For detailed examples please take a look at /usr/local/sysinfo/lib/ui/uiGUI.pm This is the main model which implements the GUI for sysinfo(1) which utilizes the mcSysInfo interface.

The following example displays the hostname and system model:

use lib ('/usr/local/sysinfo/lib/mcSysInfo'); use mcSysInfo; $si = mcSysInfo->New; # Only retrieve the info we need $si->Class('General'); $si->Retrieve(); printf ("System hostname is %s\n", $si->General->Hostname); printf ("System model is %s\n", $si->General->Model);

The following example displays a list of all device names and their model (if known):


use lib ('/usr/local/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);
}

 

FILES

/usr/local/sysinfo/bin/sysinfo         - Path to sysinfo program
 

SEE ALSO

sysinfo(1) perl(1) mcsysinfoc(3)  

URL

http://www.MagniComp.com/sysinfo


 

Index

NAME
SYNOPSIS
DESCRIPTION
OBJECT DEFINETIONS
OBJECT mcSysInfo
OBJECT mcGeneral
OBJECT mcHardware
OBJECT mcDevInfo
OBJECT mcCpuInfo
OBJECT mcNetIf
OBJECT mcSoftware
OBJECT mcSoftInfo
OBJECT mcPartition
OBJECT mcPartInfo
OBJECT mcKernel
OBJECT mcSysConf
OBJECT mcName
EXAMPLES
FILES
SEE ALSO
URL

This document was created by man2html, using the manual pages.
Time: 20:34:21 GMT, July 09, 2001