Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save KristianLyng/5be94ba4c180f10f2d126cd60e3a84e1 to your computer and use it in GitHub Desktop.
Save KristianLyng/5be94ba4c180f10f2d126cd60e3a84e1 to your computer and use it in GitHub Desktop.
kly@leia:~/src/tgnms/extras/tools/lldp$ grep mylog lolwhat.pl
my $mylogindent = "";
mylog("Polling initial systems");
mylog("Probed auto-detected peers: " . scalar @chassis_ids_checked . " Total detected: " . scalar keys %lldppeers );
mylog("Probing complete. Trying to make road in the velling");
mylog("Done. Outputting JSON.");
mylog("$matches interfaces share MAC address. Calling it OK.");
mylog("$res mismatched interfaces versus $matches matched. Not enough for confidence.");
mylog("... So there are two systems that look 50% similar. $bad (But not the other way around)");
mylog("Lacking confidence. Doing in-depth comparison instead");
mylog("Gained confidence. Injecting missing IPs to both canidates.");
mylog("Polling $ip");
mylog($tmp);
mylog("\t\tXXX: Fu... chassis ID collision from remote ID $in{id}.");
mylog("\t\t\tXXX: Old sysname/ip: $old{name} / $old{ip}");
mylog("\t\t\tXXX: New sysname/ip: $in{name} / $in{ip}");
mylog("Detecting new candidates for probes");
mylog("wtf is up here? Man addr but no chassis id? I HATE NETWORK EQUIPMENT");
mylog("I. Hate. Network. Equipment. We got IP, chassis id but no sysname.");
mylog("Adding peer $d{name} / $d{ip} / $d{id}");
mylog("Building inventory of decent results/ips");
mylog("Ok: $target");
mylog("Checking for empty SNMP results that are covered by other results");
mylog("Removing " . join(", ", @removals));
mylog("Checking for duplicated/corrupt chassis ids");
mylog("Building sysname -> chassis id table where possible");
mylog("sysName collision. This is only an issue if there is _also_ chassis id collision.");
mylog("Building local chassis id map");
mylog("Checking for chassis id's with duplicate systems");
mylog("Duplicate or collision: chassis id ($id) : " . join(", ", @$value));
mylog("Collision between $test and $test2. Adding to fixlist.");
mylog("a: " . $snmpresults{$test}{sysName} . " b: ". $snmpresults{$test2}{sysName});
mylog("Removed duplicates: " . join(", ", @removed));
mylog("Applying fixes for ". (keys %fixlist) . " collisions");
mylog("Can't really fix $ip because there's also a sysname collision for that sysname");
mylog("Couldn't fix $ip / $sysname. The extrapolated chassis id seen from remote is the same as the colliding one.... ");
mylog("Switching chassis ID from colliding $snmpresults{$ip}{lldpLocChassisId} to what remotes think matches: $remmap{$sysname}");
mylog("No alternate chassis IDs seen for $ip. Unsetting broken chassis ID anyway.");
mylog("XXX: No snmp data. Probably disconnect?");
mylog("Post-processing SNMP. Sysname: $sysname");
mylog("Chassis id matched remote...");
mylog("Bad chassis id.... Fudge. Ignoring direct result.");
mylog("Chassis id: $chassis_id");
mylog("XXX: No lldpLocChassisId found. Bummer. Enable LLDP?");
mylog("Parsing lldp neighbors");
mylog("Spotted $rem_chassis_id / $remname");
mylog("Parsing lldp neighbors management interfaces");
mylog("Two management IPs discovered on port. v4 vs v6.");
mylog("\t$lol{$idx}{lldpRemManAddr} vs $remip");
mylog("Parsing local interfaces");
mylog("Parsing ARP table");
mylog("Found my self: " . $value->{ipNetToMediaNetAddress});
mylog("Parsing ipAddressTable");
mylog("Local IP added: $addr");
mylog("Parsing ipAddrTable");
mylog("Adding local ipv4 ip $value->{ipAdEntAddr}");
mylog("Ensuring some sanity: Checking if the $targetip is among claimed IPs for the SNMP results");
mylog("Phew, it is...");
mylog("Didn't find myself. Hoping deduplication will take care of it?");
mylog("Registering known ips for " . ($sysname || "?" ));
$mylogindent = $mylogindent . "\t";
chop $mylogindent;
sub mylog {
printf STDERR "[%s] %s%s\n", $time, $mylogindent, $msg;
mylog("Already probed $target. Skipping.");
mylog("IP claimed by $claimedips{$target}. Skipping.");
mylog("Populate LLDP map");
mylog("Populating ipmap");
mylog("Conflict for ip $ip");
mylog("IP conflict: $localip found multiple places ($ipmap{$localip} vs $ip)");
mylog("Removing conflicting IPs");
mylog("Checking if there are peers from LLDP with no basic SNMP info");
mylog("Adding basic info for $value->{ip} / $value->{name} to snmp results");
mylog("Populate layer3 peermap");
kly@leia:~/src/tgnms/extras/tools/lldp$
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment