]> git.openstreetmap.org Git - chef.git/blob - cookbooks/munin/files/default/plugins/snmp__apcpdu_current
Make replication delay monitoring more reliable
[chef.git] / cookbooks / munin / files / default / plugins / snmp__apcpdu_current
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     my $warning = $session->get_single(".1.3.6.1.4.1.318.1.1.26.6.1.1.6.1");
19     my $critical = $session->get_single(".1.3.6.1.4.1.318.1.1.26.6.1.1.7.1");
20
21     print "host_name $host\n" unless $host eq "localhost";
22     print "graph_title Load\n";
23     print "graph_args --base 1000 -l 0\n";
24     print "graph_vlabel Amps\n";
25     print "graph_category power\n";
26     print "graph_info This graph shows the total throughput the PDU.\n";
27
28     print "current.label Current\n";
29     print "current.type GAUGE\n";
30     print "current.info Current load in amps.\n";
31     print "current.draw LINE2\n";
32     print "current.warning ${warning}\n";
33     print "current.critical ${critical}\n";
34 } else {
35     my $current = $session->get_single(".1.3.6.1.4.1.318.1.1.26.6.3.1.5.1");
36
37     $current = $current / 10 unless $current eq "U";
38
39     print "current.value ${current}\n";
40 }