root / plugins / synology / snmp__synology_temperature @ 17f78427
Historique | Voir | Annoter | Télécharger (2,08 ko)
| 1 |
#!/usr/bin/perl -w |
|---|---|
| 2 |
# -*- cperl -*- |
| 3 |
# vim: ft=perl |
| 4 |
|
| 5 |
=head1 NAME |
| 6 |
|
| 7 |
snmp__syno_temperature - Munin plugin to retrieve current temperature from a |
| 8 |
Synology NAS. |
| 9 |
|
| 10 |
=head1 APPLICABLE SYSTEMS |
| 11 |
|
| 12 |
Any Synology NAS device which provides the synoSystem MIB. |
| 13 |
|
| 14 |
=head1 CONFIGURATION |
| 15 |
|
| 16 |
As a rule SNMP plugins need site specific configuration. The default |
| 17 |
configuration (shown here) will only work on insecure sites/devices. |
| 18 |
|
| 19 |
[snmp_*] |
| 20 |
env.version 2 |
| 21 |
env.community public |
| 22 |
|
| 23 |
In general SNMP is not very secure at all unless you use SNMP version |
| 24 |
3 which supports authentication and privacy (encryption). But in any |
| 25 |
case the community string for your devices should not be "public". |
| 26 |
|
| 27 |
Please see 'perldoc Munin::Plugin::SNMP' for further configuration |
| 28 |
information. |
| 29 |
|
| 30 |
=head1 INTERPRETATION |
| 31 |
|
| 32 |
This plugin queries the current temperature of the NAS. |
| 33 |
|
| 34 |
=head1 MIB INFORMATION |
| 35 |
|
| 36 |
This plugin requires support for the synoSystem MIB by Synology. |
| 37 |
It reports the contents of the temperature OID. |
| 38 |
|
| 39 |
=head1 MAGIC MARKERS |
| 40 |
|
| 41 |
#%# family=snmpauto |
| 42 |
#%# capabilities=snmpconf |
| 43 |
|
| 44 |
=head1 VERSION |
| 45 |
|
| 46 |
$Id$ |
| 47 |
|
| 48 |
=head1 BUGS |
| 49 |
|
| 50 |
None known. |
| 51 |
|
| 52 |
=head1 AUTHOR |
| 53 |
|
| 54 |
Copyright (C) 2015 Thomas Arthofer |
| 55 |
|
| 56 |
=head1 LICENSE |
| 57 |
|
| 58 |
GPLv2 or (at your option) any later version. |
| 59 |
|
| 60 |
=cut |
| 61 |
|
| 62 |
use strict; |
| 63 |
use Munin::Plugin::SNMP; |
| 64 |
|
| 65 |
if (defined $ARGV[0] and $ARGV[0] eq "snmpconf") {
|
| 66 |
print "require 1.3.6.1.4.1.6574.1.2.0 [0-9]\n"; # Number |
| 67 |
exit 0; |
| 68 |
} |
| 69 |
|
| 70 |
if (defined $ARGV[0] and $ARGV[0] eq "config") {
|
| 71 |
my ($host) = Munin::Plugin::SNMP->config_session(); |
| 72 |
print "host_name $host\n" unless $host eq 'localhost'; |
| 73 |
print "graph_title Temperatures |
| 74 |
graph_args --base 1000 -l 0 |
| 75 |
graph_vlabel Degrees Celsius |
| 76 |
graph_category sensors |
| 77 |
graph_info This graph shows the temperature of the diskstation. |
| 78 |
temp.label CPU |
| 79 |
temp.info The temperature of the onboard CPU. |
| 80 |
"; |
| 81 |
exit 0; |
| 82 |
} |
| 83 |
|
| 84 |
my $session = Munin::Plugin::SNMP->session(-translate => |
| 85 |
[ -timeticks => 0x0 ]); |
| 86 |
|
| 87 |
my $temp = $session->get_single (".1.3.6.1.4.1.6574.1.2.0") || 'ERROR';
|
| 88 |
|
| 89 |
print "Retrived uptime is '$temp'\n" if $Munin::Plugin::SNMP::DEBUG; |
| 90 |
|
| 91 |
print "temp.value ", $temp, "\n"; |
