Improvements to Mikrotik module (Alex Z)

This commit is contained in:
Oliver Gorwits
2014-04-18 17:08:01 +01:00
parent 682b8c2a9c
commit efecf1bbb7
4 changed files with 52 additions and 4 deletions

View File

@@ -1,5 +1,11 @@
SNMP::Info - Friendly OO-style interface to Network devices using SNMP. 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) version 3.13 (2014-03-27)
[ENHANCEMENTS] [ENHANCEMENTS]

View File

@@ -386,7 +386,7 @@ note: The Cisco 3000 device can return duplicate interface names, while Netdisco
device: ASA device: ASA
note: The Cisco ASA is the successor of the PIX which was bought from Altiga Networks. 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 device-family: 1000
duplex: no duplex: no

View File

@@ -108,7 +108,7 @@ See L<http://netdisco.org/doc/DeviceMatrix.html> or L<DeviceMatrix.txt> for more
=head1 SUPPORT =head1 SUPPORT
Please direct all support, help, and bug requests to the snmp-info-users Please direct all support, help, and bug requests to the snmp-info-users
Mailing List at <http://lists.sourceforge.net/lists/listinfo/snmp-info-users>. Mailing List at L<http://lists.sourceforge.net/lists/listinfo/snmp-info-users>.
=head1 DESCRIPTION =head1 DESCRIPTION

View File

@@ -50,17 +50,30 @@ $VERSION = '3.13';
%GLOBALS = ( %GLOBALS = (
%SNMP::Info::Layer3::GLOBALS, %SNMP::Info::Layer3::GLOBALS,
'hrSystemUptime' => 'hrSystemUptime', 'hrSystemUptime' => 'hrSystemUptime',
'os_level' => 'mtxrLicLevel',
'os_ver' => 'mtxrLicVersion', '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 { sub vendor {
return 'mikrotik'; return 'mikrotik';
} }
sub serial {
my $mikrotik = shift;
return $mikrotik->serial1;
}
sub model { sub model {
my $mikrotik = shift; my $mikrotik = shift;
my $descr = $mikrotik->description() || ''; my $descr = $mikrotik->description() || '';
@@ -73,6 +86,18 @@ sub os {
return 'routeros'; 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; 1;
__END__ __END__
@@ -148,6 +173,23 @@ Tries to extract the device model from C<sysDescr>.
Returns the value of C<mtxrLicVersion>. Returns the value of C<mtxrLicVersion>.
=item $mikrotik->os_level()
Returns the value of RouterOS level C<mtxrLicLevel>
=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 =back
=head2 Globals imported from SNMP::Info::Layer3 =head2 Globals imported from SNMP::Info::Layer3