Changeset 168 for branches/stable/cgi-bin/consistency-check.pl
- Timestamp:
- 02/22/05 14:30:36 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/stable/cgi-bin/consistency-check.pl
r158 r168 14 14 15 15 ($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. 17 initIPDBGlobals($dbh); 23 18 24 19 print "First check: All blocks must be within one of the master blocks\n"; … … 54 49 # Next: free blocks 55 50 print "Checking freeblocks: "; 56 $sth = $dbh->prepare("select cidr from freeblocks ");51 $sth = $dbh->prepare("select cidr from freeblocks order by cidr"); 57 52 $sth->execute; 58 53 FREEBLOCK: while (@data = $sth->fetchrow_array) { … … 138 133 print "done $master.\n"; 139 134 } 135 136 print "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; 140 while (@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 145 print "Done CustID correctness check.\n";
Note:
See TracChangeset
for help on using the changeset viewer.