From efecf1bbb713ab4e630ac6da022ebbc3739e6984 Mon Sep 17 00:00:00 2001 From: Oliver Gorwits Date: Fri, 18 Apr 2014 17:08:01 +0100 Subject: [PATCH] Improvements to Mikrotik module (Alex Z) --- ChangeLog | 6 ++++++ DeviceMatrix.txt | 2 +- Info.pm | 2 +- Info/Layer3/Mikrotik.pm | 46 +++++++++++++++++++++++++++++++++++++++-- 4 files changed, 52 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index be53704b..b5ccb547 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ SNMP::Info - Friendly OO-style interface to Network devices using SNMP. +version 3.14 () + + [ENHANCEMENTS] + + * Improvements to Mikrotik module (Alex Z) + version 3.13 (2014-03-27) [ENHANCEMENTS] diff --git a/DeviceMatrix.txt b/DeviceMatrix.txt index bb251548..d846d8da 100644 --- a/DeviceMatrix.txt +++ b/DeviceMatrix.txt @@ -386,7 +386,7 @@ note: The Cisco 3000 device can return duplicate interface names, while Netdisco device: ASA note: The Cisco ASA is the successor of the PIX which was bought from Altiga Networks. -Class: Layer3::CiscoASA +class: Layer3::CiscoASA device-family: 1000 duplex: no diff --git a/Info.pm b/Info.pm index 982e1675..56db2c6a 100644 --- a/Info.pm +++ b/Info.pm @@ -108,7 +108,7 @@ See L or L for more =head1 SUPPORT Please direct all support, help, and bug requests to the snmp-info-users -Mailing List at . +Mailing List at L. =head1 DESCRIPTION diff --git a/Info/Layer3/Mikrotik.pm b/Info/Layer3/Mikrotik.pm index fd270e84..12650f9d 100644 --- a/Info/Layer3/Mikrotik.pm +++ b/Info/Layer3/Mikrotik.pm @@ -50,17 +50,30 @@ $VERSION = '3.13'; %GLOBALS = ( %SNMP::Info::Layer3::GLOBALS, 'hrSystemUptime' => 'hrSystemUptime', + 'os_level' => 'mtxrLicLevel', 'os_ver' => 'mtxrLicVersion', + 'serial1' => 'mtxrSystem.3.0', + 'firmware' => 'mtxrSystem.4.0', + 'fan_type' => 'mtxrHlActiveFan', ); -%FUNCS = ( %SNMP::Info::Layer3::FUNCS, ); +%FUNCS = ( + %SNMP::Info::Layer3::FUNCS, +); -%MUNGE = ( %SNMP::Info::Layer3::MUNGE, ); +%MUNGE = ( + %SNMP::Info::Layer3::MUNGE, +); sub vendor { return 'mikrotik'; } +sub serial { + my $mikrotik = shift; + return $mikrotik->serial1; +} + sub model { my $mikrotik = shift; my $descr = $mikrotik->description() || ''; @@ -73,6 +86,18 @@ sub os { return 'routeros'; } +sub board_temp { + my $mikrotik = shift; + my $temp = $mikrotik->mtxrHlTemperature; + return $temp / 10.0; +} + +sub cpu_temp { + my $mikrotik = shift; + my $temp = $mikrotik->mtxrHlProcessorTemperature; + return $temp / 10.0; +} + 1; __END__ @@ -148,6 +173,23 @@ Tries to extract the device model from C. Returns the value of C. +=item $mikrotik->os_level() + +Returns the value of RouterOS level C + +=item $mikrotik->board_temp() +=item $mikrotik->cpu_temp() + +Returns the appropriate temperature values + +=item $mikrotik->serial() + +Returns the device serial. + +=item $mikrotik->firmware() + +Returns the firmware version of hardware. + =back =head2 Globals imported from SNMP::Info::Layer3