added support for megatec ups - fixed tabs

This commit is contained in:
Jon
2016-10-23 02:16:58 +11:00
parent 52a4e135b0
commit f34d5b6151
8 changed files with 155 additions and 155 deletions
@@ -28,13 +28,13 @@ if ($device['os'] == 'megatec') {
$charge = snmp_get($device, $charge_oid, '-Osqnv');
if (!empty($charge)) {
$type = 'megatec';
$index = 0;
$limit = 100;
$lowlimit = 0;
$lowwarnlimit = 10;
$divisor = 1;
$descr = 'Battery Charge';
$type = 'megatec';
$index = 0;
$limit = 100;
$lowlimit = 0;
$lowwarnlimit = 10;
$divisor = 1;
$descr = 'Battery Charge';
discover_sensor(
$valid['sensor'],
@@ -29,32 +29,32 @@ if ($device['os'] == 'megatec') {
$battery_current = snmp_get($device, $battery_current_oid, '-Oqv');
if (!empty($battery_current) || $battery_current == 0) {
$type = 'megatec';
$index = 0;
$limit = 30;
$warnlimit = null;
$lowlimit = null;
$lowwarnlimit = null;
$divisor = 10;
$type = 'megatec';
$index = 0;
$limit = 30;
$warnlimit = null;
$lowlimit = null;
$lowwarnlimit = null;
$divisor = 10;
$current = $battery_current / $divisor;
$descr = 'Battery Current';
discover_sensor(
$valid['sensor'],
'current',
$device,
$battery_current_oid,
$index,
$type,
$descr,
$divisor,
'1',
$valid['sensor'],
'current',
$device,
$battery_current_oid,
$index,
$type,
$descr,
$divisor,
'1',
$lowlimit,
$lowwarnlimit,
$warnlimit,
$limit,
$current
);
$warnlimit,
$limit,
$current
);
}
}//end if
@@ -26,68 +26,68 @@
if ($device['os'] == 'megatec') {
$in_frequency_oid = '.1.3.6.1.4.1.935.1.1.1.3.2.4.0';
$in_frequency_oid = '.1.3.6.1.4.1.935.1.1.1.3.2.4.0';
$in_frequency = snmp_get($device, $in_frequency_oid, '-Oqv');
if (!empty($in_frequency) || $in_frequency == 0) {
$type = 'megatec';
$index = 0;
$limit = 60;
$warnlimit = 51;
$lowlimit = 0;
$lowwarnlimit = 49;
$divisor = 10;
$index = 0;
$limit = 60;
$warnlimit = 51;
$lowlimit = 0;
$lowwarnlimit = 49;
$divisor = 10;
$frequency = $in_frequency / $divisor;
$descr = 'Input frequency';
discover_sensor(
$valid['sensor'],
'frequency',
$device,
$in_frequency_oid,
$index,
$type,
$descr,
$divisor,
'1',
$valid['sensor'],
'frequency',
$device,
$in_frequency_oid,
$index,
$type,
$descr,
$divisor,
'1',
$lowlimit,
$lowwarnlimit,
$warnlimit,
$limit,
$frequency
);
$warnlimit,
$limit,
$frequency
);
}
$out_frequency_oid = '.1.3.6.1.4.1.935.1.1.1.4.2.2.0';
$out_frequency_oid = '.1.3.6.1.4.1.935.1.1.1.4.2.2.0';
$out_frequency = snmp_get($device, $frequency_oid, '-Oqv');
if (!empty($out_frequency) || $out_frequency == 0) {
$type = 'megatec';
$index = 0;
$limit = 60;
$warnlimit = 51;
$lowlimit = 0;
$lowwarnlimit = 49;
$divisor = 10;
$index = 0;
$limit = 60;
$warnlimit = 51;
$lowlimit = 0;
$lowwarnlimit = 49;
$divisor = 10;
$frequency = $out_frequency / $divisor;
$descr = 'Output frequency';
discover_sensor(
$valid['sensor'],
'frequency',
$device,
$out_frequency_oid,
$index,
$type,
$descr,
$divisor,
'1',
$valid['sensor'],
'frequency',
$device,
$out_frequency_oid,
$index,
$type,
$descr,
$divisor,
'1',
$lowlimit,
$lowwarnlimit,
$warnlimit,
$limit,
$frequency
);
$warnlimit,
$limit,
$frequency
);
}
}//end if
+21 -21
View File
@@ -29,32 +29,32 @@ if ($device['os'] == 'megatec') {
$output_load = snmp_get($device, $load_oid, '-Oqv');
if (!empty($output_load) || $output_load == 0) {
$type = 'megatec';
$index = 0;
$limit = 100;
$warnlimit = 80;
$lowlimit = 0;
$lowwarnlimit = null;
$divisor = 1;
$load = $output_load / $divisor;
$type = 'megatec';
$index = 0;
$limit = 100;
$warnlimit = 80;
$lowlimit = 0;
$lowwarnlimit = null;
$divisor = 1;
$load = $output_load / $divisor;
$descr = 'Output load';
discover_sensor(
$valid['sensor'],
'load',
$device,
$load_oid,
$index,
$type,
$descr,
$divisor,
'1',
$valid['sensor'],
'load',
$device,
$load_oid,
$index,
$type,
$descr,
$divisor,
'1',
$lowlimit,
$lowwarnlimit,
$warnlimit,
$limit,
$load
);
$warnlimit,
$limit,
$load
);
}
}//end if
@@ -29,32 +29,32 @@ if ($device['os'] == 'megatec') {
$ups_temperature = snmp_get($device, $ups_temperature_oid, '-Oqv');
if (!empty($ups_temperature) || $ups_temperature == 0) {
$type = 'megatec';
$index = 0;
$limit = 50;
$warnlimit = 40;
$lowlimit = 0;
$lowwarnlimit = 6;
$divisor = 10;
$type = 'megatec';
$index = 0;
$limit = 50;
$warnlimit = 40;
$lowlimit = 0;
$lowwarnlimit = 6;
$divisor = 10;
$temperature = $ups_temperature / $divisor;
$descr = 'Temperature';
discover_sensor(
$valid['sensor'],
'temperature',
$device,
$ups_temperature_oid,
$index,
$type,
$descr,
$divisor,
'1',
$valid['sensor'],
'temperature',
$device,
$ups_temperature_oid,
$index,
$type,
$descr,
$divisor,
'1',
$lowlimit,
$lowwarnlimit,
$warnlimit,
$limit,
$temperature
);
$warnlimit,
$limit,
$temperature
);
}
}//end if
@@ -29,64 +29,64 @@ if ($device['os'] == 'megatec') {
$in_voltage = snmp_get($device, $in_voltage_oid, '-Oqv');
if (!empty($in_voltage) || $in_voltage == 0) {
$type = 'megatec';
$index = 0;
$limit = 300;
$warnlimit = 253;
$lowlimit = 0;
$lowwarnlimit = 216;
$divisor = 10;
$type = 'megatec';
$index = 0;
$limit = 300;
$warnlimit = 253;
$lowlimit = 0;
$lowwarnlimit = 216;
$divisor = 10;
$voltage = $in_voltage / $divisor;
$descr = 'Input Voltage';
discover_sensor(
$valid['sensor'],
'voltage',
$device,
$in_voltage_oid,
$index,
$type,
$descr,
$divisor,
'1',
$valid['sensor'],
'voltage',
$device,
$in_voltage_oid,
$index,
$type,
$descr,
$divisor,
'1',
$lowlimit,
$lowwarnlimit,
$warnlimit,
$limit,
$voltage
);
$warnlimit,
$limit,
$voltage
);
}
$out_voltage_oid = '.1.3.6.1.4.1.935.1.1.1.4.2.1.0';
$out_voltage_oid = '.1.3.6.1.4.1.935.1.1.1.4.2.1.0';
$out_voltage = snmp_get($device, $out_voltage_oid, '-Oqv');
if (!empty($out_voltage) || $out_voltage == 0) {
$type = 'megatec';
$index = 0;
$limit = 300;
$warnlimit = 253;
$lowlimit = 0;
$lowwarnlimit = 216;
$divisor = 10;
$type = 'megatec';
$index = 0;
$limit = 300;
$warnlimit = 253;
$lowlimit = 0;
$lowwarnlimit = 216;
$divisor = 10;
$voltage = $out_voltage / $divisor;
$descr = 'Output Voltage';
discover_sensor(
$valid['sensor'],
'voltage',
$device,
$in_voltage_oid,
$index,
$type,
$descr,
$divisor,
'1',
$valid['sensor'],
'voltage',
$device,
$in_voltage_oid,
$index,
$type,
$descr,
$divisor,
'1',
$lowlimit,
$lowwarnlimit,
$warnlimit,
$limit,
$voltage
);
$warnlimit,
$limit,
$voltage
);
}
}//end if
+1 -1
View File
@@ -25,4 +25,4 @@
// NET Agent II
$hardware = $poll_device['sysDescr'];
$hardware = $poll_device['sysDescr'];
+2 -2
View File
@@ -1194,8 +1194,8 @@ class DiscoveryTest extends \PHPUnit_Framework_TestCase
{
$this->checkOS('sinetica');
}
public function testMegatec()
public function testMegatec()
{
$this->checkOS('megatec');
}