]> git.openstreetmap.org Git - chef.git/blob - cookbooks/munin/files/default/plugins/snmp__apcpdu_power
Fix typo
[chef.git] / cookbooks / munin / files / default / plugins / snmp__apcpdu_power
1 #!/usr/bin/perl
2
3 =head1 MAGIC MARKERS
4
5   #%# family=snmpauto
6   #%# capabilities=snmpconf
7
8 =cut
9
10 use strict;
11 use warnings;
12 use Munin::Plugin::SNMP;
13
14 my $session = Munin::Plugin::SNMP->session;
15
16 if (defined $ARGV[0] and $ARGV[0] eq "config") {
17     my $host = $session->hostname;
18
19     print "host_name $host\n" unless $host eq "localhost";
20     print "graph_title Power\n";
21     print "graph_args --base 1000 -l 0\n";
22     print "graph_vlabel Watts\n";
23     print "graph_category power\n";
24     print "graph_info This graph shows the power being supplied by the PDU.\n";
25
26     print "power.label Power\n";
27     print "power.type GAUGE\n";
28     print "power.info Current power draw in watts.\n";
29     print "power.draw LINE2\n";
30 } else {
31     my $power = $session->get_single(".1.3.6.1.4.1.318.1.1.26.6.3.1.7.1");
32
33     $power = $power * 10 unless $power eq "U";
34
35     print "power.value ${power}\n";
36 }