diff options
author | root <root@frank.tg14.gathering.org> | 2014-04-15 03:21:12 +0200 |
---|---|---|
committer | root <root@frank.tg14.gathering.org> | 2014-04-15 03:21:12 +0200 |
commit | b112fe480ba29ff5007a0bf0d81e9cf710a6fe2b (patch) | |
tree | 18c298bbf2494af75d4528bbccc8c15fd555a829 | |
parent | 607fad328dc97dd02f18db12dcb6c6dde4c7d6fb (diff) |
Poll less stuff for LLDP.
-rwxr-xr-x | clients/lldpdiscover.pl | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/clients/lldpdiscover.pl b/clients/lldpdiscover.pl index 71f9eae..ab5df96 100755 --- a/clients/lldpdiscover.pl +++ b/clients/lldpdiscover.pl @@ -29,7 +29,7 @@ if (defined($cmdline_ip) && defined($cmdline_community)) { } # 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'"); +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'"); $q->execute; while (my $ref = $q->fetchrow_hashref) { @@ -49,7 +49,7 @@ while (my $ref = $q->fetchrow_hashref) { } # 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'"); +$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'"); $q->execute; while (my $ref = $q->fetchrow_hashref) { @@ -85,6 +85,9 @@ sub discover_lldp_neighbors { next if $sysname =~ /nocnexus/; + my $sysdesc = $value->{'lldpRemSysDesc'}; + next if $sysdesc =~ /\b(C1530|C3600|C3700)\b/; + my $exists = $dbh->selectrow_hashref($qexist, undef, $chassis_id)->{'cnt'}; next if ($exists); |