Ignore:
Timestamp:
02/22/05 14:25:58 (19 years ago)
Author:
Kris Deugau
Message:

/trunk

New feature: Different "default" CustIDs depending on the allocation type
consistency-check.pl also updated to check this information.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/cgi-bin/consistency-check.pl

    r142 r167  
    1616($dbh,$errstr) = connectDB_My;
    1717
    18 # Schlep up the masters
    19 $sth = $dbh->prepare("select * from masterblocks order by cidr");
    20 $sth->execute;
    21 for ($i=0; @data = $sth->fetchrow_array; $i++) {
    22   $masterblocks[$i] = new NetAddr::IP $data[0];
    23 }
     18# May as well.  We need a number of globals.
     19initIPDBGlobals($dbh);
    2420
    2521print "First check:  All blocks must be within one of the master blocks\n";
     
    5551# Next:  free blocks
    5652print "Checking freeblocks: ";
    57 $sth = $dbh->prepare("select cidr from freeblocks");
     53$sth = $dbh->prepare("select cidr from freeblocks order by cidr");
    5854$sth->execute;
    5955FREEBLOCK: while (@data = $sth->fetchrow_array) {
     
    139135  print "done $master.\n";
    140136}
     137
     138print "Done checking block alignment.\n\nChecking for correctness on 'defined' CustIDs:\n";
     139# New check:  Make sure "defined" CustIDs are correct.
     140$sth = $dbh->prepare("select cidr,type,custid from allocations where not type='cn' order by cidr");
     141$sth->execute;
     142while (@data = $sth->fetchrow_array) {
     143  print "$data[0] ($disp_alloctypes{$data[1]}) has incorrect CustID $data[2]\n"
     144        if $data[2] ne $def_custids{$data[1]};
     145}
     146
     147print "Done CustID correctness check.\n";
Note: See TracChangeset for help on using the changeset viewer.