Ciena Adding Sensors

I want to add a couple of MIBs for Cienas and have LibreNMS graph XCVR signal, temp, and high/low thresholds but I am afraid I am not understanding how to do this. Here is a collection of the data I have, can someone direct me to how to process this? (I have zero experience with git, so I ask for some low level instructions.)

I’m guessing these are the OIDs I need to learn how to add:
- wwpLeosPortXcvrTemperature
- wwpLeosPortXcvrRxDbmPower
- wwpLeosPortXcvrTxDbmPower
- wwpLeosPortXcvrHighTxDbmPwAlarmThreshold
- wwpLeosPortXcvrLowTxDbmPwAlarmThreshold
- wwpLeosPortXcvrHighRxDbmPwAlarmThreshold
- wwpLeosPortXcvrLowRxDbmPwAlarmThreshold

I’ve copied the below MIBs to /opt/librenms/mibs/ciena and when I run snmpwalk the seem to work.
CIENA-WWP-SMI https://pastebin.com/raw/zTaR02E3
CIENA-WWP-LEOS-PORT-XCVR-MIB https://pastebin.com/raw/wUd9GTXg

Looking at other requests, these seemed to help:
-bash-4.2$ ./discovery.php -h HOSTNAME -d | ./pbin.sh
https://p.libren.ms/view/090f4adc

-bash-4.2$ ./poller.php -h HOSTNAME -r -f -d | ./pbin.sh
https://p.libren.ms/view/c008c75e

-bash-4.2$ snmpbulkwalk -OUneb -v2c -c COMMUNITY HOSTNAME . | ./pbin.sh
https://p.libren.ms/view/92804c4b

-bash-4.2$ snmpwalk -M /usr/share/snmp/mibs:/opt/librenms/mibs/:/opt/librenms/mibs/ciena/ -m all -v2c -c COMMUNITY HOSTNAME 1.3.6.1.4.1.6141.2.60.4.1.1.1.1 | ./pbin.sh
https://p.libren.ms/view/e5266057

I think I have figured out most of it. Below is the YAML file I have created and it appears to be building the graphs I am looking for (with the MIBs put into the Ciena folder).
I suspect I might not have the correct “oid: wwpLeosPortXcvrTable” in the data section because when I run the “Discover” Capture/debug took, I see it walks the entire table. That seems unecessary since I just need the data points listed. Should I replace that with what I have in the “value:” field? Or am I second guessing myself too much?

One issue I am trying to troubleshoot is some devices give temp and RX graphs, but not TX graphs. While looking into that, I found the poll of the entire table and thought I should ask if there was a way to tighten up the polling.

