newdevice: Added support for Geist PDU (#6646)

This commit is contained in:
Neil Lathwood
2017-05-16 23:39:35 -05:00
committed by Tony Murray
co-authored by Tony Murray
parent c40b762e23
commit e223ec3ff2
9 changed files with 232 additions and 3 deletions
+15
View File
@@ -0,0 +1,15 @@
os: geist-pdu
text: 'Geist PDU'
type: power
icon: geist
group: geist
discovery:
-
sysObjectId:
- .1.3.6.1.4.1.21239.2
sysDescr:
- RCM-O
mib_dir:
- geist
over:
- { graph: device_bits, text: 'Device Traffic' }
+6 -2
View File
@@ -2,9 +2,13 @@ os: geist-watchdog
text: 'Geist Watchdog'
type: environment
icon: geist
group: geist
discovery:
- sysObjectId:
- .1.3.6.1.4.1.21239.
-
sysObjectId:
- .1.3.6.1.4.1.21239.
sysDescr_except:
- RCM-O
mib_dir:
- geist
over:
@@ -0,0 +1,53 @@
<?php
/**
* geist-pdu.inc.php
*
* LibreNMS current discovery module for Geist PDU
*
* 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 <[email protected]>
*/
foreach ($pre_cache['geist_pdu_iec'] as $index => $data) {
$divisor = 10;
$value = $data['ctrl3ChIECDeciAmpsA'] / $divisor;
$current_oid = '.1.3.6.1.4.1.21239.2.25.1.8.';
$descr = $data['ctrl3ChIECName'] . ' Phase A';
$oid = $current_oid . $index;
if ($value > 0) {
discover_sensor($valid['sensor'], 'current', $device, $oid, 'ctrl3ChIECDeciAmpsA', 'geist-pdu', $descr, $divisor, 1, null, null, null, null, $value);
}
$divisor = 10;
$value = $data['ctrl3ChIECDeciAmpsB'] / $divisor;
$current_oid = '.1.3.6.1.4.1.21239.2.25.1.16.';
$descr = $data['ctrl3ChIECName'] . ' Phase B';
$oid = $current_oid . $index;
if ($value > 0) {
discover_sensor($valid['sensor'], 'current', $device, $oid, 'ctrl3ChIECDeciAmpsB', 'geist-pdu', $descr, $divisor, 1, null, null, null, null, $value);
}
$divisor = 10;
$value = $data['ctrl3ChIECDeciAmpsC'] / $divisor;
$current_oid = '.1.3.6.1.4.1.21239.2.25.1.24.';
$descr = $data['ctrl3ChIECName'] . ' Phase C';
$oid = $current_oid . $index;
if ($value > 0) {
discover_sensor($valid['sensor'], 'current', $device, $oid, 'ctrl3ChIECDeciAmpsC', 'geist-pdu', $descr, $divisor, 1, null, null, null, null, $value);
}
}
@@ -0,0 +1,50 @@
<?php
/**
* geist-pdu.inc.php
*
* LibreNMS power discovery module for Geist PDU
*
* 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 <[email protected]>
*/
foreach ($pre_cache['geist_pdu_iec'] as $index => $data) {
$value = $data['ctrl3ChIECRealPowerA'] / $divisor;
$current_oid = '.1.3.6.1.4.1.21239.2.25.1.10.';
$descr = $data['ctrl3ChIECName'] . ' Phase A';
$oid = $current_oid . $index;
if ($value > 0) {
discover_sensor($valid['sensor'], 'power', $device, $oid, 'ctrl3ChIECRealPowerA', 'geist-pdu', $descr, 1, 1, null, null, null, null, $value);
}
$value = $data['ctrl3ChIECRealPowerB'] / $divisor;
$current_oid = '.1.3.6.1.4.1.21239.2.25.1.18.';
$descr = $data['ctrl3ChIECName'] . ' Phase B';
$oid = $current_oid . $index;
if ($value > 0) {
discover_sensor($valid['sensor'], 'power', $device, $oid, 'ctrl3ChIECRealPowerB', 'geist-pdu', $descr, 1, 1, null, null, null, null, $value);
}
$value = $data['ctrl3ChIECRealPowerC'] / $divisor;
$current_oid = '.1.3.6.1.4.1.21239.2.25.1.26.';
$descr = $data['ctrl3ChIECName'] . ' Phase C';
$oid = $current_oid . $index;
if ($value > 0) {
discover_sensor($valid['sensor'], 'power', $device, $oid, 'ctrl3ChIECRealPowerC', 'geist-pdu', $descr, 1, 1, null, null, null, null, $value);
}
}
@@ -0,0 +1,27 @@
<?php
/**
* geist-pdu.inc.php
*
* LibreNMS pre-cache discovery module for Geist PDU
*
* 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 <[email protected]>
*/
echo 'ctrl3ChIECTable ';
$pre_cache['geist_pdu_iec'] = snmpwalk_cache_oid($device, 'ctrl3ChIECTable', array(), 'GEIST-MIB-V3');
@@ -0,0 +1,50 @@
<?php
/**
* geist-pdu.inc.php
*
* LibreNMS voltage discovery module for Geist PDU
*
* 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 <[email protected]>
*/
foreach ($pre_cache['geist_pdu_iec'] as $index => $data) {
$value = $data['ctrl3ChIECVoltsA'];
$current_oid = '.1.3.6.1.4.1.21239.2.25.1.6.';
$descr = $data['ctrl3ChIECName'] . ' Phase A';
$oid = $current_oid . $index;
if ($value > 0) {
discover_sensor($valid['sensor'], 'voltage', $device, $oid, 'ctrl3ChIECVoltsA', 'geist-pdu', $descr, 1, 1, null, null, null, null, $value);
}
$value = $data['ctrl3ChIECVoltsB'];
$current_oid = '.1.3.6.1.4.1.21239.2.25.1.14.';
$descr = $data['ctrl3ChIECName'] . ' Phase B';
$oid = $current_oid . $index;
if ($value > 0) {
discover_sensor($valid['sensor'], 'voltage', $device, $oid, 'ctrl3ChIECVoltsB', 'geist-pdu', $descr, 1, 1, null, null, null, null, $value);
}
$value = $data['ctrl3ChIECVoltsC'];
$current_oid = '.1.3.6.1.4.1.21239.2.25.1.22.';
$descr = $data['ctrl3ChIECName'] . ' Phase C';
$oid = $current_oid . $index;
if ($value > 0) {
discover_sensor($valid['sensor'], 'voltage', $device, $oid, 'ctrl3ChIECVoltsC', 'geist-pdu', $descr, 1, 1, null, null, null, null, $value);
}
}
+27
View File
@@ -0,0 +1,27 @@
<?php
/**
* geist-pdu.inc.php
*
* LibreNMS OS poller module for Geist PDU
*
* 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 <[email protected]>
*/
$version = snmp_get($device, 'productVersion.0', '-Oqv', 'GEIST-MIB-V3');
$hardware = snmp_get($device, 'productHardware.0', '-Oqv', 'GEIST-MIB-V3');
+2 -1
View File
@@ -23,4 +23,5 @@
* @author Neil Lathwood <[email protected]>
*/
$serial = snmp_get($device, 'climateSerial', '-Oqv', 'GEIST-MIB-V3');
$serial = snmp_get($device, 'climateSerial', '-Oqv', 'GEIST-MIB-V3');
$version = snmp_get($device, 'productVersion.0', '-Oqv', 'GEIST-MIB-V3');
+2
View File
@@ -0,0 +1,2 @@
1.3.6.1.2.1.1.1.0|4|RCM-O
1.3.6.1.2.1.1.2.0|6|1.3.6.1.4.1.21239.2