#!/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.13.1"); my $critical = $session->get_single(".1.3.6.1.4.1.318.1.1.26.10.2.1.1.14.1"); print "host_name $host\n" unless $host eq "localhost"; print "graph_title Humidity\n"; print "graph_args -l 0\n"; print "graph_vlabel %\n"; print "graph_category sensors\n"; print "graph_info This graph shows the humidity from the PDUs environmental sensor.\n"; print "humidity.label Humidity\n"; print "humidity.type GAUGE\n"; print "humidity.info Relative humidity.\n"; print "humidity.draw LINE2\n"; print "humidity.warning ${warning}:\n"; print "humidity.critical ${critical}:\n"; } else { my $humidity = $session->get_single(".1.3.6.1.4.1.318.1.1.26.10.2.2.1.10.1"); print "humidity.value ${humidity}\n"; }