newdevice: Added support for Toshiba RemotEye4 devices (#7312)

* newdevice: Added support for Toshiba RemotEye4 devices

* small updates thanks to kate

* Update new-os.php

* Update new-os.php
This commit is contained in:
Neil Lathwood 2017-09-13 04:27:06 +01:00 committed by Tony Murray
parent 58193e16a3
commit e0040b2831
7 changed files with 1810 additions and 22 deletions

View File

@ -0,0 +1,136 @@
mib: TIC-RMTI4-G9000-G2020-MIB
modules:
sensors:
voltage:
data:
-
oid: upsInputLLVoltageAB
num_oid: .1.3.6.1.4.1.186.1.19.2.5.1.2.2.
index: 'upsInputLLVoltageAB.{{ $index }}'
descr: Input LL (AB)
-
oid: upsInputLLVoltageBC
num_oid: .1.3.6.1.4.1.186.1.19.2.5.1.2.3.
index: 'upsInputLLVoltageBC.{{ $index }}'
descr: Input (BC)
-
oid: upsInputLLVoltageCA
num_oid: .1.3.6.1.4.1.186.1.19.2.5.1.2.4.
index: 'upsInputLLVoltageCA.{{ $index }}'
descr: Input (CA)
-
oid: upsOutputLLVoltageAB
num_oid: .1.3.6.1.4.1.186.1.19.2.5.1.3.3.
index: 'upsOutputLLVoltageAB.{{ $index }}'
descr: Output LL (AB)
-
oid: upsOutputLLVoltageBC
num_oid: .1.3.6.1.4.1.186.1.19.2.5.1.3.4.
index: 'upsOutputLLVoltageBC.{{ $index }}'
descr: Output (BC)
-
oid: upsOutputLLVoltageCA
num_oid: .1.3.6.1.4.1.186.1.19.2.5.1.3.5.
index: 'upsOutputLLVoltageCA.{{ $index }}'
descr: Output (CA)
-
oid: upsBypassLLVoltageAB
num_oid: .1.3.6.1.4.1.186.1.19.2.5.1.4.2.
index: 'upsBypassLLVoltageAB.{{ $index }}'
descr: Bypass LL (AB)
-
oid: upsBypassLLVoltageBC
num_oid: .1.3.6.1.4.1.186.1.19.2.5.1.4.3.
index: 'upsBypassLLVoltageBC.{{ $index }}'
descr: Bypass (BC)
-
oid: upsBypassLLVoltageCA
num_oid: .1.3.6.1.4.1.186.1.19.2.5.1.4.4.
index: 'upsBypassLLVoltageCA.{{ $index }}'
descr: Bypass (CA)
-
oid: upsBatteryVoltage
num_oid: .1.3.6.1.4.1.186.1.19.2.5.1.5.4.
index: 'upsBatteryVoltage.{{ $index }}'
descr: Battery
current:
options:
divisor: 10
data:
-
oid: upsInputCurrentPhaseA
num_oid: .1.3.6.1.4.1.186.1.19.2.5.1.2.8.
index: 'upsInputCurrentPhaseA.{{ $index }}'
descr: Input Phase A
-
oid: upsInputCurrentPhaseB
num_oid: .1.3.6.1.4.1.186.1.19.2.5.1.2.9.
index: 'upsInputCurrentPhaseB.{{ $index }}'
descr: Input Phase B
-
oid: upsInputCurrentPhaseC
num_oid: .1.3.6.1.4.1.186.1.19.2.5.1.2.10.
index: 'upsInputCurrentPhaseC.{{ $index }}'
descr: Input Phase C
-
oid: upsOutputCurrentPhaseA
num_oid: .1.3.6.1.4.1.186.1.19.2.5.1.3.6.
index: 'upsOutputCurrentPhaseA.{{ $index }}'
descr: Output Phase A
-
oid: upsOutputCurrentPhaseB
num_oid: .1.3.6.1.4.1.186.1.19.2.5.1.3.7.
index: 'upsOutputCurrentPhaseB.{{ $index }}'
descr: Output Phase B
-
oid: upsOutputCurrentPhaseC
num_oid: .1.3.6.1.4.1.186.1.19.2.5.1.3.8.
index: 'upsOutputCurrentPhaseC.{{ $index }}'
descr: Output Phase C
frequency:
options:
divisor: 10
data:
-
oid: upsInputFrequency
num_oid: .1.3.6.1.4.1.186.1.19.2.5.1.2.11.
index: 'upsInputFrequency.{{ $index }}'
descr: Input
-
oid: upsOutputFrequency
num_oid: .1.3.6.1.4.1.186.1.19.2.5.1.3.9.
index: 'upsOutputFrequency.{{ $index }}'
descr: Output
-
oid: upsBypassFrequency
num_oid: .1.3.6.1.4.1.186.1.19.2.5.1.4.5.
index: 'upsBypassFrequency.{{ $index }}'
descr: Bypass
runtime:
data:
-
oid: upsEstimatedBatteryRuntime
num_oid: .1.3.6.1.4.1.186.1.19.2.5.1.5.3.
index: 'upsEstimatedBatteryRuntime.{{ $index }}'
descr: Estimated runtime
charge:
data:
-
oid: upsBatteryChargeCurrent
num_oid: .1.3.6.1.4.1.186.1.19.2.5.1.5.8.
index: 'upsBatteryChargeCurrent.{{ $index }}'
descr: Battery charge
state:
data:
-
oid: upsBatteryStatus
num_oid: .1.3.6.1.4.1.186.1.19.2.5.1.5.1.
descr: 'Battery status'
index: 'upsBatteryStatus.{{ $index }}'
states:
- { descr: unknown, graph: 1, value: 1, generic: 3 }
- { descr: batteryNormal, graph: 1, value: 2, generic: 0 }
- { descr: batteryLow, graph: 1, value: 3, generic: 1 }
- { descr: batteryDepleted, graph: 1, value: 4, generic: 2 }
- { descr: batteryDischarging, graph: 1, value: 5, generic: 2 }
- { descr: batteryFailure, graph: 1, value: 6, generic: 2 }

View File

@ -0,0 +1,6 @@
os: remoteye4
text: 'Toshiba RemotEye4'
type: power
icon: toshiba
mib_dir:
- toshiba

View File

@ -29,5 +29,7 @@ if (starts_with($sysDescr, 'Linux') || starts_with($sysObjectId, '.1.3.6.1.4.1.8
}
} elseif (preg_match('/^QNAP Systems/', snmp_get($device, "entPhysicalMfgName.1", "-Ovqn", "ENTITY-MIB"))) {
$os = 'qnap';
} elseif (str_contains(snmp_get($device, 'upsIdentAgentSoftwareVersion.0', '-Osqnv', 'UPS-MIB'), 'RemotEye4')) {
$os = 'remoteye4';
}
}

