added support for megatec ups -

This commit is contained in:
Jon
2016-10-23 02:36:53 +11:00
parent 7ad2f08fb9
commit 9d0e1ae57f
11 changed files with 18 additions and 18 deletions

View File

@@ -1466,8 +1466,8 @@ $config['os'][$os]['type'] = 'power';
$config['os'][$os]['over'][0]['graph'] = 'device_current'; $config['os'][$os]['over'][0]['graph'] = 'device_current';
$config['os'][$os]['over'][0]['text'] = 'Current'; $config['os'][$os]['over'][0]['text'] = 'Current';
$os = 'megatec'; $os = 'netagent2';
$config['os'][$os]['text'] = 'Megatec UPS'; $config['os'][$os]['text'] = 'NET Agent II UPS';
$config['os'][$os]['group'] = 'ups'; $config['os'][$os]['group'] = 'ups';
$config['os'][$os]['type'] = 'power'; $config['os'][$os]['type'] = 'power';
$config['os'][$os]['over'][0]['graph'] = 'device_load'; $config['os'][$os]['over'][0]['graph'] = 'device_load';

View File

@@ -24,5 +24,5 @@
*/ */
if (starts_with($sysDescr, 'NET Agent II')) { if (starts_with($sysDescr, 'NET Agent II')) {
$os = 'megatec'; $os = 'netagent2';
} }

View File

@@ -23,12 +23,12 @@
* @author Tony Murray <murraytony@gmail.com> * @author Tony Murray <murraytony@gmail.com>
*/ */
if ($device['os'] == 'megatec') { if ($device['os'] == 'netagent2') {
$charge_oid = '.1.3.6.1.4.1.935.1.1.1.2.2.1.0'; $charge_oid = '.1.3.6.1.4.1.935.1.1.1.2.2.1.0';
$charge = snmp_get($device, $charge_oid, '-Osqnv'); $charge = snmp_get($device, $charge_oid, '-Osqnv');
if (!empty($charge)) { if (!empty($charge)) {
$type = 'megatec'; $type = 'netagent2';
$index = 0; $index = 0;
$limit = 100; $limit = 100;
$lowlimit = 0; $lowlimit = 0;

View File

@@ -24,12 +24,12 @@
*/ */
if ($device['os'] == 'megatec') { if ($device['os'] == 'netagent2') {
$battery_current_oid = '.1.3.6.1.4.1.935.1.1.1.3.2.1.0'; $battery_current_oid = '.1.3.6.1.4.1.935.1.1.1.3.2.1.0';
$battery_current = snmp_get($device, $battery_current_oid, '-Oqv'); $battery_current = snmp_get($device, $battery_current_oid, '-Oqv');
if (!empty($battery_current) || $battery_current == 0) { if (!empty($battery_current) || $battery_current == 0) {
$type = 'megatec'; $type = 'netagent2';
$index = 0; $index = 0;
$limit = 30; $limit = 30;
$warnlimit = null; $warnlimit = null;

View File

@@ -24,12 +24,12 @@
*/ */
if ($device['os'] == 'megatec') { if ($device['os'] == 'netagent2') {
$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'); $in_frequency = snmp_get($device, $in_frequency_oid, '-Oqv');
if (!empty($in_frequency) || $in_frequency == 0) { if (!empty($in_frequency) || $in_frequency == 0) {
$type = 'megatec'; $type = 'netagent2';
$index = 0; $index = 0;
$limit = 60; $limit = 60;
$warnlimit = 51; $warnlimit = 51;
@@ -61,7 +61,7 @@ if ($device['os'] == 'megatec') {
$out_frequency = snmp_get($device, $frequency_oid, '-Oqv'); $out_frequency = snmp_get($device, $frequency_oid, '-Oqv');
if (!empty($out_frequency) || $out_frequency == 0) { if (!empty($out_frequency) || $out_frequency == 0) {
$type = 'megatec'; $type = 'netagent2';
$index = 0; $index = 0;
$limit = 60; $limit = 60;
$warnlimit = 51; $warnlimit = 51;

View File

@@ -24,12 +24,12 @@
*/ */
if ($device['os'] == 'megatec') { if ($device['os'] == 'netagent2') {
$load_oid = '.1.3.6.1.4.1.935.1.1.1.4.2.3.0'; $load_oid = '.1.3.6.1.4.1.935.1.1.1.4.2.3.0';
$output_load = snmp_get($device, $load_oid, '-Oqv'); $output_load = snmp_get($device, $load_oid, '-Oqv');
if (!empty($output_load) || $output_load == 0) { if (!empty($output_load) || $output_load == 0) {
$type = 'megatec'; $type = 'netagent2';
$index = 0; $index = 0;
$limit = 100; $limit = 100;
$warnlimit = 80; $warnlimit = 80;

View File

@@ -24,12 +24,12 @@
*/ */
if ($device['os'] == 'megatec') { if ($device['os'] == 'netagent2') {
$ups_temperature_oid = '.1.3.6.1.4.1.935.1.1.1.2.2.3.0'; $ups_temperature_oid = '.1.3.6.1.4.1.935.1.1.1.2.2.3.0';
$ups_temperature = snmp_get($device, $ups_temperature_oid, '-Oqv'); $ups_temperature = snmp_get($device, $ups_temperature_oid, '-Oqv');
if (!empty($ups_temperature) || $ups_temperature == 0) { if (!empty($ups_temperature) || $ups_temperature == 0) {
$type = 'megatec'; $type = 'netagent2';
$index = 0; $index = 0;
$limit = 50; $limit = 50;
$warnlimit = 40; $warnlimit = 40;

View File

@@ -24,12 +24,12 @@
*/ */
if ($device['os'] == 'megatec') { if ($device['os'] == 'netagent2') {
$in_voltage_oid = '.1.3.6.1.4.1.935.1.1.1.3.2.1.0'; $in_voltage_oid = '.1.3.6.1.4.1.935.1.1.1.3.2.1.0';
$in_voltage = snmp_get($device, $in_voltage_oid, '-Oqv'); $in_voltage = snmp_get($device, $in_voltage_oid, '-Oqv');
if (!empty($in_voltage) || $in_voltage == 0) { if (!empty($in_voltage) || $in_voltage == 0) {
$type = 'megatec'; $type = 'netagent2';
$index = 0; $index = 0;
$limit = 300; $limit = 300;
$warnlimit = 253; $warnlimit = 253;
@@ -61,7 +61,7 @@ if ($device['os'] == 'megatec') {
$out_voltage = snmp_get($device, $out_voltage_oid, '-Oqv'); $out_voltage = snmp_get($device, $out_voltage_oid, '-Oqv');
if (!empty($out_voltage) || $out_voltage == 0) { if (!empty($out_voltage) || $out_voltage == 0) {
$type = 'megatec'; $type = 'netagent2';
$index = 0; $index = 0;
$limit = 300; $limit = 300;
$warnlimit = 253; $warnlimit = 253;

View File

@@ -1197,7 +1197,7 @@ class DiscoveryTest extends \PHPUnit_Framework_TestCase
public function testMegatec() public function testMegatec()
{ {
$this->checkOS('megatec'); $this->checkOS('netagent2');
} }
public function testSmartax() public function testSmartax()