aboutsummaryrefslogtreecommitdiffstats
path: root/clients/snmpfetch.pl
diff options
context:
space:
mode:
authorJoachim Tingvold <joachim@tingvold.com>2015-03-31 05:09:33 +0200
committerJoachim Tingvold <joachim@tingvold.com>2015-03-31 05:09:33 +0200
commit381e194162092e6ca6d1da2248a41af8b4f7208d (patch)
tree224c1f7003a1ff3f9a5f4d844c1bea3c86f88958 /clients/snmpfetch.pl
parent191df1949e2e05eb20b49d5cb31afc7a1f70da91 (diff)
parente3d7c5cc86fedb458d9b091ca12245c01e7f285d (diff)
Merge branch 'master' of github.com:tech-server/tgmanage
Diffstat (limited to 'clients/snmpfetch.pl')
-rwxr-xr-xclients/snmpfetch.pl12
1 files changed, 8 insertions, 4 deletions
diff --git a/clients/snmpfetch.pl b/clients/snmpfetch.pl
index 968ace8..d696fc9 100755
--- a/clients/snmpfetch.pl
+++ b/clients/snmpfetch.pl
@@ -144,8 +144,8 @@ sub poll_loop {
for my $port (@ports) {
my @vars = ();
- push @vars, ["ifHCInOctets", $port];
- push @vars, ["ifHCOutOctets", $port];
+ push @vars, ["ifInOctets", $port];
+ push @vars, ["ifOutOctets", $port];
push @vars, ["ifInErrors", $port];
push @vars, ["ifOutErrors", $port];
my $varlist = SNMP::VarList->new(@vars);
@@ -193,9 +193,9 @@ sub callback {
if ($port != $var->[1]) {
die "Response for unknown OID $var->[0].$var->[1] (expected port $port)";
}
- if ($var->[0] eq 'ifHCInOctets') {
+ if ($var->[0] eq 'ifInOctets') {
$in = $var->[2];
- } elsif ($var->[0] eq 'ifHCOutOctets') {
+ } elsif ($var->[0] eq 'ifOutOctets') {
$out = $var->[2];
} elsif ($var->[0] eq 'ifInErrors') {
$ine = $var->[2];
@@ -212,17 +212,21 @@ sub callback {
warn $switch->{'sysname'}.":$port: failed reading in";
}
$ok = 0;
+ warn "no in";
}
if (!defined($out) || $out !~ /^\d+$/) {
if (defined($oute)) {
warn $switch->{'sysname'}.":$port: failed reading in";
}
$ok = 0;
+ warn "no out";
}
if ($ok) {
$qpoll->execute($switch->{'switch'}, $port, $in, $out, $ine, $oute) || die "%s:%s: %s\n", $switch->{'switch'}, $port, $in;
$dbh->commit;
+ } else {
+ warn $switch->{'sysname'} . " failed to OK.";
}
if (++$switch->{'num_done'} == $switch->{'num_ports'}) {