The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Parse::DMIDecode - Interface to SMBIOS under Linux using dmidecode

SYNOPSIS

 use strict;
 use Parse::DMIDecode ();
 
 my $decoder = new Parse::DMIDecode;
 $decoder->probe; # Actively probe using dmidecode
  
 # Manually supply your own dmidecode output to be parsed
 # $decoder->parse(qx(sudo /usr/sbin/dmidecode));
  
 printf("System: %s, %s",
         $decoder->keyword("system-manufacturer"),
         $decoder->keyword("system-product-name"),
     );

DESCRIPTION

This module provides an OO interface to SMBIOS information through the dmidecode command which is known to work under a number of Linux, BSD and BeOS variants.

This module is still actively under development, is no not yet feature complete and still needs to be fully documented. There is a possibility accessor method names may change before the final release.

METHODS

new

 my $decoder = Parse::DMIDecode->new(dmidecode => "/usr/sbin/dmidecode");

probe

 $decoder->probe;

parse

 my $raw = qx(sudo /usr/sbin/dmidecode);
 $decoder->prase($raw);

keyword

 my $serial_number = $decoder->keyword("system-serial-number");

keywords

 my @keywords = $decoder->keywords;
 my @bios_keywords = $decoder->keywords("bios");
 
 for my $keyword (@bios_keywords) {
     printf("%s => %s\n",
             $keyword,
             $decoder->keyword($keyword)
         );
 }

handle_addresses

 my @addresses = $decoder->handle_addresses;

get_handles

 use Parse::DMIDecode::Constants qw(@TYPES);
 
 for my $handle ($decoder->get_handles( group => "memory" )) {
     printf(">> Found handle at %s (%s):\n%s\n",
             $handle->address,
             $TYPES[$handle->dmitype],
             $handle->raw
         );
 }

smbios_version

 my $smbios_version = $decoder->smbios_version;

dmidecode_version

 my $dmidecode_version = $decoder->dmidecode_version;

table_location

 my $memory_address = $decoder->table_location;

structures

 my $total_structures = $decoder->structures;

SEE ALSO

examples/*.pl, http://www.nongnu.org/dmidecode/, http://linux.dell.com/libsmbios/, http://sourceforge.net/projects/x86info/, http://www.dmtf.org/standards/smbios, biosdecode(8), dmidecode(8), vpddecode(8)

VERSION

$Id: DMIDecode.pm 789 2006-10-19 08:04:35Z nicolaw $

AUTHOR

Nicola Worthington <nicolaw@cpan.org>

http://perlgirl.org.uk

If you like this software, why not show your appreciation by sending the author something nice from her Amazon wishlist? ( http://www.amazon.co.uk/gp/registry/1VZXC59ESWYK0?sort=priority )

COPYRIGHT

Copyright 2006 Nicola Worthington.

This software is licensed under The Apache Software License, Version 2.0.

http://www.apache.org/licenses/LICENSE-2.0