Basic OIDS used for instance discovery
IfIndex:.1.3.6.1.2.1.2.2.1.1(used as base OID to iterate over all interfaces present in MT device)
IfName:.1.3.6.1.2.1.31.1.1.1.1.(used for get instance-name)
IfType:.1.3.6.1.2.1.2.2.1.3.(6 is Ethernet in MT)
Common instance discovery and transformation settings
Instance discovery method:SNMP Walk-Values
Base SNMP OID: .1.3.6.1.2.1.2.2.1.1
Delta calculation:Average delta per second
Interface Inbound traffic
Description:BPS_IfInbound_{instance-name}
Parameter:.1.3.6.1.2.1.31.1.1.1.6.{instance}
toreturn = $1 * 8; if (toreturn > 50000000000) return 1; return toreturn;
transport = CreateSNMPTransport($node); if (transport == null) return false; ifName = SNMPGet(transport, ".1.3.6.1.2.1.31.1.1.1.1." . $1); if (ifName == null) return false; ifType = SNMPGet(transport, ".1.3.6.1.2.1.2.2.1.3." . $1); if (ifType == null) return false; if (ifType->value == 6) { return %(true, $1, ifName->value); }
Interface Outbound traffic
Description:BPS_IfOutbound_{instance-name}
Parameter:.1.3.6.1.2.1.31.1.1.1.10.{instance}
toreturn = $1 * 8; if (toreturn > 50000000000) return 1; return toreturn;
transport = CreateSNMPTransport($node); if (transport == null) return false; ifName = SNMPGet(transport, ".1.3.6.1.2.1.31.1.1.1.1." . $1); if (ifName == null) return false; ifType = SNMPGet(transport, ".1.3.6.1.2.1.2.2.1.3." . $1); if (ifType == null) return false; if (ifType->value == 6) { return %(true, $1, ifName->value); }
Interface Inbound PPS
Description:PPS_IfInbound_{instance-name}
Parameter:.1.3.6.1.2.1.31.1.1.1.7.{instance}
toreturn = $1; if (toreturn > 50000000000) return 1; return toreturn;
transport = CreateSNMPTransport($node); if (transport == null) return false; ifName = SNMPGet(transport, ".1.3.6.1.2.1.31.1.1.1.1." . $1); if (ifName == null) return false; ifType = SNMPGet(transport, ".1.3.6.1.2.1.2.2.1.3." . $1); if (ifType == null) return false; if (ifType->value == 6) { return %(true, $1, ifName->value); }
Interface Outbound PPS
Description:PPS_IfOutbound_{instance-name}
Parameter:.1.3.6.1.2.1.31.1.1.1.11.{instance}
toreturn = $1; if (toreturn > 50000000000) return 1; return toreturn;
transport = CreateSNMPTransport($node); if (transport == null) return false; ifName = SNMPGet(transport, ".1.3.6.1.2.1.31.1.1.1.1." . $1); if (ifName == null) return false; ifType = SNMPGet(transport, ".1.3.6.1.2.1.2.2.1.3." . $1); if (ifType == null) return false; if (ifType->value == 6) { return %(true, $1, ifName->value); }
DCI spikes removal
Reboot of router or switch is main cause of spikes in charts.
Code below deals with it. Value is chosed by trial&error.
... if (toreturn > 50000000000) return 1; return toreturn;
Template apply filters
In my case template will be applied to:
-
- RB750’s
- CRS’s
- CCR’s
- RB2011’s
return (($node->driver == "MIKROTIK") && ( ($node->sysDescription ~= "RB750") || ($node->sysDescription ~= "RB2011") || ($node->sysDescription ~= "CCR") || ($node->sysDescription ~= "CRS")));
Znając genezę oraz czas powstania tego rozwiązania, podwójny szacun. 😉
PolubieniePolubienie