NAME
SNMP::Info::Layer3::Mikrotik - SNMP Interface to Mikrotik devices
AUTHORS
Jeroen van Ingen initial version based on SNMP::Info::Layer3::NetSNMP by Bradley Baetz and Bill Fenner
SYNOPSIS
# Let SNMP::Info determine the correct subclass for you.
my $mikrotik = new SNMP::Info(
AutoSpecify => 1,
Debug => 1,
DestHost => 'myrouter',
Community => 'public',
Version => 2
)
or die "Can't connect to DestHost.\n";
my $class = $mikrotik->class();
print "SNMP::Info determined this device to fall under subclass : $class\n";
DESCRIPTION
Subclass for Mikrotik devices
Inherited Classes
Required MIBs
- HOST-RESOURCES-MIB
- MIKROTIK-MIB
- Inherited Classes' MIBs
-
See SNMP::Info::Layer3 for its own MIB requirements.
GLOBALS
These are methods that return scalar value from SNMP
- $mikrotik->vendor()
-
Returns
'mikrotik'. - $mikrotik->os()
-
Returns
'routeros'. - $mikrotik->model()
-
Returns
mtxrBoardName, or else tries to extract the device model fromsysDescr. - $mikrotik->os_ver()
-
Returns the value of
mtxrLicVersion. - $mikrotik->os_level()
-
Returns the value of RouterOS level
mtxrLicLevel - $mikrotik->board_temp()
- $mikrotik->cpu_temp()
-
Returns the board or CPU temperature in degrees Celsius, from the
mtxrHealthscalars or, on RouterOS 7, frommtxrGaugeTable. - $mikrotik->serial()
-
Returns the device serial.
- $mikrotik->firmware()
-
Returns the firmware version of hardware.
- $mikrotik->hasMNDP()
-
Returns 1 when
mtxrNeighborTablehas rows.has_topo()then addsmndp, so thec_*topology methods include those neighbors. - $mikrotik->mac()
-
Returns the LLDP chassis MAC (
lldp_loc_id()).ifPhysAddress.1is the loopback on RouterOS and reads as all zeros; it is used only when there is no LLDP chassis ID. - $mikrotik->mt_board_name()
-
(
mtxrBoardName) - $mikrotik->ps1_status()
- $mikrotik->ps2_status()
-
Returns
okorfailfrommtxrHlPowerSupplyStateormtxrHlBackupPowerSupplyState. Without them, returns thepsu1-stateorpsu2-staterow ofmtxrGaugeTable:ok,fail,not-present,idleorno-input. - $mikrotik->fan()
-
Returns the
fan-staterow ofmtxrGaugeTable(okorfail) and the fan speeds, for exampleok, fan1 3825 rpm, fan2 3945 rpm. Speeds come frommtxrHlFanSpeed1andmtxrHlFanSpeed2, or else thefanN-speedrows ofmtxrGaugeTable. - $mikrotik->mt_psu_state()
-
(
mtxrHlPowerSupplyState) - $mikrotik->mt_backup_psu_state()
-
(
mtxrHlBackupPowerSupplyState) - $mikrotik->mt_fan1_speed()
-
(
mtxrHlFanSpeed1) - $mikrotik->mt_fan2_speed()
-
(
mtxrHlFanSpeed2)
Globals imported from SNMP::Info::Layer3
See documentation in SNMP::Info::Layer3 for details.
TABLE ENTRIES
These are methods that return tables of information in the form of a reference to a hash.
Overrides
- $mikrotik->c_ip()
-
For an LLDP neighbor that advertises no IPv4 management address, returns the address
mtxrNeighborTablehas for the same neighbor (matched on local port and name), for example one learned by CDP. Failing that it returns0.0.0.0, so Netdisco can resolve the neighbor byc_id(). RouterOS advertises only addresses on the sending port or its bridge, not on VLAN interfaces. - $mikrotik->i_vlan_membership()
-
Returns reference to hash of arrays: key =
ifIndex, value = array of VLAN IDs. Uses Q-BRIDGE-MIB when the device exports VLAN tables. RouterOS exports only the port PVID, so each port's PVID is returned instead, except on ports that admit only tagged frames. Tagged VLANs are not available. - $mikrotik->i_vlan_membership_untagged()
-
Returns reference to hash of arrays: key =
ifIndex, value = array of VLAN IDs. Same source and fallback asi_vlan_membership().
MikroTik neighbors (mndp)
mtxrNeighborTable lists neighbors heard by MNDP, CDP and LLDP. These methods return the ones LLDP-MIB does not already report on the same port, and only those with an IPv4 address. They are keyed by mtxrNeighborIndex.
- $mikrotik->mndp_ip()
-
(
mtxrNeighborIpAddress) - $mikrotik->mndp_if()
-
Local
ifIndex(mtxrNeighborInterfaceID). - $mikrotik->mndp_id()
-
Neighbor MAC address (
mtxrNeighborMacAddress). - $mikrotik->mndp_platform()
-
(
mtxrNeighborPlatform) - $mikrotik->mndp_port()
- $mikrotik->mndp_cap()
-
Return an empty hash: the table has no remote port or capabilities.
MikroTik neighbor table (MIKROTIK-MIB::mtxrNeighborTable)
- $mikrotik->mt_nbr_ip()
-
(
mtxrNeighborIpAddress) - $mikrotik->mt_nbr_mac()
-
(
mtxrNeighborMacAddress) - $mikrotik->mt_nbr_identity()
-
(
mtxrNeighborIdentity) - $mikrotik->mt_nbr_platform()
-
(
mtxrNeighborPlatform) - $mikrotik->mt_nbr_if()
-
(
mtxrNeighborInterfaceID)
Gauge Table (mtxrGaugeTable)
Power over Ethernet
When the device has no POWER-ETHERNET-MIB port table, these methods emulate it from mtxrPOETable. Entries are keyed 1.ifIndex.
- $mikrotik->peth_port_ifindex()
-
Maps
1.ifIndextoifIndex, from themtxrPOETableindex. - $mikrotik->peth_port_admin()
-
falsewhenmtxrPOEStatusisdisabled, elsetrue. - $mikrotik->peth_port_status()
-
From
mtxrPOEStatus:poweredOnisdeliveringPower,waitingForLoadissearching,disabledisdisabled; overload, short circuit, voltage, current and controller errors arefault; anything else isotherFault. - $mikrotik->peth_port_power()
-
Power the port is delivering, in milliwatts (
mtxrPOEPower). - $mikrotik->peth_power_watts()
- $mikrotik->peth_power_status()
-
RouterOS exports no PoE budget, so these return an empty hash.
- $mikrotik->mt_poe_status()
-
(
mtxrPOEStatus) - $mikrotik->mt_poe_power()
-
(
mtxrPOEPower)
Table Methods imported from SNMP::Info::Layer3
See documentation in SNMP::Info::Layer3 for details.