NAME
Slaughter::Info::linux - Determine information about a Linux host.
SYNOPSIS
This module is the GNU/Linux version of the Slaughter information-gathering module.
Modules beneath the Slaughter::Info
namespace are loaded when slaughter is executed, they are used to populate a hash with information about the current host.
This module is loaded only on linux systems, and will determine such details as the local hostname, the free RAM, any IP addresses, etc.
The correct information-gathering module is loaded at run-time via the use of the $^O
variable, and if no system-specific module is available then the generic Slaughter::Info::generic module is used as a fall-back.
The information discovered can be dumped by running slaughter
~# slaughter --dump
Usage of this module is as follows:
use Slaughter::Info::linux;
my $obj = Slaughter::Info::linux->new();
my $data = $obj->getInformation();
# use info now ..
print "We have software RAID\n" if ( $data->{'softwareraid'} );
When this module is used an attempt is also made to load the module Slaughter::Info::Local::linux
- if that succeeds it will be used to augment the information discovered and made available to slaughter policies.
METHODS
Now follows documentation on the available methods.
new
Create a new instance of this object.
getInformation
This function retrieves meta-information about the current host.
The return value is a hash-reference of data determined dynamically.
AUTHOR
Steve Kemp <steve@steve.org.uk>
LICENSE
Copyright (c) 2010-2015 by Steve Kemp. All rights reserved.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. The LICENSE file contains the full text of the license.