SFP signal threshold monitoring

Started by Egert143, June 11, 2021, 03:18:08 PM

Previous topic - Next topic

Egert143

Hello

Does anyone have good suggestions how to monitor SFP module TX/RX values. Well i am collecting them but what would be good strategy to alert on "bad" value? For example i have 48 port optical switch, almost all SFP modules report different values and there is no good threshold value that suits all. Idealy i would like to set alerting based on signal level that was observed when link was established. But with auto discovery its impossible to set those values.

I am interested in detecting events when signal is degrading over time, for example if signal has changed alot over 2-3 days for example.

Egert

Filipp Sudanov

Several options:
1) Script threshold. In that script you can use GetDCIValues() to get values for some period, e.g. 10 minutes 1 or 2 days ago. Get average for that period and compare it with the current. It's possible that there were collection issues and GetDCIValues() will not return anything - script should check for that.

2) Get some baseline initially and store it in a custom attribute. The custom attribute name should be like signal_level::GigabitEthernet1/0/1 - so some text::instance name.
The value can be stored in transformation script by checking if such custom attribute exists.

Then in the threshold you can use %{custom_attribute:default_value} macro. This macro has a special behavior (not yet documented) - first of all it will try to find custom attribute named "custom_attribute::instance", where instance is the instance name from DCI properties.
If not found, it will try custom attribute with "custom_attribute" name, if that is not found, will take the default_value, if it's given.

Egert143

#2
Thanks for the reply, i tried option nr2. When custom attribute is defined for min and max value and two thresholds set for upper and lower limit it works good. But on instance where custom attribute is not set it will generate alert on default value. How can i not set default value. So only alert if custom instance attribute is defined.

so far i have tried:
%{signal_min:0}
%{signal_min:NULL}
%{signal_min:}
%{signal_min}

Custom atribute:
signal_min::Ethernet1/17 Lane 1 Transceiver Transmit Power Sensor

Egert

Filipp Sudanov

I'd probably just use some big number for default value like %{signal_min:999999999}
Also you can use hook scripts to add some default value for custom attribute on node creation or configuration poll if attribute is not present yet.

Egert143

yesh, big numbers solution worked, sometimes it the simple things that work but one does not think about them. :)

May i also ask what script would loop throught all dcis in given node, so i could retrive min and max values for last week and set custom attributes if not already set?

dci examples

Signal - Ethernet1/1 Lane 1 Transceiver Receive Power Sensor
Signal - Ethernet1/1 Lane 1 Transceiver Transmit Power Sensor
Signal - Ethernet1/2 Lane 1 Transceiver Receive Power Sensor
Signal - Ethernet1/2 Lane 1 Transceiver Transmit Power Sensor

Victor Kirhenshtein

Hi,

you can use script like this:

for(d : FindAllDCIs($node, null, "Signal - * Transceiver Receive Power Sensor"))
{
   value = GetDCIValue($node, d->id);
   if (vmin == null or vmin > value)
      vmin = value;
   if (vmax == null or vmax < value)
      vmax = value;
}
// Here vmin and vmax variables contains min and max values for matching DCIs


Best regards,
Victor

Egert143