Changeset 157
- Timestamp:
- 03/03/10 16:23:57 (5 months ago)
- Location:
- trunk/misc
- Files:
-
- 2 modified
-
. (modified) (1 prop)
-
dns-o-matic.py (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/misc
-
Property
svn:ignore set
to
.project
.pydevproject
-
Property
svn:ignore set
to
-
trunk/misc/dns-o-matic.py
r156 r157 138 138 139 139 # iterate through all valid addresses in the subnet 140 for ip in [x for x in list(subnet) if x != subnet.broadcast and x != subnet.ip]: 140 sys.stderr.write("Subnet %s...\n" % str(subnet)); 141 for ip in [str(x) for x in list(subnet) if x != subnet.broadcast and x != subnet.ip]: 141 142 sys.stderr.write("Processing %s\n" % ip); 142 address = {'ip': str(ip), 'results':[]}143 address = {'ip':ip, 'results':[]} 143 144 for ns,pri in nameservers: 144 RecursiveLookup(address, str(ip),'PTR',ns)145 RecursiveLookup(address,ip,'PTR',ns) 145 146 146 147 # forget about addresses that don't have records in *any* nameservers … … 183 184 heading = "<tr><th>address</th>" 184 185 for ns in data['nameservers']: 185 heading += "<th>%s</th>" % ns['name'] 186 if ns['primary']: 187 heading += "<th>%s (SOA)</th>" % ns['name'] 188 else: 189 heading += "<th>%s</th>" % ns['name'] 186 190 heading += "</tr>" 187 191 … … 199 203 # for debugging 200 204 import pprint 201 print "< !--"205 print "<pre style='display:none;'>" 202 206 pp = pprint.PrettyPrinter(indent=2) 203 207 pp.pprint(data) 204 print " -->"208 print "</pre>" 205 209 206 210 … … 209 213 <head> 210 214 <title>DNS-o-Matic Report</title> 215 <script type="text/javascript" src="jquery.js"></script> 216 <script type="text/javascript"> 217 jQuery(document).ready(function($) { 218 $("a#debugs_on").css('display', 'inline'); 219 $("a#debugs_on").click(function() { 220 $("pre").css('display', 'block'); 221 $("table").css('display', 'none'); 222 $("a#debugs_on").css('display', 'none'); 223 $("a#debugs_off").css('display', 'inline'); 224 }); 225 $("a#debugs_off").click(function() { 226 $("pre").css('display', 'none'); 227 $("table").css('display', 'block'); 228 $("a#debugs_on").css('display', 'inline'); 229 $("a#debugs_off").css('display', 'none'); 230 }); 231 }); 232 </script> 211 233 <style> 212 234 th { … … 240 262 <body> 241 263 <h1>DNS-o-Matic Report</h1> 264 <a id='debugs_on' href='#' style='display:none;'>Show Debugs</a> 265 <a id='debugs_off' href='#' style='display:none;'>Hide Debugs</a> 242 266 """ 243 267