diff --git a/.github/workflows/plugin-ci-workflow.yml b/.github/workflows/plugin-ci-workflow.yml index 2280b99..03a7233 100644 --- a/.github/workflows/plugin-ci-workflow.yml +++ b/.github/workflows/plugin-ci-workflow.yml @@ -85,7 +85,7 @@ jobs: run: sudo apt-get update - name: Install System Dependencies - run: sudo apt-get install -y apache2 snmp snmpd rrdtool fping libapache2-mod-php${{ matrix.php }} + run: sudo apt-get install -y apache2 snmp snmpd rrdtool fping libapache2-mod-php - name: Start SNMPD Agent and Test run: | diff --git a/includes/polling.php b/includes/polling.php index 273c284..c5c2c1d 100644 --- a/includes/polling.php +++ b/includes/polling.php @@ -245,14 +245,6 @@ function thold_poller_output(&$rrd_update_array) { return $rrd_update_array; } -if (!function_exists('array_column')) { - function array_column($array, $column_name) { - return array_map(function ($element) use ($column_name) { - return $element[$column_name]; - }, $array); - } -} - function thold_check_all_thresholds() { global $config; diff --git a/thold_functions.php b/thold_functions.php index 46ac613..a3bab97 100644 --- a/thold_functions.php +++ b/thold_functions.php @@ -493,55 +493,55 @@ function thold_expression_boolean_rpn($operator, &$stack) { array_push($stack, '0'); } else { switch($operator) { - case 'LT': - if ($v1 < $v2) { - array_push($stack, '1'); - } else { - array_push($stack, '0'); - } + case 'LT': + if ($v1 < $v2) { + array_push($stack, '1'); + } else { + array_push($stack, '0'); + } - break; - case 'GT': - if ($v1 > $v2) { - array_push($stack, '1'); - } else { - array_push($stack, '0'); - } + break; + case 'GT': + if ($v1 > $v2) { + array_push($stack, '1'); + } else { + array_push($stack, '0'); + } - break; - case 'LE': - if ($v1 <= $v2) { - array_push($stack, '1'); - } else { - array_push($stack, '0'); - } + break; + case 'LE': + if ($v1 <= $v2) { + array_push($stack, '1'); + } else { + array_push($stack, '0'); + } - break; - case 'GE': - if ($v1 >= $v2) { - array_push($stack, '1'); - } else { - array_push($stack, '0'); - } + break; + case 'GE': + if ($v1 >= $v2) { + array_push($stack, '1'); + } else { + array_push($stack, '0'); + } - break; - case 'EQ': - if ($v1 == $v2) { - array_push($stack, '1'); - } else { - array_push($stack, '0'); - } + break; + case 'EQ': + if ($v1 == $v2) { + array_push($stack, '1'); + } else { + array_push($stack, '0'); + } - break; - case 'NE': - if ($v1 != $v2) { - array_push($stack, '1'); - } else { - array_push($stack, '0'); - } + break; + case 'NE': + if ($v1 != $v2) { + array_push($stack, '1'); + } else { + array_push($stack, '0'); + } - break; - } + break; + } } } }