Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New OS: Support for Glass Way EYDFA WDM Optical Amplifier #9125

Merged
merged 29 commits into from
Oct 12, 2018
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
5b02d6a
New OS: Glass Way EYDFA WDM
TheGreatDoc Aug 31, 2018
42a8d89
OS and Power Supply State discovery
TheGreatDoc Sep 1, 2018
2d4a55d
Added OS discovery file
TheGreatDoc Sep 1, 2018
3dbc2df
Added MIB files
TheGreatDoc Sep 1, 2018
105389a
Fixed EOF new line
TheGreatDoc Sep 1, 2018
5dd879f
Test data & Minor formatting fixes
TheGreatDoc Sep 1, 2018
e7423e0
Minor formatting fixes
TheGreatDoc Sep 1, 2018
ff1de70
Changed multiplier/divisor to be 1 instead null
TheGreatDoc Sep 1, 2018
d9625c4
Fixed mib_dir, multi get for OS, mult/div ints instead of strings
TheGreatDoc Sep 2, 2018
a7e7f8e
Added is_numeric() check to limits
TheGreatDoc Sep 20, 2018
357ad15
Changed sensors $index + Insert $value divided by $divisor on discovery
TheGreatDoc Sep 21, 2018
0740fab
New OS: Glass Way EYDFA WDM
TheGreatDoc Aug 31, 2018
6d60ec8
OS and Power Supply State discovery
TheGreatDoc Sep 1, 2018
2523406
Added OS discovery file
TheGreatDoc Sep 1, 2018
a5b77a2
Added MIB files
TheGreatDoc Sep 1, 2018
75c07c9
Fixed EOF new line
TheGreatDoc Sep 1, 2018
f6fa16a
Test data & Minor formatting fixes
TheGreatDoc Sep 1, 2018
d7c1a2c
Minor formatting fixes
TheGreatDoc Sep 1, 2018
05585a4
Changed multiplier/divisor to be 1 instead null
TheGreatDoc Sep 1, 2018
6418abb
Fixed mib_dir, multi get for OS, mult/div ints instead of strings
TheGreatDoc Sep 2, 2018
3a87fe9
Added is_numeric() check to limits
TheGreatDoc Sep 20, 2018
4c5b86c
Changed sensors $index + Insert $value divided by $divisor on discovery
TheGreatDoc Sep 21, 2018
a890315
test files
TheGreatDoc Sep 22, 2018
37f1722
Merge branch 'gw-eydfa' of https://github.com/TheGreatDoc/librenms in…
TheGreatDoc Sep 22, 2018
91e4c3f
Merge branch 'master' of github.com:librenms/librenms into gw-eydfa
laf Sep 22, 2018
4a60c38
Test files...
TheGreatDoc Sep 23, 2018
7666c26
Merge branch 'gw-eydfa' of https://github.com/TheGreatDoc/librenms in…
TheGreatDoc Sep 23, 2018
c7732e4
Update glassway.svg
laf Sep 24, 2018
78a36e5
Forgit this. Sorry
TheGreatDoc Oct 8, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
92 changes: 92 additions & 0 deletions html/images/os/glassway.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
79 changes: 79 additions & 0 deletions includes/definitions/gw-eydfa.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
os: gw-eydfa
laf marked this conversation as resolved.
Show resolved Hide resolved
text: 'Glass Way WDM EYDFA'
type: network
icon: glassway
over:
- { graph: device_temperature, text: 'Temperatures' }
- { graph: device_dbm, text: 'Optics' }
mib_dir:
- gw-eydfa
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change the mib dir to glassway

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll do! 👌

discovery:
- sysObjectID:
- .1.3.6.1.4.1.17409.1.11
poller_modules:
cisco-ace-serverfarms: false
cisco-ace-loadbalancer: false
applications: false
aruba-controller: false
bgp-peers: false
cipsec-tunnels: false
cisco-asa-firewall: false
cisco-cbqos: false
cisco-cef: false
cisco-ipsec-flow-monitor: false
cisco-mac-accounting: false
cisco-otv: false
cisco-remote-access-monitor: false
cisco-sla: false
cisco-voice: false
cisco-vpdn: false
entity-physical: false
entity-state: false
hr-mib: false
ipSystemStats: false
ipmi: false
junose-atm-vp: false
loadbalancers: false
mef: false
mempools: false
mib: false
netscaler-vsvr: false
netstats: false
ntp: false
ospf: false
ports: false
processors: false
storage: false
stp: false
toner: false
ucd-diskio: false
ucd-mib: false
unix-agent: false
wifi: false
wireless: false
discovery_modules:
cisco-cef: false
cisco-sla: false
cisco-mac-accounting: false
ports: false
ports-stack: false
entity-physical: false
processors: false
mempools: false
cisco-vrf-lite: false
ipv4-addresses: false
ipv6-addresses: false
storage: false
hr-device: false
discovery-protocols: false
arp-table: false
discovery-arp: false
junose-atm-vp: false
bgp-peers: false
vlans: false
ucd-diskio: false
services: false
stp: false
ntp: false
wireless: false
fdb-table: false
4 changes: 4 additions & 0 deletions includes/discovery/sensors.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@
include 'includes/discovery/sensors/state/hp.inc.php';
}

