NetXMS-Template for monitoring MikroTik interfaces

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}
1-bpsifin

toreturn = $1 * 8;
if (toreturn > 50000000000)
   return 1;
return toreturn;

1-bpsifin-transformation

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);
	}

1-bpsifin-discovery

Interface Outbound traffic

Description:BPS_IfOutbound_{instance-name}
Parameter:.1.3.6.1.2.1.31.1.1.1.10.{instance}
2-bpsifout

toreturn = $1 * 8;
if (toreturn > 50000000000)
   return 1;
return toreturn;

2-bpsifout-transformation

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);
	}

2-bpsifout-discovery

Interface Inbound PPS

Description:PPS_IfInbound_{instance-name}
Parameter:.1.3.6.1.2.1.31.1.1.1.7.{instance}
3-ppsifin

toreturn = $1;
if (toreturn > 50000000000)
   return 1;
return toreturn;

3-ppsifin-transformation

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);
	}

3-pps-ifindiscovery

Interface Outbound PPS

Description:PPS_IfOutbound_{instance-name}
Parameter:.1.3.6.1.2.1.31.1.1.1.11.{instance}
4-ppsifout

toreturn = $1;
if (toreturn > 50000000000)
   return 1;
return toreturn;

4-ppsifout-transformation

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);
	}

4-ppsifout-discovery

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.
5-before

...
if (toreturn > 50000000000)
   return 1;
return toreturn;

5-after

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")));

Presentation

Jedna uwaga do wpisu “NetXMS-Template for monitoring MikroTik interfaces

Dodaj komentarz