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

/branches/stable

Port forward enhanced "default CustID" feature from /trunk r167

File:
1 edited

Legend:

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

    r158 r168  
    1414
    1515($dbh,$errstr) = connectDB_My;
    16 
    17 # Schlep up the masters
    18 $sth = $dbh->prepare("select * from masterblocks order by cidr");
    19 $sth->execute;
    20 for ($i=0; @data = $sth->fetchrow_array; $i++) {
    21   $masterblocks[$i] = new NetAddr::IP $data[0];
    22 }
     16# May as well.  We need a number of globals.
     17initIPDBGlobals($dbh);
    2318
    2419print "First check:  All blocks must be within one of the master blocks\n";
     
    5449# Next:  free blocks
    5550print "Checking freeblocks: ";
    56 $sth = $dbh->prepare("select cidr from freeblocks");
     51$sth = $dbh->prepare("select cidr from freeblocks order by cidr");
    5752$sth->execute;
    5853FREEBLOCK: while (@data = $sth->fetchrow_array) {
     
    138133  print "done $master.\n";
    139134}
     135
     136print "Done checking block alignment.\n\nChecking for correctness on 'defined' CustIDs:\n";
     137# New check:  Make sure "defined" CustIDs are correct.
     138$sth = $dbh->prepare("select cidr,type,custid from allocations where not type='cn' order by cidr");
     139$sth->execute;
     140while (@data = $sth->fetchrow_array) {
     141  print "$data[0] ($disp_alloctypes{$data[1]}) has incorrect CustID $data[2]\n"
     142        if $data[2] ne $def_custids{$data[1]};
     143}
     144
     145print "Done CustID correctness check.\n";
Note: See TracChangeset for help on using the changeset viewer.