Skip to content

Commit 9dbd284

Browse files
committed
1 parent 63098f8 commit 9dbd284

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

server/mods-available/monitor_core_module.inc.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)