Skip to content

Commit

Permalink
Added monitoring of router temperature
Browse files Browse the repository at this point in the history
  • Loading branch information
alejandroscf authored and sumpfralle committed Apr 25, 2020
1 parent 0cfcf2c commit 3032db4
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions plugins/router/snmp__mikrotik
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ my $sysFlashUsageOID = "1.3.6.1.2.1.25.2.3.1.6.131072";
my $sysFlashTotalOID = "1.3.6.1.2.1.25.2.3.1.5.131072";
my $sysRAMUsageOID = "1.3.6.1.2.1.25.2.3.1.6.65536";
my $sysRAMTotalOID = "1.3.6.1.2.1.25.2.3.1.5.65536";
my $sysTempOID = "1.3.6.1.4.1.14988.1.1.3.10.0";

my $response;

Expand All @@ -57,6 +58,7 @@ if (defined $ARGV[0] and $ARGV[0] eq "snmpconf") {
print "require $sysFlashTotalOID\n";
print "require $sysRAMUsageOID\n";
print "require $sysRAMTotalOID\n";
print "require $sysTempOID\n";
exit 0;
}

Expand Down Expand Up @@ -112,6 +114,17 @@ if ($ARGV[0] and $ARGV[0] eq "config") {
print "sysRAMUsage.label Used Memory\n";
print "sysRAMUsage.draw AREA\n";
}

$response = $session->get_request($sysTempOID);
if (defined $response) {
print "multigraph temp\n";
print "graph_vlabel degC \n";
print "graph_title Temperature\n";
print "graph_category sensors\n";
print "graph_info This graph shows the router's temperature.\n";
print "sysTemp.label Temperature\n";
print "sysTemp.type GAUGE\n";
}
exit 0 unless (($ENV{MUNIN_CAP_DIRTYCONFIG} || 0) == 1);
}

Expand All @@ -136,4 +149,12 @@ if (defined $response) {
print "sysRAMTotal.value U\n";
}

print "multigraph temp\n";
$response = $session->get_request(-varbindlist => [$sysTempOID]);
if (defined $response) {
print "sysTemp.value ", $response->{$sysTempOID}/10, "\n";
} else {
print "sysTemp.value U\n";
}

# vim:syntax=perl

0 comments on commit 3032db4

Please sign in to comment.