View File

@ -0,0 +1,29 @@
<?php
/**
* remoteye4.inc.php
*
* LibreNMS os poller module for Toshiba RemotEye4
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @package LibreNMS
* @link http://librenms.org
* @copyright 2017 Neil Lathwood
* @author Neil Lathwood <gh+n@laf.io>
*/
$remoteye4_tmp = snmp_get_multi($device, 'upsIdentName.0 upsIdentAgentSoftwareVersion.0', '-OQUs', 'UPS-MIB');
$hardware = $remoteye4_tmp[0]['upsIdentName'];
$version = str_replace('RemotEye4 ', '', $remoteye4_tmp[0]['upsIdentAgentSoftwareVersion']);

File diff suppressed because it is too large Load Diff

View File

@ -39,11 +39,12 @@ sysObjectID: $full_sysObjectId
");
$os = getHostOS($device);
$continue = 'n';
if ($os != 'generic') {
c_echo("We already detect this device as OS $os type");
exit(1);
$continue = get_user_input("We already detect this device as OS $os type, do you want to continue to add sensors? (Y/n)");
}
if (!str_contains($continue, 'y', true)) {
$descr = get_user_input('Enter the description for this OS, i.e Cisco IOS:');
$icon = get_user_input('Enter the logo to use, this can be the name of an existing one (i.e: cisco) or the url to retrieve one:');
@ -82,7 +83,13 @@ discovery:
file_put_contents($test_file, $snmprec);
}
$mib_name = get_user_input("Base discovery file created, ctrl+c to exit now otherwise please enter the MIB name including path (url is also fine) for us to check for sensors:");
if ($os === 'generic') {
c_echo("Base discovery file created,");
}
}
$mib_name = get_user_input("ctrl+c to exit now otherwise please enter the MIB name including path (url is also fine) for us to check for sensors:");
if (filter_var($mib_name, FILTER_VALIDATE_URL)) {
$mib_data = file_get_contents($mib_name);
file_put_contents($config['temp_dir'] . "/{$options['o']}.mib", $mib_data);
@ -120,7 +127,7 @@ discovery:
$discovery[$type] .= "
-
oid: $table_name
value: $value,
value: $value
num_oid: {$tmp_table[$value]}.
descr: $descr";
if ($multiplier) {

View File

@ -0,0 +1,3 @@
1.3.6.1.2.1.1.1.0|4|Linux localhost.localdomain 2.6.37.6-lsp-3.2.5_stm24_0012-spear3xx #114 Thu Apr 6 16:20:21 CST 2017 armv5tejl
1.3.6.1.2.1.1.2.0|6|1.3.6.1.4.1.8072.3.2.10
1.3.6.1.2.1.33.1.1.4.0|4|RemotEye4 v1.04