fix: Fixed CPU/Mem polling for Cyberoam-UTM devices (#6315)

This commit is contained in:
Neil Lathwood
2017-04-01 22:17:08 +01:00
committed by GitHub
parent 8f0f1ba8b9
commit ae73109159
2 changed files with 5 additions and 3 deletions

View File

@@ -26,7 +26,7 @@
if ($device['os'] === 'cyberoam-utm') {
echo 'Cyberoam UTM : ';
$oid = '.1.3.6.1.4.1.21067.2.1.1.3.0';
$oid = '.1.3.6.1.4.1.21067.2.1.2.2.1.0';
$descr = 'Processor';
$usage = snmp_get($device, $oid, '-Ovqn');

View File

@@ -23,17 +23,19 @@
* @author Neil Lathwood <neil@lathwood.co.uk>
*/
if ($mempool['mempool_index'] === 0) {
if ($mempool['mempool_index'] == 0) {
$mem_perc = snmp_get($device, '.1.3.6.1.4.1.21067.2.1.2.4.2.0', '-OvQ');
$mem_capacity = snmp_get($device, '.1.3.6.1.4.1.21067.2.1.2.4.1.0', '-OvQ');
$mem_capacity = ($mem_capacity*1024*1024);
$mempool['total'] = $mem_capacity;
$mempool['used'] = ($mem_capacity / 100) * $mem_perc;
$mempool['free'] = $mempool['total'] - $mempool['used'];
}
if ($mempool['mempool_index'] === 1) {
if ($mempool['mempool_index'] == 1) {
$swap_perc = snmp_get($device, '.1.3.6.1.4.1.21067.2.1.2.4.4.0', '-OvQ');
$swap_capacity = snmp_get($device, '.1.3.6.1.4.1.21067.2.1.2.4.3.0', '-OvQ');
$swap_capacity = ($swap_capacity*1024*1024);
$mempool['total'] = $swap_capacity;
$mempool['used'] = ($swap_capacity / 100) * $swap_perc;
$mempool['free'] = $mempool['total'] - $mempool['used'];