@@ -229,6 +229,51 @@ public function onRunJob() {
229229 }
230230 }
231231
232+ /*
233+ * HP Proliant
234+ */
235+ system ('which hpacucli ' , $ retval );
236+ if ($ retval === 0 ) {
237+ $ state = 'ok ' ;
238+ $ data ['output ' ] = shell_exec ('/usr/sbin/hpacucli ctrl all show config ' );
239+ $ tmp = explode ("\n" , $ data ['output ' ]);
240+ if (is_array ($ tmp )) {
241+ foreach ($ tmp as $ item ) {
242+ if (strpos ($ item , 'logicaldrive ' ) !== false ) {
243+ if (strpos ($ item , 'OK ' ) !== false ) {
244+ $ this ->_tools ->_setState ($ state = 'ok ' );
245+ } elseif (strpos ($ item , 'Recovery Mode ' ) !== false ) {
246+ $ this ->_tools ->_setState ($ state = 'critical ' );
247+ break ;
248+ } elseif (strpos ($ item , 'Failed ' ) !== false ) {
249+ $ this ->_tools ->_setState ($ state = 'error ' );
250+ break ;
251+ } elseif (strpos ($ item , 'Recovering ' ) !== false ) {
252+ $ this ->_tools ->_setState ($ state = 'info ' );
253+ break ;
254+ } else {
255+ $ this ->_tools ->_setState ($ state = 'critical ' );
256+ }
257+ }
258+ if (strpos ($ item , 'physicaldrive ' ) !== false ) {
259+ if (strpos ($ item , 'physicaldrive ' ) !== false ) {
260+ if (strpos ($ item , 'OK ' ) !== false ) {
261+ $ this ->_tools ->_setState ($ state = 'ok ' );
262+ } elseif (strpos ($ item , 'Failed ' ) !== false ) {
263+ $ this ->_tools ->_setState ($ state = 'critical ' );
264+ break ;
265+ } elseif (strpos ($ item , 'Rebuilding ' ) !== false ) {
266+ $ this ->_tools ->_setState ($ state = 'info ' );
267+ break ;
268+ } else {
269+ $ this ->_tools ->_setState ($ state = 'critical ' );
270+ break ;
271+ }
272+ }
273+ }
274+ }
275+ }
276+ }
232277
233278 $ res = array ();
234279 $ res ['server_id ' ] = $ server_id ;
0 commit comments