Fix & Improve RAID Monitoring for tw_cli (3Ware)
I made some modification that fix and improve the monitoring for 3Ware (tw_cli).
-
I've fixed that the monitoring always only looks for Controler-ID "c0". In my case it was "c1" so the monitoring failed completly!
-
Instead of nl2br as wrapper for the HTML-Output (BE-Module "RAID State", I've patched it to wrap the CLI-Output in "
"-Tags which preserve Tab/Linespacing.
Patches attached:
ispconfig/server/lib/classes/monitor_tools.inc.php ----[ START ]----
/*
* 3ware Controller
*/
system('which tw_cli', $retval);
if($retval === 0) {
// TYPOWORX FIX | Determine Controler-ID
$availableControlers = shell_exec('tw_cli info | grep -Eo "c[0-9]+');
$data['output'] = shell_exec('tw_cli info ' . $availableControlers);
-----[ END ]-----
ispconfig/interface/lib/classes/tools_monitor.inc.php ----[ START ]----
if ($record['state'] == 'no_state') {
$html .= '<p>'.$app->lng("monitor_nosupportedraid1_txt").'</p>';
}
else {
$data = unserialize($record['data']);
// improve view @Author <info@typoworx.de>
//-- html .= nl2br(
data['output']);
$html .= '
-----[ END ]-----
Now my controler is correctly found and the Output in Web-Interface looks proper!
May be the code for Controler-Detection should become more flexible as it may also possible that there are more Controler-ID's than only one in some more complex RAID-Systems (f.e. RAID 10 over multiple Controler-Cards).