diff options
-rwxr-xr-x | clients/lldpdiscover.pl | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/clients/lldpdiscover.pl b/clients/lldpdiscover.pl index bfd4f84..3f24a63 100755 --- a/clients/lldpdiscover.pl +++ b/clients/lldpdiscover.pl @@ -199,6 +199,14 @@ sub add_switch { $dbh->do('INSERT INTO portnames (switchtype, port, description) VALUES (?, ?, ?)', undef, $switchtype, $port->{'ifIndex'}, $port->{'ifDescr'}); } + + # Entirely random placement. Annoying? Fix it yourself. + my $x = int(rand 1200); + my $y = int(rand 650); + my $box = sprintf "((%d,%d),(%d,%d))", $x, $y, $x+40, $y+40; + $dbh->do("INSERT INTO placements (switch,placement) VALUES (CURRVAL('switches_switch_seq'), ?)", + undef, $box); + $dbh->commit; } |