if ($device['os'] == 'gw-eydfa') {
include 'includes/discovery/sensors/gw-eydfa.inc.php';
}

$run_sensors = array(
'airflow',
'current',
Expand Down
163 changes: 163 additions & 0 deletions includes/discovery/sensors/gw-eydfa.inc.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
<?php
laf marked this conversation as resolved.
Show resolved Hide resolved
/**
* gw-eydfa.inc.php
*
* LibreNMS temperature discovery module for Glass Way WDM EYDFA Optical Amplifier
*
* 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 2018 TheGreatDoc
* @author TheGreatDoc
*/

$oids = snmp_walk($device, 'oaPumpTable', '-Osq', 'NSCRTV-HFCEMS-OPTICALAMPLIFIER-MIB');
d_echo($oids."\n");

if ($oids) {
echo 'GW EYDFA PUMP ';
}

laf marked this conversation as resolved.
Show resolved Hide resolved
foreach (explode("\n", $oids) as $data) {
list($oid, $value) = explode(' ', $data);
$split_oid = explode('.', $oid);
$index = $split_oid[1];
// Check for sensor type
if ($split_oid[0] == "oaPumpBIAS") { // Current - mA
$divisor = 1000;
$descr = 'BIAS Pump - ' . $index;
$num_oid = '.1.3.6.1.4.1.17409.1.11.4.1.2.' . $index;
$low_limit = snmp_get($device, 'analogAlarmLOLO.13' . $num_oid, '-Ovq', 'NSCRTV-HFCEMS-PROPERTY-MIB') / 1000;
$low_warn = snmp_get($device, 'analogAlarmLO.13' . $num_oid, '-Ovq', 'NSCRTV-HFCEMS-PROPERTY-MIB') / 1000;
$high_warn = snmp_get($device, 'analogAlarmHI.13' . $num_oid, '-Ovq', 'NSCRTV-HFCEMS-PROPERTY-MIB') / 1000;
$high_limit = snmp_get($device, 'analogAlarmHIHI.13' . $num_oid, '-Ovq', 'NSCRTV-HFCEMS-PROPERTY-MIB') / 1000;
$sensor_index = str_replace(' ', '', $descr);
discover_sensor($valid['sensor'], 'current', $device, $num_oid, $sensor_index, 'gw-eydfa', $descr, $divisor, '1', $low_limit, $low_warn, $high_warn, $high_limit, $value);
}
if ($split_oid[0] == "oaPumpTEC" && $index = 1) { // Current - A
$divisor = 100;
$descr = 'TEC Pump - ' . $index;
$num_oid = '.1.3.6.1.4.1.17409.1.11.4.1.3.' . $index;
$low_limit = snmp_get($device, 'analogAlarmLOLO.13' . $num_oid, '-Ovq', 'NSCRTV-HFCEMS-PROPERTY-MIB') / 100;
$low_warn = snmp_get($device, 'analogAlarmLO.13' . $num_oid, '-Ovq', 'NSCRTV-HFCEMS-PROPERTY-MIB') / 100;
$high_warn = snmp_get($device, 'analogAlarmHI.13' . $num_oid, '-Ovq', 'NSCRTV-HFCEMS-PROPERTY-MIB') / 100;
$high_limit = snmp_get($device, 'analogAlarmHIHI.13' . $num_oid, '-Ovq', 'NSCRTV-HFCEMS-PROPERTY-MIB') / 100;
$sensor_index = str_replace(' ', '', $descr);
discover_sensor($valid['sensor'], 'current', $device, $num_oid, $sensor_index, 'gw-eydfa', $descr, $divisor, '1', $low_limit, $low_warn, $high_warn, $high_limit, $value);
}
if ($split_oid[0] == "oaPumpTemp" && $index = 1) { // Temperature - C
$divisor = 10;
$descr = 'Temperature Pump - ' . $index;
$num_oid = '.1.3.6.1.4.1.17409.1.11.4.1.4.' . $index;
$low_limit = snmp_get($device, 'analogAlarmLOLO.13' . $num_oid, '-Ovq', 'NSCRTV-HFCEMS-PROPERTY-MIB') / 10;
$low_warn = snmp_get($device, 'analogAlarmLO.13' . $num_oid, '-Ovq', 'NSCRTV-HFCEMS-PROPERTY-MIB') / 10;
$high_warn = snmp_get($device, 'analogAlarmHI.13' . $num_oid, '-Ovq', 'NSCRTV-HFCEMS-PROPERTY-MIB') / 10;
$high_limit = snmp_get($device, 'analogAlarmHIHI.13' . $num_oid, '-Ovq', 'NSCRTV-HFCEMS-PROPERTY-MIB') / 10;
$sensor_index = str_replace(' ', '', $descr);
discover_sensor($valid['sensor'], 'temperature', $device, $num_oid, $sensor_index, 'gw-eydfa', $descr, $divisor, '1', $low_limit, $low_warn, $high_warn, $high_limit, $value);
}
unset($oids, $split_oid, $index, $divisor, $descr, $low_limit, $low_warn, $high_warn, $sensor_index);
}



$oids = snmp_walk($device, 'oaDCPowerTable', '-Osq', 'NSCRTV-HFCEMS-OPTICALAMPLIFIER-MIB');
d_echo($oids."\n");

if ($oids) {
echo 'GW EYDFA DC POWER ';
}

foreach (explode("\n", $oids) as $data) {
list($oid, $value) = explode(' ', $data);
$split_oid = explode('.', $oid);
$index = $split_oid[1];
// Check for sensor type
if ($split_oid[0] == "oaDCPowerVoltage") { // Voltage - V
$divisor = 10;
$descr = 'DC +5V - ' . $index;
$num_oid = '.1.3.6.1.4.1.17409.1.11.7.1.2.' . $index;
$low_limit = snmp_get($device, 'analogAlarmLOLO.13' . $num_oid, '-Ovq', 'NSCRTV-HFCEMS-PROPERTY-MIB') / 10;
$low_warn = snmp_get($device, 'analogAlarmLO.13' . $num_oid, '-Ovq', 'NSCRTV-HFCEMS-PROPERTY-MIB') / 10;
$high_warn = snmp_get($device, 'analogAlarmHI.13' . $num_oid, '-Ovq', 'NSCRTV-HFCEMS-PROPERTY-MIB') / 10;
$high_limit = snmp_get($device, 'analogAlarmHIHI.13' . $num_oid, '-Ovq', 'NSCRTV-HFCEMS-PROPERTY-MIB') / 10;
$sensor_index = str_replace(' ', '', $descr);
discover_sensor($valid['sensor'], 'voltage', $device, $num_oid, $sensor_index, 'gw-eydfa', $descr, $divisor, '1', $low_limit, $low_warn, $high_warn, $high_limit, $value);
}
}

unset($oids, $split_oid, $index, $divisor, $descr, $low_limit, $low_warn, $high_warn, $sensor_index);

// Internal Temperature
$num_oid = '.1.3.6.1.4.1.17409.1.3.3.2.2.1.12.1';
$value = snmp_get($device, 'commonDeviceInternalTemperature.1', '-Ovq', 'NSCRTV-HFCEMS-COMMON-MIB');
$descr = 'Internal Temp';
$low_limit = snmp_get($device, 'analogAlarmLOLO.12.1.3.6.1.4.1.17409.1.3.1.13.0', '-Ovq', 'NSCRTV-HFCEMS-PROPERTY-MIB');
$low_warn = snmp_get($device, 'analogAlarmLO.12.1.3.6.1.4.1.17409.1.3.1.13.0', '-Ovq', 'NSCRTV-HFCEMS-PROPERTY-MIB');
$high_warn = snmp_get($device, 'analogAlarmHI.12.1.3.6.1.4.1.17409.1.3.1.13.0', '-Ovq', 'NSCRTV-HFCEMS-PROPERTY-MIB');
$high_limit = snmp_get($device, 'analogAlarmHIHI.12.1.3.6.1.4.1.17409.1.3.1.13.0', '-Ovq', 'NSCRTV-HFCEMS-PROPERTY-MIB');
$sensor_index = str_replace(' ', '', $descr);
discover_sensor($valid['sensor'], 'temperature', $device, $num_oid, $sensor_index, 'gw-eydfa', $descr, '1', '1', $low_limit, $low_warn, $high_warn, $high_limit, $value);

unset($num_oid, $value, $descr, $low_limit, $low_warn, $high_warn, $sensor_index);

// Per Output Optical Power
$num_oid = '.1.3.6.1.4.1.17409.1.11.2.0';
$value = snmp_get($device, 'oaOutputOpticalPower.0', '-Ovq', 'NSCRTV-HFCEMS-OPTICALAMPLIFIER-MIB');
$divisor = 10;
$descr = 'Per Output Power';
$low_limit = snmp_get($device, 'analogAlarmLOLO.11' . $num_oid, '-Ovq', 'NSCRTV-HFCEMS-PROPERTY-MIB') / 10;
$low_warn = snmp_get($device, 'analogAlarmLO.11' . $num_oid, '-Ovq', 'NSCRTV-HFCEMS-PROPERTY-MIB') / 10;
$high_warn = snmp_get($device, 'analogAlarmHI.11' . $num_oid, '-Ovq', 'NSCRTV-HFCEMS-PROPERTY-MIB') / 10;
$high_limit = snmp_get($device, 'analogAlarmHIHI.11' . $num_oid, '-Ovq', 'NSCRTV-HFCEMS-PROPERTY-MIB') / 10;
$sensor_index = str_replace(' ', '', $descr);
discover_sensor($valid['sensor'], 'dbm', $device, $num_oid, $sensor_index, 'gw-eydfa', $descr, $divisor, '1', $low_limit, $low_warn, $high_warn, $high_limit, $value);

unset($num_oid, $value, $divisor, $descr, $low_limit, $low_warn, $high_warn, $sensor_index);

// Input Optical Power
$num_oid = '.1.3.6.1.4.1.17409.1.11.3.0';
$value = snmp_get($device, 'oaInputOpticalPower.0', '-Ovq', 'NSCRTV-HFCEMS-OPTICALAMPLIFIER-MIB');
$divisor = 10;
$descr = 'Input Power';
$low_limit = snmp_get($device, 'analogAlarmLOLO.11' . $num_oid, '-Ovq', 'NSCRTV-HFCEMS-PROPERTY-MIB') / 10;
$low_warn = snmp_get($device, 'analogAlarmLO.11' . $num_oid, '-Ovq', 'NSCRTV-HFCEMS-PROPERTY-MIB') / 10;
$high_warn = snmp_get($device, 'analogAlarmHI.11' . $num_oid, '-Ovq', 'NSCRTV-HFCEMS-PROPERTY-MIB') / 10;
$high_limit = snmp_get($device, 'analogAlarmHIHI.11' . $num_oid, '-Ovq', 'NSCRTV-HFCEMS-PROPERTY-MIB') / 10;
$sensor_index = str_replace(' ', '', $descr);
discover_sensor($valid['sensor'], 'dbm', $device, $num_oid, $sensor_index, 'gw-eydfa', $descr, $divisor, '1', $low_limit, $low_warn, $high_warn, $high_limit, $value);

unset($num_oid, $value, $divisor, $descr, $low_limit, $low_warn, $high_warn, $sensor_index);

// Power Supply State

$oids = array('.1.3.6.1.4.1.17409.1.1.2.1.4.11.1.3.6.1.4.1.17409.1.11.100.0.2', '.1.3.6.1.4.1.17409.1.1.2.1.4.11.1.3.6.1.4.1.17409.1.11.101.0.2');

$state_name = 'PowerSupplyState';
$states = array(
array('value' => 1, 'generic' => 0, 'graph' => 0, 'descr' => 'normal'),
array('value' => 7, 'generic' => 1, 'graph' => 0, 'descr' => 'warning'),
array('value' => 6, 'generic' => 2, 'graph' => 0, 'descr' => 'critical'),
);
create_state_index($state_name, $states);
$n = 1;
foreach ($oids as $oid) {
$value = snmp_get($device, $oid, '-Ovq', 'NSCRTV-HFCEMS-PROPERTY-MIB');
$descr = 'Power Supply ' . $n;
$sensor_index = str_replace(' ', '', $descr);
discover_sensor($valid['sensor'], 'state', $device, $oid, $sensor_index, $state_name, $descr, '1', '1', null, null, null, null, $value, 'snmp');
create_sensor_to_state_index($device, $state_name, $sensor_index);
$n++;
}
27 changes: 27 additions & 0 deletions includes/polling/os/gw-eydfa.inc.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php
/**
* gw-eydfa.inc.php
*
* LibreNMS OS poller module for Glass Way WDM EYDFA Optical Amplifier
*
* 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 2018 TheGreatDoc
* @author TheGreatDoc
*/

$hardware = snmp_get($device, ".1.3.6.1.4.1.17409.1.3.3.2.2.1.4.1", "-OQv");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you not have the OID names to use here? Also needs converting to multi gets.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. I dont know why I used numeric.

$serial = snmp_get($device, ".1.3.6.1.4.1.17409.1.3.3.2.2.1.5.1", "-OQv");
Loading