Changeset 167 for trunk/cgi-bin/consistency-check.pl
- Timestamp:
- 02/22/05 14:25:58 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/cgi-bin/consistency-check.pl
r142 r167 16 16 ($dbh,$errstr) = connectDB_My; 17 17 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. 19 initIPDBGlobals($dbh); 24 20 25 21 print "First check: All blocks must be within one of the master blocks\n"; … … 55 51 # Next: free blocks 56 52 print "Checking freeblocks: "; 57 $sth = $dbh->prepare("select cidr from freeblocks ");53 $sth = $dbh->prepare("select cidr from freeblocks order by cidr"); 58 54 $sth->execute; 59 55 FREEBLOCK: while (@data = $sth->fetchrow_array) { … … 139 135 print "done $master.\n"; 140 136 } 137 138 print "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; 142 while (@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 147 print "Done CustID correctness check.\n";
Note:
See TracChangeset
for help on using the changeset viewer.