more ./includes/definitions/discovery/ciena-sds.yaml
mib: WWP-LEOS-PORT-XCVR-MIB
modules:
    sensors:
        pre-cache:
            data:
                - oid:
                    - wwpLeosPortXcvrHighTempAlarmThreshold
                    - wwpLeosPortXcvrLowTempAlarmThreshold
                    - wwpLeosPortXcvrSerialNum
 #                   - wwpLeosPortXcvrId
                    - wwpLeosPortXcvrHighTempAlarmThreshold
                    - wwpLeosPortXcvrLowRxDbmPwAlarmThreshold
                    - wwpLeosPortXcvrHighRxDbmPwAlarmThreshold
                    - wwpLeosPortXcvrLowTxDbmPwAlarmThreshold
                    - wwpLeosPortXcvrHighTxDbmPwAlarmThreshold
        dbm:
            data:
                -
                    oid: wwpLeosPortXcvrTable
                    value: wwpLeosPortXcvrRxDbmPower
                    num_oid: '.1.3.6.1.4.1.6141.2.60.4.1.1.1.1.105.{{ $index }}'
                    descr: 'RX Pwr Port {{ $index }} - Optic SN: {{ $wwpLeosPortXcvrSerialNum }}'
                    divisor: 10000
                    index: wwpLeosPortXcvrRxDbmPower.{{ $index }}'
                    group: 'RX dBm'
                    low_limit: wwpLeosPortXcvrLowRxDbmPwAlarmThreshold
                    high_limit: wwpLeosPortXcvrHighRxDbmPwAlarmThreshold
                    skip_values:
                        -
                            oid: wwpLeosPortXcvrHighRxDbmPwAlarmThreshold
                            op: '>='
                            value: 0
                -
                    oid: wwpLeosPortXcvrTable
                    value: wwpLeosPortXcvrTxDbmPower
                    num_oid: '.1.3.6.1.4.1.6141.2.60.4.1.1.1.1.106.{{ $index }}'
                    descr: 'TX Pwr Port {{ $index }} - Optic SN: {{ $wwpLeosPortXcvrSerialNum }}'
                    divisor: 10000
                    index: wwpLeosPortXcvrTxDbmPower.{{ $index }}'
                    group: 'TX dBm'
                    low_limit: wwpLeosPortXcvrLowTxDbmPwAlarmThreshold
                    high_limit: wwpLeosPortXcvrHighTxDbmPwAlarmThreshold
                    skip_values:
                        -
                            oid: wwpLeosPortXcvrHighTxDbmPwAlarmThreshold
                            op: '>='
                            value:  0
        temperature:
            data:
                -
                    oid: wwpLeosPortXcvrTable
                    value: wwpLeosPortXcvrTemperature
                    num_oid: '.1.3.6.1.4.1.6141.2.60.4.1.1.1.1.16.{{ $index }}'
                    descr: 'Port {{ $subindex0 }} - Optic SN: {{ $wwpLeosPortXcvrSerialNum }}'
                    index: wwpLeosPortXcvrTemperature.{{ $index }}'
                    group: 'Ports'
                    low_limit: wwpLeosPortXcvrLowTempAlarmThreshold
                    high_limit: wwpLeosPortXcvrHighTempAlarmThreshold
                    skip_values:
                        -
                            oid: wwpLeosPortXcvrHighTempAlarmThreshold
                            op: '<='
                            value: 0

You can keep the Table in oid and the value in value. Any other oid in the Table is automatically available (so you don’t need to explicitely pre-cache any other element of the Table).

One you have fine-tuned your yaml file, please submit it as a PR :slight_smile:

I found this morning’s update contained an update that my SDS devices don’t like. I’ve PM’d Dan asking if the device he was testing for was an SDS (Service Delivery Switch), because he uses different MIBs that don’t generate graphs on the SDS’s I was building graphs for. When I poll an SDS and a 5171 that I think he said he was polling, I get different descriptions:
RFC1213-MIB::sysDescr.0 = STRING: “5171 Packetwave Platform”
RFC1213-MIB::sysDescr.0 = STRING: “3916 Service Delivery Switch”

It’s mostly just an efficiency thing… If they are the same class of devices, then yeah look for all the OIDs. But knowing not to look for CES OIDs on an SDS device (and vice versa) would keep discovery polls down.

Assuming we both need our changes in the same file, I will try to get similar data points that he got and get them to co-exist in the same file.

It’s not complete, but here is what I have so far. (And have figured out how to get onto github.)
Just temperture and Rx/Tx dbm for optics. I have the optic serial tied into the graph name, which I am not sure if it is useful or just me just trying to be clever. I think I have the MIB added so I can pull out CPU, Memory, and maybe power, but haven’t tested any of that yet.
But I keep getting pulled to other priorities, so I figured I’d record at least what I have working. I welcome any suggestions.
I am adding onto the changes @Dan_Baker submitted a few weeks ago.

I am adding CPU Utilization to my graphs and ran into an issue where the Ciena has metrics for 5,10, and 60 seconds. So I added them all and I was getting them graphed twice. It looks like the processor table in the database has an index column as a VARCHAR(32) but my indexes were just a little bigger than that. So I bumped it up in my install. (ALTER TABLE processors MODIFY processor_index VARCHAR(50); )

This started giving me each graph once.
So I am wondering how I would submit a database alteration?