NAME
Device::RAID::Poller - Basic RAID status poller, returning RAID disk devices, types, and status.
VERSION
Version 0.2.0
SYNOPSIS
Quick summary of what the module does.
Perhaps a little code snippet.
use Device::RAID::Poller;
my $drp = Device::RAID::Poller->new();
...
METHODS
new
This initiates the object.
modules_get
Gets the currently specified modules to run.
A return of undef means none are set and at run-time each module will be loaded and tried.
my @modules=$drp->modules_get;
modules_set
This sets modules to use if one does not wish to attempt to load them all upon load.
list_backends
This lists the available backends. This lists the full backends name, meaning it will return 'Device::RAID::Poller::Backends::fbsdGmiiror';
my $backends=$drp->list_backends;
The returned value is a hashref where each key is a name of a backend module.
If you want this as a array, you can do the following.
my @backends=keys %{ $drp->list_backends };
list_loaded
This returns the list of backends that loaded successfully.
load
This loads up the modules. Each one in the list is checked and then if started successfully, it is saved for reuse later.
my $loaded=$drp->load;
if ( $loaded ){
print "One or more backends are now loaded.\n";
}else{
print "No usable backends found.\n";
}
run
Runs the poller backend and report the results.
If nothing is nothing is loaded, load will be called.
m6 %status=$drp->run;
STATUS HASH
The statu hash made of of hashes. Each subhash is the of the type documented under the section RAID HASH.
The keys of this hash are the device name as regarded by the module in question. These may not represent a valid name under /dev, but may just be a name generated to differentiate it from other devices. Both the ZFS and MegaCLI backends are examples of this. In ZFS cases the zpool is just a mountpoint some place. As to MegaCLI it is a name generated from info gathered from the card.
RAID HASH
status
This can be any of the following values.
bad - missing disks
good - all disks are present
initializing - Array is being created.
rebuilding - one or more drives is being rebuilt
unknown - Unable to determine the current status.
name
The name of the device.
backend
The backend that put polled this device. This is the name of the module under "Device::RAID::Poller::Backends::". So "Device::RAID::Poller::Backends::ZFS" would be "ZFS".
good
This is a list of good disks in the array..
bad
This is a list of bad disks in the array.
spare
This is a list of spare disks in the array.
type
This is type of RAID in question. This is a string that describes the RAID array.
This may also be complex, such as for ZFS it is the output of 'zpool status' for the pool in question.
BBUstatus
This can be any of the following values.
notPresent - No BBU.
na - Not applicable. Device does not support it.
failed - BBU failed.
good - BBU is good.
charging - BBU is charging.
unknown - BBU status is not known.
testing - BBU is currently in testing mode
BACKENDS
A backend is a module that exists directly under "Device::RAID::Poller::Backends::".
Three methods must be present and as of currently are expected to run with no arguments.
new
usable
run
The new method creates the object.
The usable method runs some basic checks to see if it is usable or not.
The run method returns a hash with the assorted info. See the section BACKEND RETURN HASH for more information.
BACKEND RETURN HASH
This is composed of keys below.
devices - A array of hashes as documented in the section RAID HASH.
stutus - A 0/1 representing if it the the run method was successful.
ERROR HANDLING/CODES
1/invalidModule
A non-existent module to use was specified.
2/notLoaded
Either load has not been called or no usable modules were found.
AUTHOR
Zane C. Bowers-Hadley, <vvelox at vvelox.net>
BUGS
Please report any bugs or feature requests to bug-device-raid-poller at rt.cpan.org
, or through the web interface at https://rt.cpan.org/NoAuth/ReportBug.html?Queue=Device-RAID-Poller. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
SUPPORT
You can find documentation for this module with the perldoc command.
perldoc Device::RAID::Poller
You can also look for information at:
RT: CPAN's request tracker (report bugs here)
https://rt.cpan.org/NoAuth/Bugs.html?Dist=Device-RAID-Poller
AnnoCPAN: Annotated CPAN documentation
CPAN Ratings
Search CPAN
Repository
ACKNOWLEDGEMENTS
LICENSE AND COPYRIGHT
This software is Copyright (c) 2019 by Zane C. Bowers-Hadley.
This is free software, licensed under:
The Artistic License 2.0 (GPL Compatible)