aboutsummaryrefslogtreecommitdiffstats
path: root/clients/lldpdiscover.pl
diff options
context:
space:
mode:
authorroot <root@riffraff.tg14.gathering.org>2014-04-20 02:58:05 +0200
committerroot <root@riffraff.tg14.gathering.org>2014-04-20 02:58:05 +0200
commit8f4ae8e5833f0d26be5fad5160ae6ee0479b0712 (patch)
treeda5089e91fbe52fd7da57a1c431c9af64f6ac8af /clients/lldpdiscover.pl
parent37a3b5d6ed97367989aecc875f1db1e9eb0458df (diff)
parent19cd0064816a577b72577b9f21a5a946eb746f64 (diff)
Merge branch 'master' of https://github.com/tech-server/tgmanage
Diffstat (limited to 'clients/lldpdiscover.pl')
-rwxr-xr-xclients/lldpdiscover.pl4
1 files changed, 3 insertions, 1 deletions
diff --git a/clients/lldpdiscover.pl b/clients/lldpdiscover.pl
index 581f2d8..f72314e 100755
--- a/clients/lldpdiscover.pl
+++ b/clients/lldpdiscover.pl
@@ -37,7 +37,7 @@ while (my $ref = $snmpq->fetchrow_hashref) {
}
# First, find all machines that lack an LLDP chassis ID.
-my $q = $dbh->prepare("SELECT switch, ip, community FROM switches WHERE lldp_chassis_id IS NULL AND ip <> '127.0.0.1' AND switchtype <> 'dlink3100'");
+my $q = $dbh->prepare("SELECT switch, ip, community FROM switches WHERE lldp_chassis_id IS NULL AND ip <> '127.0.0.1'");
$q->execute;
while (my $ref = $q->fetchrow_hashref) {
@@ -55,6 +55,7 @@ while (my $ref = $q->fetchrow_hashref) {
$dbh->rollback;
}
}
+$dbh->commit;
# Now ask all switches for their LLDP neighbor table.
$q = $dbh->prepare("SELECT ip, sysname, community FROM switches WHERE lldp_chassis_id IS NOT NULL AND ip <> '127.0.0.1' AND switchtype <> 'dlink3100'");
@@ -69,6 +70,7 @@ while (my $ref = $q->fetchrow_hashref) {
mylog("ERROR: $@ (during poll of $ip)");
$dbh->rollback;
}
+ $dbh->commit;
}
$dbh->disconnect;