X-Git-Url: https://git.openstreetmap.org/chef.git/blobdiff_plain/a2b9bd4dfa96e6919647b168c6fb857af839ced2..51c7169f70c83e5e857a2ee5560deda2c571c215:/cookbooks/munin/files/default/plugins/snmp__apcpdu_temperature diff --git a/cookbooks/munin/files/default/plugins/snmp__apcpdu_temperature b/cookbooks/munin/files/default/plugins/snmp__apcpdu_temperature new file mode 100755 index 000000000..309f47326 --- /dev/null +++ b/cookbooks/munin/files/default/plugins/snmp__apcpdu_temperature @@ -0,0 +1,40 @@ +#!/usr/bin/perl + +=head1 MAGIC MARKERS + + #%# family=snmpauto + #%# capabilities=snmpconf + +=cut + +use strict; +use warnings; +use Munin::Plugin::SNMP; + +my $session = Munin::Plugin::SNMP->session; + +if (defined $ARGV[0] and $ARGV[0] eq "config") { + my $host = $session->hostname; + my $warning = $session->get_single(".1.3.6.1.4.1.318.1.1.26.10.2.1.1.11.1"); + my $critical = $session->get_single(".1.3.6.1.4.1.318.1.1.26.10.2.1.1.10.1"); + + print "host_name $host\n" unless $host eq "localhost"; + print "graph_title Temperature\n"; + print "graph_args -l 0\n"; + print "graph_vlabel Degrees Celsius\n"; + print "graph_category sensors\n"; + print "graph_info This graph shows the temperature from the PDUs environmental sensor.\n"; + + print "temperature.label Temperature\n"; + print "temperature.type GAUGE\n"; + print "temperature.info Temperature in degrees celsius.\n"; + print "temperature.draw LINE2\n"; + print "temperature.warning :${warning}\n"; + print "temperature.critical :${critical}\n"; +} else { + my $temperature = $session->get_single(".1.3.6.1.4.1.318.1.1.26.10.2.2.1.8.1"); + + $temperature = $temperature / 10 unless $temperature eq "U"; + + print "temperature.value ${temperature}\n"; +}