mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
committed by
Tony Murray
parent
ef90da2a31
commit
96f7f142ba
@@ -1443,6 +1443,33 @@ function get_postgres_databases($device_id)
|
||||
return array();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all mdadm arrays from the collected
|
||||
* rrd files.
|
||||
*
|
||||
* @param array $device device for which we get the rrd's
|
||||
* @param int $app_id application id on the device
|
||||
* @return array list of disks
|
||||
*/
|
||||
function get_arrays_with_mdadm($device, $app_id)
|
||||
{
|
||||
$arrays = array();
|
||||
|
||||
$pattern = sprintf('%s/%s-%s-%s-*.rrd', get_rrd_dir($device['hostname']), 'app', 'mdadm', $app_id);
|
||||
|
||||
foreach (glob($pattern) as $rrd) {
|
||||
$filename = basename($rrd, '.rrd');
|
||||
|
||||
list(,,, $array_name) = explode("-", $filename, 4);
|
||||
|
||||
if ($array_name) {
|
||||
array_push($arrays, $array_name);
|
||||
}
|
||||
}
|
||||
|
||||
return $arrays;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all disks (disk serial numbers) from the collected
|
||||
* rrd files.
|
||||
|
Reference in New Issue
Block a user