newdevice: Added support for Schneider PowerLogic (#6809)

This commit is contained in:
Neil Lathwood 2017-06-13 22:20:12 +01:00 committed by Tony Murray
parent ec636ac05a
commit 19cdf8f684
10 changed files with 1649 additions and 0 deletions

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" version="1" viewBox="0 0 188.74 57"><defs><clipPath id="a"><path d="M409.44 126.25V82.62h147.8v43.63"/></clipPath><clipPath id="b"><path d="M409.44 126.25V82.62h147.8v43.63"/></clipPath></defs><path d="M22.85 9.17c-4.22-1.88-6.74-2.6-9.24-2.6-2.6 0-4.3.94-4.3 2.4 0 4.37 14.9 3.14 14.9 13.28 0 5.6-4.7 8.84-11.2 8.84-5.1 0-7.6-1.4-10.5-2.9V22c4.2 2.77 6.8 3.75 10 3.75 2.8 0 4.3-.98 4.3-2.7C16.8 18.3 2 20.05 2 9.6c0-5.1 4.34-8.4 11.1-8.4 3.28 0 6.2.7 9.9 2.2v5.7m20.8 20.6c-2.5.9-4.56 1.3-6.65 1.3-6.9 0-11.4-4.03-11.4-10.17 0-6 4.66-10.27 11.16-10.27 2 0 4.6.5 6.6 1.3v4.62c-1.6-.87-3.5-1.34-5-1.34-3.7 0-6.1 2.22-6.1 5.7 0 3.5 2.4 5.8 5.9 5.8 1.5 0 2.9-.38 5.6-1.4v4.47m54-11.1c.3-2.7 1.9-4.3 4.3-4.3s4 1.7 4.3 4.4h-8.6zm3.9-8c-6 0-10.4 4.3-10.4 10.3C91.3 27 95.8 31 102.8 31c1.5 0 5.2 0 8.8-2.6v-3.9c-2.9 2.1-4.86 2.8-7.3 2.8-3.9 0-6.3-2.02-6.5-5.47h14.1c.3-7.2-4.43-11.27-10.2-11.27m12.6 20.07h6.2V11h-6.2v19.72zm23.4-5.4c-1.3 1.16-2.35 1.63-3.7 1.63-2.9 0-4.73-2.4-4.73-6 0-3.92 1.83-6.2 4.95-6.2 1.1 0 2.55.5 3.45 1.17v9.4zm0-23.74v10.3c-1.66-.8-3.33-1.3-5.13-1.3-5.66 0-9.57 4.2-9.57 10.2 0 5.9 3.9 10.3 9.2 10.3 2.1 0 3.74-.6 5.5-2v1.6h6.2v-29h-6.2m15.33 17c.3-2.8 1.8-4.3 4.3-4.3 2.4 0 4.08 1.6 4.3 4.3H153zm3.8-8c-6 0-10.4 4.3-10.4 10.3S150.9 31 157.9 31c1.57 0 5.3 0 8.84-2.6v-3.9c-2.9 2-4.84 2.8-7.3 2.8-3.9 0-6.3-2.1-6.5-5.5H167c.3-7.2-4.45-11.3-10.2-11.3" fill="#009e4d"/><g clip-path="url(#a)" fill="#009e4d" transform="matrix(1.25 0 0 -1.25 -509.96 159.04)"><path d="M548.86 113.9h.08c1.46 3.3 3.1 4.84 5.02 4.84 1 0 1.84-.38 3.28-1.44l-1.37-4.38c-1.3.82-2.15 1.17-2.93 1.17-1.82 0-2.98-1.8-4.08-4.7v-6.8h-4.95v15.7h5v-4.6M504.5 125c.47-1.23-.37-2.94-1.86-3.82-1.5-.86-3.1-.6-3.54.65-.47 1.23.36 2.94 1.86 3.8 1.5.9 3.08.62 3.55-.6"/></g><path d="M65.96 18.17c0-5.35-3.63-7.53-7.2-7.53-2.45 0-4.46 1.02-6.25 3.3V1.58h-6.2v29.07h6.2v-12.5c1.5-2.1 2.7-3 4.2-3 2 0 3.2 1.38 3.2 4.32v6.92c2.1-1.1 4.2-1.8 6.2-2v-6.3m15.6-7.5c-2.5 0-4.4.9-6.4 3.2V11H69v13.4c2.13.22 4.9 1.2 6.2 2.83V18c1.6-2.43 2.76-3.24 4.3-3.24 1.75 0 3.1 1.16 3.1 3.94v11.97h6.2v-12.5c0-5.8-4.1-7.54-7.2-7.54m10.6 25.7H85v5.1h6.95v2.2h-7v5.3h7.4v2.2h-9.8v-17h9.6v2.2m5.9 14.8h2.2v-17H98v17zm13.1-9.53c1.56 0 2.53 1.1 2.6 2.78h-5.6c.3-1.77 1.3-2.77 3-2.77zm-3.05 4.25h7.84c0-4.14-1.9-6.14-4.9-6.14-3.08 0-5.2 2.3-5.2 5.7 0 3.1 1.9 6 5.4 6 1.9 0 3.1-.4 4.45-1.3v-2.2c-1.3.9-2.6 1.4-3.9 1.4-2.2 0-3.5-1.1-3.8-3.3m22.2-3.1c-1.3-.8-2.1-1.1-3.1-1.1-2 0-3.4 1.6-3.4 3.8 0 2.4 1.5 3.7 3.7 3.7.9 0 1.8-.2 2.9-.7v2.2c-.8.4-2.2.7-3.3.7-3.4 0-5.7-2.3-5.7-5.5 0-3.7 2.1-6 5.5-6 1.3 0 2.1.3 3.2.8V43m10-2.96h3.5v2H140v5.77c0 1.3.95 1.7 1.6 1.7.8 0 1.6-.3 2.5-.8v2.1c-.77.4-1.96.7-2.7.7-2.4 0-3.6-1.5-3.6-3.5v-6H136v-.2l4.1-4.1V40m11.97 0v2.57h.04c1.1-1.96 2.2-2.8 3.3-2.8.9 0 1.8.44 2.7 1.3l-1.1 1.95c-.6-.67-1.5-1.13-2-1.13-1.5 0-2.7 1.5-2.7 3.4v5.8H150V39.9h2.2m28.5 2.94c-1.3-.9-2.1-1.15-3.1-1.15-2 0-3.4 1.5-3.4 3.8s1.5 3.7 3.77 3.7c.95 0 1.85-.3 2.97-.8v2.2c-.74.3-2.15.6-3.3.6-3.36 0-5.7-2.3-5.7-5.6 0-3.7 2.13-6.1 5.5-6.1 1.3 0 2.2.3 3.25.8v2.4M164 51.1h2.2V39.9H164v11.2z" fill="#009e4d"/><g clip-path="url(#b)" fill="#009e4d" transform="matrix(1.25 0 0 -1.25 -509.96 159.04)"><path d="M541.05 98.5c.17-.42-.13-1.04-.66-1.35-.6-.3-1.1-.2-1.3.22-.2.44.1 1.05.6 1.36.5.3 1.1.2 1.2-.22m-78.9-.7c-.3 0-.5 0-.6-.2-.1 0-.1-.1-.1-.2l-1.6-6c-.4-2.1-3-4.2-6.4-4.2h-4.7l.8 3.1h3c.3 0 .5.1.7.4.1.1.2.2.2.4l1.2 5.3c.3 2.1 2.5 4.4 5.9 4.4h4.8l-.7-2.8H462zm1.1-3.6l.5 2h4.8c.6 2.8.1 5.4-1.6 7.2-3.5 3.5-10.7 2.3-16.1-2.8-.9-.8-1.6-1.6-2.2-2.5h2.9l-.6-2h-3.5c-.4-.6-.7-1.2-.9-1.8h4.1l-.7-1.9h-4c-.7-2.9-.3-5.7 1.5-7.5 3.4-3.4 10.6-2.2 16 3 .9.9 1.7 1.8 2.4 2.8H462l.55 2h4.4c.3.6.6 1.25.85 1.87H463"/></g></svg>

After

Width:  |  Height:  |  Size: 3.6 KiB

View File

@ -0,0 +1,14 @@
os: powerlogic
text: Schneider PowerLogic
icon: schneider
type: power
over:
- { graph: sensor_voltage, text: 'Voltage' }
- { graph: sensor_current, text: 'Current' }
- { graph: sensor_power, text: 'Power' }
- { graph: sensor_frequency, text: 'Frequency' }
mib_dir:
- schneider
discovery:
- sysObjectId:
- .1.3.6.1.4.1.3833.1.7.255.15

View File

@ -0,0 +1,52 @@
<?php
/**
* powerlogic.inc.php
*
* LibreNMS current sensor discovery module for Schneider PowerLogic
*
* 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 <neil@lathwood.co.uk>
*/
$data = $pre_cache['powerlogic_loadCurrentTable'];
if (is_numeric($data['lcIa'][1])) {
$current_oid = '.1.3.6.1.4.1.3833.1.7.255.15.1.1.2.1.2.1';
$index = 'lcIa';
$descr = 'Phase A';
$current = $data['lcIa'][1];
discover_sensor($valid['sensor'], 'current', $device, $current_oid, $index, 'powerlogic', $descr, 1, 1, null, null, null, null, $current);
}
if (is_numeric($data['lcIb'][1])) {
$current_oid = '.1.3.6.1.4.1.3833.1.7.255.15.1.1.2.1.3.1';
$index = 'lcIb';
$descr = 'Phase B';
$current = $data['lcIb'][1];
discover_sensor($valid['sensor'], 'current', $device, $current_oid, $index, 'powerlogic', $descr, 1, 1, null, null, null, null, $current);
}
if (is_numeric($data['lcIc'][1])) {
$current_oid = '.1.3.6.1.4.1.3833.1.7.255.15.1.1.2.1.4.1';
$index = 'lcIc';
$descr = 'Phase C';
$current = $data['lcIc'][1];
discover_sensor($valid['sensor'], 'current', $device, $current_oid, $index, 'powerlogic', $descr, 1, 1, null, null, null, null, $current);
}
unset($data);

View File

@ -0,0 +1,36 @@
<?php
/**
* powerlogic.inc.php
*
* LibreNMS frequency sensor discovery module for Schneider PowerLogic
*
* 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 <neil@lathwood.co.uk>
*/
$data = $pre_cache['powerlogic_frequencyTable'];
if (is_numeric($data['fFrequency'][1])) {
$current_oid = '.1.3.6.1.4.1.3833.1.7.255.15.1.1.6.1.2.1';
$index = 'fFrequency';
$descr = 'Frequency';
$current = $data['fFrequency'][1];
discover_sensor($valid['sensor'], 'frequency', $device, $current_oid, $index, 'powerlogic', $descr, 1, 1, null, null, null, null, $current);
}
unset($data);

View File

@ -0,0 +1,37 @@
<?php
/**
* powerlogic.inc.php
*
* LibreNMS power sensor discovery module for Schneider PowerLogic
*
* 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 <neil@lathwood.co.uk>
*/
$data = $pre_cache['powerlogic_powerTable'];
if (is_numeric($data['pReal'][1])) {
$current_oid = '.1.3.6.1.4.1.3833.1.7.255.15.1.1.3.1.2.1';
$index = 'pReal';
$descr = 'Power';
$multiplier = 1000;
$current = ($data['pReal'][1] * $multiplier);
discover_sensor($valid['sensor'], 'power', $device, $current_oid, $index, 'powerlogic', $descr, 1, $multiplier, null, null, null, null, $current);
}
unset($data);

View File

@ -0,0 +1,36 @@
<?php
/**
* powerlogic.inc.php
*
* LibreNMS pre-cache sensor discovery module for Schneider PowerLogic
*
* 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 <neil@lathwood.co.uk>
*/
echo 'loadCurrentTable ';
$pre_cache['powerlogic_loadCurrentTable'] = snmpwalk_cache_index($device, 'loadCurrentTable', array(), 'PM8ECCMIB');
echo 'powerTable ';
$pre_cache['powerlogic_powerTable'] = snmpwalk_cache_index($device, 'powerTable', array(), 'PM8ECCMIB');
echo 'voltageTable ';
$pre_cache['powerlogic_voltageTable'] = snmpwalk_cache_index($device, 'voltageTable', array(), 'PM8ECCMIB');
echo 'frequencyTable ';
$pre_cache['powerlogic_frequencyTable'] = snmpwalk_cache_index($device, 'frequencyTable', array(), 'PM8ECCMIB');

View File

@ -0,0 +1,76 @@
<?php
/**
* powerlogic.inc.php
*
* LibreNMS voltage sensor discovery module for Schneider PowerLogic
*
* 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 <neil@lathwood.co.uk>
*/
$data = $pre_cache['powerlogic_voltageTable'];
if (is_numeric($data['vVab'][1])) {
$current_oid = '.1.3.6.1.4.1.3833.1.7.255.15.1.1.5.1.2.1';
$index = 'vVab';
$descr = 'Line A to B';
$current = $data['vVab'][1];
discover_sensor($valid['sensor'], 'voltage', $device, $current_oid, $index, 'powerlogic', $descr, 1, 1, null, null, null, null, $current);
}
if (is_numeric($data['vVbc'][1])) {
$current_oid = '.1.3.6.1.4.1.3833.1.7.255.15.1.1.5.1.3.1';
$index = 'vVbc';
$descr = 'Line B to C';
$current = $data['vVbc'][1];
discover_sensor($valid['sensor'], 'voltage', $device, $current_oid, $index, 'powerlogic', $descr, 1, 1, null, null, null, null, $current);
}
if (is_numeric($data['vVca'][1])) {
$current_oid = '.1.3.6.1.4.1.3833.1.7.255.15.1.1.5.1.4.1';
$index = 'vVca';
$descr = 'Line C to A';
$current = $data['vVca'][1];
discover_sensor($valid['sensor'], 'voltage', $device, $current_oid, $index, 'powerlogic', $descr, 1, 1, null, null, null, null, $current);
}
if (is_numeric($data['vVan'][1])) {
$current_oid = '.1.3.6.1.4.1.3833.1.7.255.15.1.1.5.1.6.1';
$index = 'vVan';
$descr = 'Line A to neutral';
$current = $data['vVan'][1];
discover_sensor($valid['sensor'], 'voltage', $device, $current_oid, $index, 'powerlogic', $descr, 1, 1, null, null, null, null, $current);
}
if (is_numeric($data['vVbn'][1])) {
$current_oid = '.1.3.6.1.4.1.3833.1.7.255.15.1.1.5.1.7.1';
$index = 'vVbn';
$descr = 'Line B to neutral';
$current = $data['vVbn'][1];
discover_sensor($valid['sensor'], 'voltage', $device, $current_oid, $index, 'powerlogic', $descr, 1, 1, null, null, null, null, $current);
}
if (is_numeric($data['vVcn'][1])) {
$current_oid = '.1.3.6.1.4.1.3833.1.7.255.15.1.1.5.1.8.1';
$index = 'vVcn';
$descr = 'Line C to neutral';
$current = $data['vVcn'][1];
discover_sensor($valid['sensor'], 'voltage', $device, $current_oid, $index, 'powerlogic', $descr, 1, 1, null, null, null, null, $current);
}
unset($data);

View File

@ -0,0 +1,30 @@
<?php
/**
* powerlogic.inc.php
*
* LibreNMS OS poller module for Schneider PowerLogic
*
* 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 <neil@lathwood.co.uk>
*/
$data = snmp_get_multi_oid($device, 'midSerialNumber.1 midFirmwareVersion.1 midModelNumber.1 midDeviceName.1', '-OQs', 'PM8ECCMIB');
$serial = trim($data['midSerialNumber.1'], '"');
$version = trim($data['midFirmwareVersion.1'], '"');
$hardware = trim($data['midDeviceName.1'], '"');
unset($data);

1365
mibs/schneider/PM8ECCMIB Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,2 @@
1.3.6.1.2.1.1.1.0|4|Schneider Electric - PM850SD
1.3.6.1.2.1.1.2.0|6|.1.3.6.1.4.1.3833.1.7.255.15