AIX-SysInfo

 view release on metacpan or  search on metacpan

SysInfo.pm  view on Meta::CPAN

        return 1;
}
sub get_total_swap {
        my $hash = shift @_;
        my $swap = prtconf_param( 'Total Paging Space:' );
        $swap =~ /(\d+)\D+/; $hash->{total_swap} = $1;
        return 1;
}
sub get_hardware_info {
        my $hash = shift @_;
        chomp ( my $model_data = `$UNAME -M` );
        $model_data =~ /(.*),(.*)/;
        ( $hash->{sys_arch}, $hash->{model_type} ) = ( $1, $2 );
        return 1;
}
sub get_proc_data {
	my $hash = shift @_;
        $hash->{num_procs} = prtconf_param( '^Number Of Processors:' );
        my $speed = prtconf_param( '^Processor Clock Speed:' );
        $speed =~ /(\d+)\D+/; $hash->{proc_speed} = $1;
	$hash->{proc_type} = prtconf_param( '^Processor Type:' );
	return 1;
}
sub get_lpar_info {
        my $hash = shift @_;
        my $lpar = prtconf_param( '^LPAR Info:' );

SysInfo.pm  view on Meta::CPAN

        my $s_ref = \%sysinfo;
        return () unless( $^O eq 'aix');
	return () unless ( open PCONF, "$PRTCONF |" );

	chomp (@pconf_array = <PCONF>);

        &get_hostname     ( $s_ref );
        &get_aix_version  ( $s_ref );
        &get_hardware_info( $s_ref );
        &get_serial_num   ( $s_ref );
        &get_proc_data    ( $s_ref );
	&get_firmware_ver ( $s_ref );
        &get_total_ram    ( $s_ref );
        &get_total_swap   ( $s_ref );
        &get_lpar_info    ( $s_ref );
	&get_kernel_type  ( $s_ref );
        return %sysinfo;
}
1;
#------------------------------------------------------
# Module code ends

SysInfo.pm  view on Meta::CPAN

The value of this key is LPAR name. If LPAR does not exist it is 'NULL'

=item B<lpar_id>

The value of this key is LPAR number. If LPAR does not exist it is '-1'

=back

=head1 NOTE

Most of the data is obtained by parsing output of these three AIX commands:  B</usr/bin/uname>, B</usr/bin/oslevel>, B</usr/sbin/prtconf>

=head1 VERSION

   1.1.1 (released on Wed Jun 17 15:07:35 CDT 2009)
   1.1   (released on Tue Jun 16 16:39:00 CDT 2009)
   1.0   (released 2000-07-03)

=head1 BUGS

With version 1.1 this module was rewritten from scratch. It has been tested on p570/p595 LPAR hardware and on several older stand-alone servers. This version works slower that version 1.0 because it relies on prtconf command which takes several secon...



( run in 0.354 second using v1.01-cache-2.11-cpan-8d75d55dd25 )