3
# $Log: snmp__fc_if_err_.in,v $
4
# Revision 1.1 2004/04/30 22:22:07 jimmyo
5
# Added to SNMP based fibre-channel plugins: fc_if and fc_if_err.
7
# Revision 1.4 2004/04/30 16:58:14 jimmyo
10
# Revision 1.3 2004/02/22 20:17:58 jimmyo
13
# Revision 1.2 2004/02/18 21:54:56 jimmyo
14
# Did a bit of work on the snmp-thingie.
16
# Revision 1.1 2004/01/02 18:50:00 jimmyo
17
# Renamed occurrances of lrrd -> munin
19
# Revision 1.1.1.1 2004/01/02 15:18:07 jimmyo
20
# Import of LRRD CVS tree after renaming to Munin
22
# Revision 1.1 2003/12/19 20:53:45 jimmyo
32
my $host = $ENV{host} || undef;
33
my $port = $ENV{port} || 161;
34
my $community = $ENV{community} || "public";
35
my $iface = $ENV{interface} || undef;
39
if (defined $ARGV[0] and $ARGV[0] eq "snmpconf")
41
print "number 1.3.6.1.2.1.8888.1.1.3.1.4.16.0.8.0.136.3.52.64.0.0.0.0.0.0.0.0\n";
42
print "index 1.3.6.1.2.1.8888.1.1.6.1.1.16.0.8.0.136.3.52.64.0.0.0.0.0.0.0.0.\n";
43
print "require 1.3.6.1.2.1.8888.1.1.6.1.5.16.0.8.0.136.3.52.64.0.0.0.0.0.0.0.0. ^2\$\n"; # state = online
44
print "require 1.3.6.1.2.1.8888.1.1.6.1.14.16.0.8.0.136.3.52.64.0.0.0.0.0.0.0.0. [1-9]\n"; # Speed
48
if ($0 =~ /^(?:|.*\/)snmp_([^_]+)_fc_if_err_(.+)$/)
52
if ($host =~ /^([^:]+):(\d+)$/)
60
print "# Debug: $0 -- $1 -- $2\n" if $DEBUG;
61
die "# Error: couldn't understand what I'm supposed to monitor.";
64
my $fcEntryDescr = "1.3.6.1.2.1.8888.1.1.6.1.16.16.0.8.0.136.3.52.64.0.0.0.0.0.0.0.0.$iface";
65
my $fcEntrySpeed = "1.3.6.1.2.1.8888.1.1.6.1.14.16.0.8.0.136.3.52.64.0.0.0.0.0.0.0.0.$iface";
66
my $fcEntryStatus = "1.3.6.1.2.1.8888.1.1.6.1.6.16.0.8.0.136.3.52.64.0.0.0.0.0.0.0.0.$iface";
67
my $fcEntryErrs = "1.3.6.1.2.1.8888.1.3.1.1.2.16.0.8.0.136.3.52.64.0.0.0.0.0.0.0.0.$iface";
68
my $fcPhysPort = "1.3.6.1.2.1.8888.1.1.6.1.17.16.0.8.0.136.3.52.64.0.0.0.0.0.0.0.0.$iface";
70
my ($session, $error) = Net::SNMP->session(
72
-community => $community,
77
if (!defined ($session))
79
die "Croaking: $error";
82
if ($ARGV[0] and $ARGV[0] eq "config")
84
print "host_name $host\n";
85
if (!defined ($response = $session->get_request($fcEntryDescr)))
87
die "Croaking: " . $session->error();
89
my $name = $response->{$fcEntryDescr};
90
if (defined ($response = $session->get_request($fcPhysPort)))
92
$name .= " (" . $response->{$fcPhysPort} . ")";
94
print "graph_title FC $name errors\n";
95
print "graph_order errs\n";
96
print "graph_args --base 1000\n";
97
print "graph_vlabel errors / second\n";
98
print "errs.label errors\n";
99
print "errs.type COUNTER\n";
100
print "errs.max 4000000000\n";
105
if (defined ($response = $session->get_request($fcEntryStatus)))
107
$status = $response->{$fcEntryStatus};
112
print "errs.value U\n";
116
if (defined ($response = $session->get_request($fcEntryErrs)))
118
print "errs.value ", $response->{$fcEntryErrs}, "\n";
122
print "recv.value U\n";