Device::RAID::Poller - Basic RAID status poller, returning RAID disk devices, types, and status.
Version 0.1.1
Quick summary of what the module does.
Perhaps a little code snippet.
use Device::RAID::Poller; my $drp = Device::RAID::Poller->new(); ...
This initiates the object.
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;
This sets modules to use if one does not wish to attempt to load them all upon load.
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 };
This returns the list of backends that loaded successfully.
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"; }
Runs the poller backend and report the results.
If nothing is nothing is loaded, load will be called.
m6 %status=$drp->run;
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.
This can be any of the following values.
bad - missing disks good - all disks are present rebuilding - one or more drives is being rebuilt unknown - Unable to determine the current status.
The name of the device.
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".
This is a list of good disks in the array..
This is a list of bad disks in the array.
This is a list of spare disks in the array.
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.
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.
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.
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.
A non-existent module to use was specified.
Either load has not been called or no usable modules were found.
Zane C. Bowers-Hadley, <vvelox at vvelox.net>
<vvelox at vvelox.net>
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.
bug-device-raid-poller at rt.cpan.org
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
http://annocpan.org/dist/Device-RAID-Poller
CPAN Ratings
https://cpanratings.perl.org/d/Device-RAID-Poller
Search CPAN
https://metacpan.org/release/Device-RAID-Poller
This software is Copyright (c) 2019 by Zane C. Bowers-Hadley.
This is free software, licensed under:
The Artistic License 2.0 (GPL Compatible)
To install Device::RAID::Poller, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Device::RAID::Poller
CPAN shell
perl -MCPAN -e shell install Device::RAID::Poller
For more information on module installation, please visit the detailed CPAN module installation guide.