File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed
Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -605,8 +605,8 @@ function monitorRaid(){
605605 $ type = 'raid_state ' ;
606606
607607 /* This monitoring is only available if mdadm is installed */
608- $ location = shell_exec ('which mdadm ' );
609- if ($ location != '' ){
608+ $ location = system ('which mdadm ' , $ retval );
609+ if ($ retval === 0 ){
610610 /*
611611 * Fetch the output
612612 */
@@ -709,8 +709,8 @@ function monitorRkHunter(){
709709 $ type = 'rkhunter ' ;
710710
711711 /* This monitoring is only available if rkhunter is installed */
712- $ location = shell_exec ('which rkhunter ' );
713- if ($ location != '' ){
712+ $ location = system ('which rkhunter ' , $ retval );
713+ if ($ retval === 0 ){
714714 /*
715715 * Fetch the output
716716 */
@@ -763,9 +763,9 @@ function monitorFail2ban(){
763763 $ type = 'log_fail2ban ' ;
764764
765765 /* This monitoring is only available if fail2ban is installed */
766- $ location = shell_exec ('which fail2ban-client ' ); // Debian & Ubuntu
767- if ($ location == '' ) $ location = shell_exec ('which fail2ban ' ); // CentOS & Fedora
768- if ($ location != '' ){
766+ $ location = system ('which fail2ban-client ' , $ retval ); // Debian & Ubuntu
767+ if ($ retval ! == 0 ) $ location = system ('which fail2ban ' , $ retval ); // CentOS & Fedora
768+ if ($ retval === 0 ){
769769 /* Get the data of the log */
770770 $ data = $ this ->_getLogData ($ type );
771771
You can’t perform that action at this time.
0 commit comments