-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Add basic support for MRV OptiDriver Optical Transport Platform #6656
Changes from 1 commit
b57c201
7dd1320
e9f156f
3b71f63
287ac95
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
os: mrv-optidriver | ||
group: mrv | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do you need this? It's designed to bring a number of OS' together so polling can be done centrally. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If it is removed, add:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @laf I based that off of the pre-existing There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's only needed if they share the same code which they don't appear to. |
||
text: 'MRV OptiDriver' | ||
type: network | ||
icon: mrv | ||
discovery: | ||
- sysObjectId: | ||
- .1.3.6.1.4.1.629.200.1.1.1. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You might be able to change this to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The 1.1.1 is what's showing in the full snmpget of sysObjectID.
Still want it shorted? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looking at our stats, nothing else uses it so yes it should be ok to be shortened. |
||
- sysDescr: | ||
- 'OD-NM OD' |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
<?php | ||
|
||
/* | ||
* LibreNMS Interface Power dBm module for the MRV® OptiDriver® Optical Transport Platform | ||
* | ||
* © 2017 Chris A. Evans <thecityofguanyu@outlook.com> | ||
* | ||
* 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. Please see LICENSE.txt at the top level of | ||
* the source code distribution for details. | ||
*/ | ||
|
||
echo 'MRV OptiDriver '; | ||
|
||
$multiplier = 1; | ||
$divisor = 1000; | ||
$limit_low = -100; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are these limits sane? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Multiplier and divisor are right, but those limits are definitely not sane. I'll see if I can find some documentation to set those accordingly. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You can set them to null and we will calculate some values. |
||
$warn_limit_low = -100; | ||
$limit = 100; | ||
$warn_limit = 100; | ||
|
||
foreach ($pre_cache['mrv-optidriver_oids'] as $index => $entry) { | ||
$oid = '.1.3.6.1.4.1.629.200.8.1.1.32.' . $index; | ||
$descr = dbFetchCell('SELECT `ifDescr` FROM `ports` WHERE `ifName`= ? AND `device_id` = ?', array($index, $device['device_id'])) . ' Rx Power'; | ||
$currentrx = $entry['nbsCmmcPortRxPower']; | ||
discover_sensor( | ||
$valid['sensor'], | ||
'dbm', | ||
$device, | ||
$oid, | ||
'rx-' . $index, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. probably better to do |
||
'mrv-optidriver', | ||
$descr, | ||
$divisor, | ||
$multiplier, | ||
$limit_low, | ||
$warn_limit_low, | ||
$warn_limit, | ||
$limit, | ||
$currentrx, | ||
'snmp' | ||
); | ||
} | ||
|
||
foreach ($pre_cache['mrv-optidriver_oids'] as $index => $entry) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You're already looping through this array above, you can probably do an if / elseif check to decide which value you want and consolidate the code down a bit. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is there a similar existing file using an if / elif in this manner that I could reference? I'm struggle to figure out what the conditional would be. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
$oid = '.1.3.6.1.4.1.629.200.8.1.1.31.' . $index; | ||
$descr = dbFetchCell('SELECT `ifDescr` FROM `ports` WHERE `ifName`= ? AND `device_id` = ?', array($index, $device['device_id'])) . ' Tx Power'; | ||
$currenttx = $entry['nbsCmmcPortTxPower']; | ||
discover_sensor( | ||
$valid['sensor'], | ||
'dbm', | ||
$device, | ||
$oid, | ||
'tx-' . $index, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. probably better to do 'nbsCmmcPortTxPower.'.$index, |
||
'mrv-optidriver', | ||
$descr, | ||
$divisor, | ||
$multiplier, | ||
$limit_low, | ||
$warn_limit_low, | ||
$warn_limit, | ||
$limit, | ||
$currenttx, | ||
'snmp' | ||
); | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?php | ||
|
||
/* | ||
* LibreNMS Sensor pre-cache module for the MRV® OptiDriver® Optical Transport Platform | ||
* | ||
* © 2017 Chris A. Evans <thecityofguanyu@outlook.com> | ||
* | ||
* 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. Please see LICENSE.txt at the top level of | ||
* the source code distribution for details. | ||
*/ | ||
|
||
echo 'nbsCmmcPortTable '; | ||
$pre_cache['mrv-optidriver_oids'] = snmpwalk_cache_multi_oid($device, 'nbsCmmcPortTable', array(), 'NBS-CMMC-MIB'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this the best os name?