File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed
server/lib/classes/cron.d Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -275,6 +275,27 @@ public function onRunJob() {
275275 }
276276 }
277277
278+ /*
279+ * LSI MegaRaid
280+ */
281+ system ('which megacli ' , $ retval );
282+ system ('which megacli64 ' , $ retval64 );
283+ if ($ retval === 0 || $ retval64 === 0 ) {
284+ $ binary =@($ retval === 0 )?'megacli ' :'megacli64 ' ;
285+ $ state = 'ok ' ;
286+ $ data ['output ' ] = shell_exec ($ binary .' -LDInfo -Lall -aAll ' );
287+ if (strpos ($ data ['output ' ], 'Optimal ' ) !== false ) {
288+ $ this ->_tools ->_setState ($ state , 'ok ' );
289+ } else if (strpos ($ data ['output ' ], 'Degraded ' ) !== false ) {
290+ $ this ->_tools ->_setState ($ state , 'critical ' );
291+ } else if (strpos ($ data ['output ' ], 'Offline ' ) !== false ) {
292+ $ this ->_tools ->_setState ($ state , 'critical ' );
293+ } else {
294+ $ this ->_tools ->_setState ($ state , 'critical ' );
295+ }
296+ }
297+
298+
278299 $ res = array ();
279300 $ res ['server_id ' ] = $ server_id ;
280301 $ res ['type ' ] = $ type ;
You can’t perform that action at this time.
0 commit comments