@@ -275,6 +275,52 @@ public function onRunJob() {
275275 }
276276 }
277277
278+ /*
279+ * HP Proliant new driver -> http://downloads.linux.hpe.com/SDR/project/mcp/
280+ */
281+ system ('which ssacli ' , $ retval );
282+ if ($ retval === 0 ) {
283+ $ state = 'ok ' ;
284+ $ data ['output ' ] = shell_exec ('/usr/sbin/ssacli ctrl all show config ' );
285+ $ tmp = explode ("\n" , $ data ['output ' ]);
286+ if (is_array ($ tmp )) {
287+ foreach ($ tmp as $ item ) {
288+ if (strpos ($ item , 'logicaldrive ' ) !== false ) {
289+ if (strpos ($ item , 'OK ' ) !== false ) {
290+ $ this ->_tools ->_setState ($ state = 'ok ' );
291+ } elseif (strpos ($ item , 'Recovery Mode ' ) !== false ) {
292+ $ this ->_tools ->_setState ($ state = 'critical ' );
293+ break ;
294+ } elseif (strpos ($ item , 'Failed ' ) !== false ) {
295+ $ this ->_tools ->_setState ($ state = 'error ' );
296+ break ;
297+ } elseif (strpos ($ item , 'Recovering ' ) !== false ) {
298+ $ this ->_tools ->_setState ($ state = 'info ' );
299+ break ;
300+ } else {
301+ $ this ->_tools ->_setState ($ state = 'critical ' );
302+ }
303+ }
304+ if (strpos ($ item , 'physicaldrive ' ) !== false ) {
305+ if (strpos ($ item , 'physicaldrive ' ) !== false ) {
306+ if (strpos ($ item , 'OK ' ) !== false ) {
307+ $ this ->_tools ->_setState ($ state = 'ok ' );
308+ } elseif (strpos ($ item , 'Failed ' ) !== false ) {
309+ $ this ->_tools ->_setState ($ state = 'critical ' );
310+ break ;
311+ } elseif (strpos ($ item , 'Rebuilding ' ) !== false ) {
312+ $ this ->_tools ->_setState ($ state = 'info ' );
313+ break ;
314+ } else {
315+ $ this ->_tools ->_setState ($ state = 'critical ' );
316+ break ;
317+ }
318+ }
319+ }
320+ }
321+ }
322+ }
323+
278324 /*
279325 * LSI MegaRaid
280326 */
0 commit comments