Mercurial > repos > other > Puppet
comparison common/logwatch/named @ 185:78dc899775b7 puppet-3.6
Add latest Logwatch "named" script to handle DNS log changes
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Fri, 14 Dec 2018 20:07:09 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
184:ab82c65dcb28 | 185:78dc899775b7 |
---|---|
1 ########################################################################## | |
2 # $Id$ | |
3 ########################################################################## | |
4 | |
5 ##################################################### | |
6 ## Copyright (c) 2008 Kirk Bauer | |
7 ## Covered under the included MIT/X-Consortium License: | |
8 ## http://www.opensource.org/licenses/mit-license.php | |
9 ## All modifications and contributions by other persons to | |
10 ## this script are assumed to have been donated to the | |
11 ## Logwatch project and thus assume the above copyright | |
12 ## and licensing terms. If you want to make contributions | |
13 ## under your own copyright or a different license this | |
14 ## must be explicitly stated in the contribution an the | |
15 ## Logwatch project reserves the right to not accept such | |
16 ## contributions. If you have made significant | |
17 ## contributions to this script and want to claim | |
18 ## copyright please contact logwatch-devel@lists.sourceforge.net. | |
19 ######################################################### | |
20 | |
21 use Logwatch ':ip'; | |
22 | |
23 | |
24 #$DoLookup = ValueOrDefault($ENV{'named_ip_lookup'}, 0); | |
25 $Debug = ValueOrDefault($ENV{'LOGWATCH_DEBUG'}, 0); | |
26 $Detail = ValueOrDefault($ENV{'LOGWATCH_DETAIL_LEVEL'}, 0); | |
27 | |
28 # Avoid "Use of uninitialized value" warning messages. | |
29 sub ValueOrDefault { | |
30 my ($value, $default) = @_; | |
31 return ($value ? $value : $default); | |
32 } | |
33 | |
34 if ( $Debug >= 5 ) { | |
35 print STDERR "\n\nDEBUG: Inside NAMED Filter \n\n"; | |
36 $DebugCounter = 1; | |
37 } | |
38 | |
39 | |
40 while (defined($ThisLine = <STDIN>)) { | |
41 if ( $Debug >= 30 ) { | |
42 print STDERR "DEBUG($DebugCounter): $ThisLine"; | |
43 $DebugCounter++; | |
44 } | |
45 | |
46 if ( | |
47 ($ThisLine =~ /RR negative cache entry/) or | |
48 ($ThisLine =~ /ns_....: .* NS points to CNAME/) or | |
49 ($ThisLine =~ /accept: connection reset by peer/) or | |
50 ($ThisLine =~ /Connection reset by peer/) or | |
51 # typo fixed in 2004 release | |
52 ($ThisLine =~ /transfer(r)?ed serial/) or | |
53 ($ThisLine =~ /There may be a name server already running/) or | |
54 ($ThisLine =~ /exiting/) or | |
55 ($ThisLine =~ /running/) or | |
56 ($ThisLine =~ /NSTATS /) or | |
57 ($ThisLine =~ /Cleaned cache of \d+ RRs/) or | |
58 ($ThisLine =~ /USAGE \d+ \d+ CPU=\d+.*/) or | |
59 ($ThisLine =~ /XSTATS /) or | |
60 ($ThisLine =~ /Ready to answer queries/) or | |
61 ($ThisLine =~ /Forwarding source address is/) or | |
62 ($ThisLine =~ /bad referral/) or | |
63 ($ThisLine =~ /prerequisite not satisfied/) or | |
64 ($ThisLine =~ /(rcvd|Sent) NOTIFY/) or | |
65 ($ThisLine =~ /ns_resp: TCP truncated/) or | |
66 ($ThisLine =~ /No possible A RRs/) or | |
67 ($ThisLine =~ /points to a CNAME/) or | |
68 ($ThisLine =~ /dangling CNAME pointer/) or | |
69 ($ThisLine =~ /listening on/) or | |
70 ($ThisLine =~ /unrelated additional info/) or | |
71 ($ThisLine =~ /Response from unexpected source/) or | |
72 ($ThisLine =~ /No root nameservers for class IN/) or | |
73 ($ThisLine =~ /recvfrom: No route to host/) or | |
74 # Be sure to catch: transfer of 'zone' from IP#53: failed to connect: timed out | |
75 # not exact just triggers a full transfer | |
76 ($ThisLine =~ /transfer of .*: (IXFR|AXFR(|-style IXFR) (started|ended)|connected using|Transfer completed|failed while receiving responses: not exact)/) or | |
77 ($ThisLine =~ /Transfer status: success/) or | |
78 ($ThisLine =~ /using \d+ CPU/) or | |
79 ($ThisLine =~ /loading configuration/) or | |
80 ($ThisLine =~ /command channel listening/) or | |
81 ($ThisLine =~ /configuring command channel from/) or | |
82 ($ThisLine =~ /interface ignored/) or | |
83 ($ThisLine =~ /no IPv6 interfaces found/) or | |
84 ($ThisLine =~ /using \d+ UDP listeners per interface/) or | |
85 ($ThisLine =~ /^running/) or | |
86 ($ThisLine =~ /^exiting/) or | |
87 ($ThisLine =~ /no longer listening/) or | |
88 ($ThisLine =~ /the default for the .* option is now/) or | |
89 ($ThisLine =~ /stopping command channel on \S+/) or | |
90 ($ThisLine =~ /Malformed response from/) or | |
91 ($ThisLine =~ /client .* response from Internet for .*/) or | |
92 # ($ThisLine =~ /client .+ query \(cache\) '.*' denied/) or | |
93 ($ThisLine =~ /client .+(?: \([^)]+\))?: query:/) or | |
94 # Do we really want to ignore these? | |
95 #($ThisLine =~ /unknown logging category/) or | |
96 ($ThisLine =~ /could not open entropy source/) or | |
97 ($ThisLine =~ /\/etc\/rndc.key: file not found/) or | |
98 ($ThisLine =~ /sending notifies/) or | |
99 # file syntax error get reported twice and are already caught below | |
100 ($ThisLine =~ /loading master file/) or | |
101 ($ThisLine =~ /^ succeeded$/) or | |
102 ($ThisLine =~ /\*\*\* POKED TIMER \*\*\*/) or | |
103 # The message about the end of transfer is the interesting one | |
104 ($ThisLine =~ /: Transfer started./) or | |
105 ($ThisLine =~ /D-BUS service (disabled|enabled)./) or | |
106 ($ThisLine =~ /D-BUS dhcdbd subscription disabled./) or | |
107 ($ThisLine =~ /automatic empty zone/) or | |
108 ($ThisLine =~ /binding TCP socket: address in use/) or | |
109 ($ThisLine =~ /dbus_mgr initialization failed. D-BUS service is disabled./) or | |
110 ($ThisLine =~ /dbus_svc_add_filter failed/) or | |
111 ($ThisLine =~ /isc_log_open 'named.run' failed: permission denied/) or | |
112 ($ThisLine =~ /weak RSASHA1 \(5\) key found \(exponent=3\)/) or | |
113 ($ThisLine =~ /Bad file descriptor/) or | |
114 ($ThisLine =~ /open: .*: file not found/) or | |
115 ($ThisLine =~ /queries: client [\.0-9a-fA-F#:]* view localhost_resolver: query: .* IN .*/) or | |
116 ($ThisLine =~ /zone .*: NS '.*' is a CNAME \(illegal\)/) or | |
117 ($ThisLine =~ /skipping nameserver '.*' because it is a CNAME,/) or | |
118 ($ThisLine =~ /zone .*: zone serial unchanged. zone may fail to transfer to slaves/) or | |
119 ($ThisLine =~ /zone .*: loading from master file .* failed/) or | |
120 ($ThisLine =~ /zone .*: NS '.*' has no address records/) or | |
121 ($ThisLine =~ /.*: not a valid number$/) or | |
122 ($ThisLine =~ /^(.*: )?unexpected end of input/) or | |
123 ($ThisLine =~ /too many timeouts resolving '.*' .*: disabling EDNS/) or | |
124 ($ThisLine =~ /too many timeouts resolving '.*' .*: reducing the advertised EDNS UDP packet size to .* octets/) or | |
125 ($ThisLine =~ /reloading zones succeeded/) or | |
126 ($ThisLine =~ /generating session key/) or | |
127 ($ThisLine =~ /success resolving '.*' \(in '.*'?\) after disabling EDNS/) or | |
128 ($ThisLine =~ /success resolving '.*' \(in '.*'?\) after reducing the advertised EDNS UDP packet size to 512 octets/) or | |
129 ($ThisLine =~ /the working directory is not writable/) or | |
130 ($ThisLine =~ /using default UDP\/IPv[46] port range: \[[0-9]*, [0-9]*\]/) or | |
131 ($ThisLine =~ /adjusted limit on open files from [0-9]* to [0-9]*/) or | |
132 ($ThisLine =~ /using up to [0-9]* sockets/) or | |
133 ($ThisLine =~ /built with/) or | |
134 ($ThisLine =~ /TTL differs in rdataset, adjusting [0-9]* -> [0-9]*/) or | |
135 ($ThisLine =~ /max open files \([0-9]*\) is smaller than max sockets \([0-9]*\)/) or | |
136 ($ThisLine =~ /clients-per-query (?:de|in)creased to .*/) or | |
137 ($ThisLine =~ /^must-be-secure resolving '.*': .*/) or | |
138 ($ThisLine =~ /^(error \()?no valid (DS|KEY|RRSIG)\)? resolving '.*': .*/) or | |
139 ($ThisLine =~ /^not insecure resolving '.*': .*/) or | |
140 ($ThisLine =~ /^validating \@0x[[:xdigit:]]+: .* DS: must be secure failure/) or | |
141 ($ThisLine =~ /^(error \()?broken trust chain\)? resolving '.*': .*/) or | |
142 ($ThisLine =~ /journal file [^ ]* does not exist, creating it/) or | |
143 ($ThisLine =~ /serial number \(\d+\) received from master/) or | |
144 ($ThisLine =~ /zone .*: notify from .*: serial \d+/) or | |
145 ($ThisLine =~ /zone is up to date/) or | |
146 ($ThisLine =~ /refresh in progress, refresh check queued/) or | |
147 ($ThisLine =~ /refresh: NODATA response from master/) or | |
148 ($ThisLine =~ /update with no effect/) or | |
149 ($ThisLine =~ /reading built-in trusted keys from file/) or | |
150 ($ThisLine =~ /reading built-in trust anchors from file/) or | |
151 ($ThisLine =~ /using built-in trusted-keys/) or | |
152 ($ThisLine =~ /set up managed keys zone/) or | |
153 ($ThisLine =~ /managed-keys-zone.*key now trusted/) or | |
154 ($ThisLine =~ /dhcpupdate: forwarding update for zone/) or | |
155 ($ThisLine =~ /forwarded dynamic update: master [^ ]* returned: (NXRRSET|YXDOMAIN)/) or | |
156 ($ThisLine =~ /using .* as GeoIP directory/) or | |
157 ($ThisLine =~ /GEO-.* Build/) or | |
158 ($ThisLine =~ /initializing GeoIP /) or | |
159 # the following seems okay since it says "success" | |
160 ($ThisLine =~ /managed-keys-zone.*: No DNSKEY RRSIGs found for '.*': success/) or | |
161 ($ThisLine =~ /managed-keys-zone.*: Unable to fetch DNSKEY set '.*': timed out/) or | |
162 ($ThisLine =~ /^sizing zone task pool based on \d+ zones/) or | |
163 ($ThisLine =~ /^BIND \d+ is maintained by Internet Systems Consortium/) or | |
164 ($ThisLine =~ /a non-profit 501/) or | |
165 ($ThisLine =~ /corporation. Support and training for BIND \d+ are/) or | |
166 ($ThisLine =~ /available at https:\/\/www.isc.org\/support/) or | |
167 ($ThisLine =~ /----------------------------------------------------/) or | |
168 ($ThisLine =~ /next key event: /) or | |
169 ($ThisLine =~ /reconfiguring zone keys/) or | |
170 ($ThisLine =~ /using built-in DLV key/) or | |
171 # ($ThisLine =~ /reading built-in trusted keys from file/) or | |
172 ($ThisLine =~ /all zones loaded/) or | |
173 ($ThisLine =~ /resolver priming query complete/) or | |
174 ($ThisLine =~ /client .* signer .* approved/) or | |
175 ($ThisLine =~ /stop limiting/) or | |
176 # ignore this line because the following line describes the error | |
177 ($ThisLine =~ /unexpected error/) | |
178 ) { | |
179 # Don't care about these... | |
180 } elsif ( | |
181 ($ThisLine =~ /starting\..*named/) or | |
182 ($ThisLine =~ /starting BIND/) or | |
183 ($ThisLine =~ /named startup succeeded/) | |
184 ) { | |
185 $StartNamed++; | |
186 } elsif ( $ThisLine =~ /(reloading nameserver|named reload succeeded)/ ) { | |
187 $ReloadNamed++; | |
188 } elsif ( | |
189 ($ThisLine =~ /shutting down/) or | |
190 ($ThisLine =~ /named shutting down/ ) or | |
191 ($ThisLine =~ /named shutdown succeeded/ ) | |
192 ) { | |
193 $ShutdownNamed++; | |
194 } elsif ( $ThisLine =~ /named shutdown failed/ ) { | |
195 $ShutdownNamedFail++; | |
196 } elsif ( (($Host, $Zone) = ( $ThisLine =~ /client ([^\#]+)#[^\:]+: (?:view \w+: )?zone transfer '(.+)' denied/ )) or | |
197 (($Host, $Zone) = ( $ThisLine =~ /client ([^\#]+)#[^\:]+: (?:view \w+: )?bad zone transfer request: '(.+)':/ )) ) { | |
198 $DeniedZoneTransfers{$Host}{$Zone}++; | |
199 } elsif ( ($Zone) = ( $ThisLine =~ /zone (.+) zone transfer deferred due to quota/ ) ) { | |
200 $DeferredZoneTransfers{$Zone}++; | |
201 } elsif ( ($Zone, $Host) = ( $ThisLine =~ /transfer of '(.+)' from ([^\#]+)#[^\:]+: (failed|(Transfer status|giving up): ((network|host) unreachable|timed out|connection refused))/ ) ) { | |
202 $FailedZoneTransfers{$Host}{$Zone}++; | |
203 } elsif ( ($Zone) = ( $ThisLine =~ /cache zone \"(.*)\" loaded/ ) ) { | |
204 $ZoneLoaded{"cache $Zone"}++; | |
205 } elsif ( ($Zone) = ( $ThisLine =~ /cache zone \"(.*)\" .* loaded/ ) ) { | |
206 $ZoneLoaded{"cache $Zone"}++; | |
207 } elsif ( ($Zone) = ( $ThisLine =~ /automatic empty zone: (.*)/ ) ) { | |
208 $ZoneLoaded{"automatic empty zone $Zone"}++; | |
209 } elsif ( ($Zone) = ( $ThisLine =~ /primary zone \"(.+)\" loaded/ ) ) { | |
210 $ZoneLoaded{$Zone}++; | |
211 } elsif ( ($Zone) = ( $ThisLine =~ /master zone \"(.+)\" .* loaded/ ) ) { | |
212 $ZoneLoaded{$Zone}++; | |
213 } elsif ( ($Zone) = ( $ThisLine =~ /secondary zone \"(.+)\" loaded/ ) ) { | |
214 $ZoneLoaded{"secondary $Zone"}++; | |
215 } elsif ( ($Zone) = ( $ThisLine =~ /slave zone \"(.+)\" .* loaded/ ) ) { | |
216 $ZoneLoaded{"secondary $Zone"}++; | |
217 } elsif ( ($Zone) = ( $ThisLine =~ /zone (.+): expired/ ) ) { | |
218 $ZoneExpired{$Zone}++; | |
219 } elsif ( ($Zone) = ( $ThisLine =~ /zone (.+): loaded serial/ ) ) { | |
220 $ZoneLoaded{$Zone}++; | |
221 } elsif ( ($Zone) = ( $ThisLine =~ /(managed-keys-zone.*): loaded serial/ ) ) { | |
222 $ZoneLoaded{$Zone}++; | |
223 } elsif ( (undef,$Addr,$Server) = ( $ThisLine =~ /(C|c)onnection refused\)? resolving '(.+)': (.+)/ ) ) { | |
224 $ConnectionRefused{$Addr}{$Server}++; | |
225 } elsif ( (undef,$Addr,undef,$Server) = ( $ThisLine =~ /ame server (on|resolving) '(.+)' \(in .+\):\s+(\[.+\]\.\d+)?\s*'?(.+)'?:?/ ) ) { | |
226 $LameServer{$Addr}{$Server}++; | |
227 } elsif ( (($Zone) = ( $ThisLine =~ /Zone \"(.+)\" was removed/ )) or | |
228 (($Zone) = ( $ThisLine =~ /zone (.+): \(.*\) removed/ )) ) { | |
229 $ZoneRemoved{$Zone}++; | |
230 } elsif ( ($Zone) = ( $ThisLine =~ /received notify for zone '(.*)'/ ) ) { | |
231 $ZoneReceivedNotify{$Zone}++; | |
232 } elsif ( ($Zone) = ( $ThisLine =~ /zone (.+): refused notify from non-master/ ) ) { | |
233 $ZoneRefusedNotify{$Zone}++; | |
234 # } elsif ( ($Rhost,$Ldom,$Reason) = ( $ThisLine =~ /client ([\d\.a-fA-F:]+) bad zone transfer request: '(.+)': (.+)$/ ) ) { | |
235 } elsif ( ($Rhost,$Ldom,$Reason) = ( $ThisLine =~ /client ([\.0-9a-fA-F:]+)#\d+: bad zone transfer request: '(.+)': (.+)/ ) ) { | |
236 $BadZone{$Reason}{"$Rhost ($Ldom)"}++; | |
237 } elsif ( ($Host) = ( $ThisLine =~ /([^ ]+) has CNAME and other data \(invalid\)/ ) ) { | |
238 push @CNAMEAndOther, $Host; | |
239 } elsif ( ($File,$Line,$Entry,$Error) = ( $ThisLine =~ /dns_master_load: ([^:]+):(\d+): ([^ ]+): (.+)$/ ) ) { | |
240 $ZoneFileErrors{$File}{"$Entry: $Error"}++; | |
241 } elsif ( ($File,$Line,$Entry,$Error) = ( $ThisLine =~ /warning: ([^:]+):(\d+): (.+)$/ ) ) { | |
242 $ZoneFileErrors{$File}{"file does not end with newline: $Error"}++; | |
243 } elsif ( ($Way,$Host) = ( $ThisLine =~ /([^ ]+): sendto\(\[([^ ]+)\].+\): Network is unreachable/ ) ) { | |
244 $FullHost = LookupIP ($Host); | |
245 $NetworkUnreachable{$Way}{$FullHost}++; | |
246 } elsif ( ($Host,$Way) = ( $ThisLine =~ /client (?:\@0x[0-9a-fA-F]+ )?(.*)#\d+(?: \(.*\))?: (?:view \w+: )?error ([^ ]+) response: network unreachable/ ) ) { | |
247 $FullHost = LookupIP ($Host); | |
248 $NetworkUnreachable{$Way}{$FullHost}++; | |
249 } elsif ( ($Zone,$Message) = ( $ThisLine =~ /client [^\#]+#[^\:]+: (?:view \w+: )?updating zone '([^\:]+)': (.*)$/ ) ) { | |
250 $ZoneUpdates{$Zone}{$Message}++; | |
251 } elsif ( ($Host,$Zone) = ( $ThisLine =~ /approved AXFR from \[(.+)\]\..+ for \"(.+)\"/ ) ) { | |
252 $FullHost = LookupIP ($Host); | |
253 $AXFR{$Zone}{$FullHost}++; | |
254 } elsif ( ($Client) = ( $ThisLine =~ /warning: client (.*) no more TCP clients/ ) ) { | |
255 $FullClient = LookupIP ($Client); | |
256 $DeniedTCPClient{$FullClient}++; | |
257 } elsif ( ($Client) = ( $ThisLine =~ /client (?:\@0x[0-9a-fA-F]+ )?(.*)#\d+(?: \(.*\))?: (?:view \w+: )?query \(cache\) (?:'.*' )?denied/ ) ) { | |
258 $FullClient = LookupIP ($Client); | |
259 $DeniedQuery{$FullClient}++; | |
260 } elsif ( ($Client) = ( $ThisLine =~ /client (?:\@0x[0-9a-fA-F]+ )?([^#]*)(#\d+)?(?: \(.*\))?: query '.*' denied/ ) ) { | |
261 $FullClient = LookupIP ($Client); | |
262 $DeniedQueryNoCache{$FullClient}++; | |
263 } elsif ( ($Rhost, $ViewName, $Ldom) = ($ThisLine =~ /client (?:\@0x[0-9a-fA-F]+ )?([\.0-9a-fA-F:]+)#\d+: (?:view (\w+): )?update '(.*)' denied/)) { | |
264 $ViewName = ($ViewName ? "/$ViewName" : ""); | |
265 $UpdateDenied{"$Rhost ($Ldom$ViewName)"}++; | |
266 } elsif ( ($Rhost, $Ldom) = ($ThisLine =~ /client ([\d\.]+)#\d+: update forwarding '(.*)' denied/)) { | |
267 $UpdateForwardingDenied{"$Rhost ($Ldom)"}++; | |
268 } elsif ( ($Zone) = ($ThisLine =~ /zone '([0-9a-zA-Z.-]+)' allows updates by IP address, which is insecure/)) { | |
269 $InsecUpdate{$Zone}++; | |
270 } elsif ( ($Zone) = ($ThisLine =~ /zone ([0-9a-zA-Z.\/-]+): journal rollforward failed: journal out of sync with zone/)) { | |
271 $JournalFail{$Zone}++; | |
272 } elsif ( ($Zone) = ($ThisLine =~ /(managed-keys-zone.*): journal file is out of date: removing journal file/)) { | |
273 $JournalFail{$Zone}++; | |
274 } elsif ( ($Channel,$Reason) = ($ThisLine =~ /couldn't add command channel (.+#\d+): (.*)$/)) { | |
275 $ChannelAddFail{$Channel}{$Reason}++; | |
276 } elsif ( ($Zone,$Host,undef,$Reason) = ($ThisLine =~ /zone ([^ ]*): refresh: failure trying master ([^ ]*)#\d+( \(source .*\))?: (.*)/) ) { | |
277 $MasterFailure{"$Zone from $Host"}{$Reason}++; | |
278 } elsif ( ($Zone,$Reason,$Host) = ($ThisLine =~ /zone ([^ ]*): refresh: unexpected rcode \((.*)\) from master ([^ ]*)#\d+/) ) { | |
279 $MasterFailure{"$Zone from $Host"}{$Reason}++; | |
280 } elsif ( ($Zone) = ($ThisLine =~ /zone ([^\/]+)\/.+: refresh: non-authoritative answer from master/)) { | |
281 $NonAuthoritative{$Zone}++; | |
282 } elsif ( ($Zone) = ($ThisLine =~ /zone ([^\/]+)\/.+: refresh: retry limit for master \S+ exceeded/) ) { | |
283 $RetryLimit{$Zone}++; | |
284 } elsif ( ($Rcode, $Zone, $Host) = ($ThisLine =~ /(?:error \()?unexpected RCODE\)? \(?(.*?)\)? resolving '(.*)': (.*)$/) ){ | |
285 $UnexpRCODE{$Rcode}{$Zone}{$Host}++; | |
286 } elsif ( ($Rcode, $Zone, $Host) = ($ThisLine =~ /(.*) unexpected RCODE resolving '(.*)': (.*)$/) ){ | |
287 $UnexpRCODE{$Rcode}{$Zone}{$Host}++; | |
288 } elsif ( ($ThisLine =~ /(?:error \()?FORMERR\)? resolving '[^ ]+: [.0-9a-fA-F:#]+/) or | |
289 ($ThisLine =~ /DNS format error from [^ ]+ resolving [^ ]+( for client [^ ]+)?: .*/) ) { | |
290 chomp($ThisLine); | |
291 $FormErr{$ThisLine}++; | |
292 } elsif ( ($ThisLine =~ /found [0-9]* CPU(s)?, using [0-9]* worker thread(s)?/) ) { | |
293 chomp($ThisLine); | |
294 $StartLog{$ThisLine}++; | |
295 } elsif ( (($File,$Line,$Problem) = ($ThisLine =~ /\/etc\/(rndc.key|named.conf):([0-9]+): (unknown option '[^ ]*')/)) or | |
296 (($File,$Line,$Problem) = ($ThisLine =~ /\/etc\/(rndc.key|named.conf):([0-9]+): ('[^ ]' expected near end of file)/)) or | |
297 (($File,$Line,$Problem) = ($ThisLine =~ /\/etc\/(named.*.conf):([0-9]+): (.*)/)) or | |
298 (($File,$Line,$Problem) = ($ThisLine =~ /()()(could not configure root hints from '.*': file not found)/))) { | |
299 $ConfProb{$File}{"$Line,$Problem"}++; | |
300 } elsif ( (($ErrorText) = ($ThisLine =~ /^(RUNTIME_CHECK.*)/))or | |
301 (($ErrorText) = ($ThisLine =~ /^(.* REQUIRE.* failed.*)$/)) or | |
302 (($ErrorText) = ($ThisLine =~ /(.*: fatal error)/)) or | |
303 (($ErrorText) = ($ThisLine =~ /(.*: out of memory)/)) ) { | |
304 $NError{$ErrorText}++; | |
305 } elsif ( (($ErrorText) = ($ThisLine =~ /^(GeoIP .* DB not available)/)) ) { | |
306 $GeoIPError{$ErrorText}++; | |
307 } elsif ( (($ErrorText) = ($ThisLine =~ /^(internal_accept: fcntl\(\) failed: Too many open files)/)) or | |
308 (($ErrorText) = ($ThisLine =~ /^(socket: too many open file descriptors)/)) ) { | |
309 $ErrOpenFiles{$ErrorText}++; | |
310 } elsif ( ($From,$Log) = ($ThisLine =~ /invalid command from ([\.0-9a-fA-F:]*)#[0-9]*: (.*)/) ) { | |
311 $CCMessages{"$From,$Log"}++; | |
312 } elsif ( (($Log) = ($ThisLine =~ /(freezing .*zone.*)/)) or | |
313 (($Log) = ($ThisLine =~ /(thawing .*zone.*)/)) ) { | |
314 $CCMessages2{$Log}++; | |
315 } elsif (($CCC) = ($ThisLine =~ /unknown control channel command '(.*)'/)) { | |
316 $UnknownCCCommands{$CCC}++; | |
317 } elsif (($CCC) = ($ThisLine =~ /received control channel command '(.*)'/)) { | |
318 $CCCommands{$CCC}++; | |
319 } elsif (($Name,$Address) = ($ThisLine =~ /(?:error \()?network unreachable\)? resolving '(.*)': (.*)/)) { | |
320 $NUR{$Name}{$Address}++; | |
321 } elsif (($Name,$Address) = ($ThisLine =~ /(?:error \()?host unreachable\)? resolving '(.*)': (.*)/)) { | |
322 $HUR{$Name}{$Address}++; | |
323 } elsif (($Client) = ($ThisLine =~ /client ([\da-fA-F.:]+)(?:#\d*:)? notify question section contains no SOA/)) { | |
324 $NoSOA{$Client}++; | |
325 } elsif (($Hint) = ($ThisLine =~ /checkhints: (.*)/) ) { | |
326 $Hints{$Hint}++; | |
327 } elsif (($Response,$Net,$Zone) = ($ThisLine =~/limit (.+) responses to (\S+)(?: for (.+) \()?/)) { | |
328 $Zone = "None" unless defined($Zone); | |
329 $Limit{$Zone}{$Response}{$Net}++; | |
330 } elsif (($Client,$Response,$Net,$Zone) = ($ThisLine =~/client ([^#]+)(?:#\d+)? \(.*\): (?:view \w+: )?rate limit drop (.+) response to (\S+)(?: for (\S+))?/)) { | |
331 $Zone = "None" unless defined($Zone); | |
332 $LimitDrop{$Zone}{$Response}{$Net}{$Client}++; | |
333 } elsif (($Client,$Response,$Net,$Zone) = ($ThisLine =~/client ([^#]+)(?:#\d+)? \(.*\): (?:view \w+: )?rate limit slip (.+) response to (\S+)(?: for (\S+))?/)) { | |
334 $Zone = "None" unless defined($Zone); | |
335 $LimitSlip{$Zone}{$Response}{$Net}{$Client}++; | |
336 } elsif (($Net,$Zone,$Response) = ($ThisLine =~/limit responses to (\S+)(?: for (\S+))? (.*) +\(/)) { | |
337 $Zone = "None" unless defined($Zone); | |
338 $Limit{$Zone}{$Response}{$Net}++; | |
339 } elsif (($Client,$Net,$Zone,$Response) = ($ThisLine =~/client ([^#]+)(?:#\d+)? \(.*\): (?:view \w+: )?rate limit drop response to (\S+)(?: for (\S+))? (.*) +\(/)) { | |
340 $Zone = "None" unless defined($Zone); | |
341 $LimitDrop{$Zone}{$Response}{$Net}{$Client}++; | |
342 } elsif (($Client,$Net,$Zone,$Response) = ($ThisLine =~/client ([^#]+)(?:#\d+)? \(.*\): (?:view \w+: )?rate limit slip response to (\S+)(?: for (\S+))? (.*) +\(/)) { | |
343 $Zone = "None" unless defined($Zone); | |
344 $LimitSlip{$Zone}{$Response}{$Net}{$Client}++; | |
345 } elsif (($Zone,$RR) = ($ThisLine =~ /^\s*validating \@0x[[:xdigit:]]+: (.*) (\w+): got insecure response; parent indicates it should be secure/)) { | |
346 $DNSSECInsec{'__Total__'}++; | |
347 $DNSSECInsec{$Zone}{$RR}++; | |
348 } elsif (($Zone,$RR) = ($ThisLine =~ /^\s*validating \@0x[[:xdigit:]]+: (.*) (\w+): no valid signature found/)) { | |
349 $DNSSECInvalid{'__Total__'}++; | |
350 $DNSSECInvalid{$Zone}{$RR}++; | |
351 } elsif (($Zone,$RR) = ($ThisLine =~ /^\s*validating \@0x[[:xdigit:]]+: (.*) (\w+): bad cache hit/)) { | |
352 $DNSSECBadCache{'__Total__'}++; | |
353 $DNSSECBadCache{$Zone}{$RR}++; | |
354 } elsif (($Zone,$RR) = ($ThisLine =~ /^\s*validating \@0x[[:xdigit:]]+: (.*) (\w+): verify failed due to bad signature/)) { | |
355 $DNSSECInvalid{'__Total__'}++; | |
356 $DNSSECInvalid{$Zone}{$RR}++; | |
357 } elsif (($Zone,$RR) = ($ThisLine =~ /^\s*validating ([^\/]*)\/(\w+): got insecure response; parent indicates it should be secure/)) { | |
358 $DNSSECInsec{'__Total__'}++; | |
359 $DNSSECInsec{$Zone}{$RR}++; | |
360 } elsif (($Zone,$RR) = ($ThisLine =~ /^\s*validating ([^\/]*)\/(\w+): no valid signature found/)) { | |
361 $DNSSECInvalid{'__Total__'}++; | |
362 $DNSSECInvalid{$Zone}{$RR}++; | |
363 } elsif (($Zone,$RR) = ($ThisLine =~ /^\s*validating ([^\/]*)\/(\w+): verify failed due to bad signature/)) { | |
364 $DNSSECInvalid{'__Total__'}++; | |
365 $DNSSECInvalid{$Zone}{$RR}++; | |
366 } elsif (($Zone,$RR) = ($ThisLine =~ /^\s*validating ([^\/]*)\/(\w+): bad cache hit/)) { | |
367 $DNSSECBadCache{'__Total__'}++; | |
368 $DNSSECBadCache{$Zone}{$RR}++; | |
369 } elsif (($Error,$Host) = ($ThisLine =~ /^(?:error \()?(.*)\)? resolving '([^']+)':/)) { | |
370 $DNSSECError{$Error}{'__Total__'}++; | |
371 $DNSSECError{$Error}{$Host}++; | |
372 } elsif ($ThisLine =~ /^samba_dlz:/) { | |
373 if ( ($Rhost, $Error) = ($ThisLine =~ /disallowing update of signer=.* name=(.*) type=.* error=(.*)/ )) { | |
374 $UpdateDenied{"$Rhost ($Error)"}++; | |
375 } | |
376 # ignore rest of samba4 dlz entries for now | |
377 } else { | |
378 # Report any unmatched entries... | |
379 # remove PID from named messages | |
380 $ThisLine =~ s/(client [\.0-9a-fA-F:]+)\S+/$1/; | |
381 chomp($ThisLine); | |
382 $OtherList{$ThisLine}++; | |
383 } | |
384 } | |
385 | |
386 ####################################### | |
387 | |
388 if ( keys %ZoneExpired ) { | |
389 print "\nZones expired:\n"; | |
390 foreach $ThisOne (sort {$a cmp $b} keys %ZoneExpired) { | |
391 print " $ThisOne: $ZoneExpired{$ThisOne} Time(s)\n"; | |
392 } | |
393 } | |
394 | |
395 if ( keys %FailedZoneTransfers ) { | |
396 print "\nFailed Zone Transfers:\n"; | |
397 foreach my $Host (keys %FailedZoneTransfers) { | |
398 print " $Host:\n"; | |
399 foreach my $Zone (keys %{$FailedZoneTransfers{$Host}}) { | |
400 print " $Zone: $FailedZoneTransfers{$Host}{$Zone} Time(s)\n"; | |
401 } | |
402 } | |
403 } | |
404 | |
405 if ( keys %DeniedZoneTransfers ) { | |
406 print "\nDenied Zone Transfers:\n"; | |
407 foreach my $Host (keys %DeniedZoneTransfers) { | |
408 print " $Host:\n"; | |
409 foreach my $Zone (keys %{$DeniedZoneTransfers{$Host}}) { | |
410 print " $Zone: $DeniedZoneTransfers{$Host}{$Zone} Time(s)\n"; | |
411 } | |
412 } | |
413 } | |
414 | |
415 if ( keys %UpdateDenied ) { | |
416 print "\nZone update refused:\n"; | |
417 foreach $ThisOne (sort {$a cmp $b} keys %UpdateDenied) { | |
418 print " $ThisOne: $UpdateDenied{$ThisOne} Time(s)\n"; | |
419 } | |
420 } | |
421 | |
422 if ( keys %UpdateForwardingDenied ) { | |
423 print "\nZone update forwarding refused:\n"; | |
424 foreach $ThisOne (sort {$a cmp $b} keys %UpdateForwardingDenied) { | |
425 print " $ThisOne: $UpdateForwardingDenied{$ThisOne} Time(s)\n"; | |
426 } | |
427 } | |
428 | |
429 if ( keys %InsecUpdate ) { | |
430 print "\nInsecure zones (dynamic update allowed by IP address):\n"; | |
431 foreach $ThisOne (sort {$a cmp $b} keys %InsecUpdate) { | |
432 print " " . $ThisOne . ": " . $InsecUpdate{$ThisOne} . " Time(s)\n"; | |
433 } | |
434 } | |
435 | |
436 if ( keys %JournalFail ) { | |
437 print "\nJournal update failed:\n"; | |
438 foreach $ThisOne (sort {$a cmp $b} keys %JournalFail) { | |
439 print " " . $ThisOne . ": " . $JournalFail{$ThisOne} . " Time(s)\n"; | |
440 } | |
441 } | |
442 | |
443 if (keys %ConfProb) { | |
444 print "\nErrors in configuration files\n"; | |
445 foreach $File (sort keys %ConfProb) { | |
446 if ($File =~ /.+/) { | |
447 print " file " . $File . "\n"; | |
448 foreach (keys %{$ConfProb{$File}}) { | |
449 ($Line,$Problem) = split ","; | |
450 print " " . $File . ":" . "$Line" . ": " . $Problem . ": " . $ConfProb{$File}{"$Line,$Problem"} . " Time(s)\n"; | |
451 } | |
452 } | |
453 else { | |
454 foreach (keys %{$ConfProb{$File}}) { | |
455 ($Line,$Problem) = split ","; | |
456 print " " . $Problem . ": " . $ConfProb{$File}{"$Line,$Problem"} . " Time(s)\n"; | |
457 } | |
458 } | |
459 } | |
460 } | |
461 | |
462 if (keys %NError) { | |
463 print "\nErrors:\n"; | |
464 foreach $ThisOne (keys %NError) { | |
465 print " " . $ThisOne . ": " . $NError{$ThisOne} . " Time(s)\n"; | |
466 } | |
467 } | |
468 | |
469 if (keys %ErrOpenFiles) { | |
470 print "\nThe following seams to be caused by the patches for CVE-2008-1447."; | |
471 print "\nPlease update your bind.\n"; | |
472 foreach $ThisOne (keys %ErrOpenFiles) { | |
473 print " " . $ThisOne . ": " . $ErrOpenFiles{$ThisOne} . " Time(s)\n"; | |
474 } | |
475 } | |
476 | |
477 if (keys %Limit) { | |
478 print "\nRate Limiting occurred for:\n"; | |
479 foreach $Zone (keys %Limit) { | |
480 print " $Zone:\n"; | |
481 foreach $Response (keys %{$Limit{$Zone}}) { | |
482 print " $Response:\n"; | |
483 foreach $Net (keys %{$Limit{$Zone}{$Response}}) { | |
484 print " $Net: $Limit{$Zone}{$Response}{$Net} Time(s)\n"; | |
485 foreach $Client (keys %{$LimitDrop{$Zone}{$Response}{$Net}}) { | |
486 print " Dropped $Client: $LimitDrop{$Zone}{$Response}{$Net}{$Client} Time(s)\n"; | |
487 } | |
488 foreach $Client (keys %{$LimitSlip{$Zone}{$Response}{$Net}}) { | |
489 print " Slipped $Client: $LimitSlip{$Zone}{$Response}{$Net}{$Client} Time(s)\n"; | |
490 } | |
491 } | |
492 } | |
493 } | |
494 } | |
495 | |
496 if ( ( $Detail >= 5 ) and (keys %GeoIPError) ) { | |
497 print "\nGeoIP Errors:\n"; | |
498 foreach $ThisOne (keys %GeoIPError) { | |
499 print " " . $ThisOne . ": " . $GeoIPError{$ThisOne} . " Time(s)\n"; | |
500 } | |
501 } | |
502 | |
503 if ((keys %CCMessages) or (keys %CCMessages2)){ | |
504 print "\nMessages from control channel\n"; | |
505 foreach (keys %CCMessages) { | |
506 ($From,$Log) = split ","; | |
507 print " " . $From . ": " . $Log . ": " . $CCMessages{"$From,$Log"} . " Time(s)\n"; | |
508 } | |
509 foreach $ThisOne (keys %CCMessages2) { | |
510 print " " . $ThisOne . ": " . $CCMessages2{$ThisOne} . " Time(s)\n"; | |
511 } | |
512 } | |
513 | |
514 if ( ( $Detail >= 5 ) and ($StartNamed) ) { | |
515 print "\nNamed started: $StartNamed Time(s)\n"; | |
516 } | |
517 | |
518 if ( ( $Detail >= 5 ) and ($ReloadNamed) ) { | |
519 print "Named reloaded: $ReloadNamed Time(s)\n"; | |
520 } | |
521 | |
522 if ( ( $Detail >= 5 ) and ($ShutdownNamed) ) { | |
523 print "Named shutdown: $ShutdownNamed Time(s)\n"; | |
524 } | |
525 | |
526 if ( ( $Detail >= 5 ) and ($ShutdownNamedFail) ) { | |
527 print "Named shutdown failed: $ShutdownNamedFail Time(s)\n"; | |
528 } | |
529 | |
530 if ( ( $Detail >= 5 ) and (keys %ZoneLoaded) ) { | |
531 print "\nLoaded Zones:\n"; | |
532 foreach $ThisOne (sort {$a cmp $b} keys %ZoneLoaded) { | |
533 print " $ThisOne: $ZoneLoaded{$ThisOne} Time(s)\n"; | |
534 } | |
535 } | |
536 | |
537 if ( ( $Detail >= 5 ) and (keys %ZoneReceivedNotify) ) { | |
538 print "\nZones receiving notify:\n"; | |
539 foreach $ThisOne (sort {$a cmp $b} keys %ZoneReceivedNotify) { | |
540 print " $ThisOne: $ZoneReceivedNotify{$ThisOne} Time(s)\n"; | |
541 } | |
542 } | |
543 | |
544 if ( ( $Detail >= 5 ) and (keys %ZoneRefusedNotify) ) { | |
545 print "\nZones refused notify:\n"; | |
546 foreach $ThisOne (sort {$a cmp $b} keys %ZoneRefusedNotify) { | |
547 print " $ThisOne: $ZoneRefusedNotify{$ThisOne} Time(s)\n"; | |
548 } | |
549 } | |
550 | |
551 if ( ($Detail >= 5) and (keys %ChannelAddFail) ) { | |
552 print "\nCan't add command channel:\n"; | |
553 foreach $Channel (sort {$a cmp $b} keys %ChannelAddFail) { | |
554 print " $Channel:\n"; | |
555 foreach $Reason (sort {$a cmp $b} keys %{$ChannelAddFail{$Channel}}) { | |
556 print " $Reason: $ChannelAddFail{$Channel}{$Reason} Time(s)\n"; | |
557 } | |
558 } | |
559 } | |
560 | |
561 if ( ($Detail >= 5) and (keys %MasterFailure) ) { | |
562 print "\nFailure trying to refresh zone:\n"; | |
563 foreach $Zone (sort {$a cmp $b} keys %MasterFailure) { | |
564 print " $Zone:\n"; | |
565 foreach $Reason (sort {$a cmp $b} keys %{$MasterFailure{$Zone}}) { | |
566 print " $Reason: $MasterFailure{$Zone}{$Reason} Time(s)\n"; | |
567 } | |
568 } | |
569 } | |
570 | |
571 if ( ( $Detail >= 5 ) and (keys %DeferredZoneTransfers) ) { | |
572 print "\nDeferred Zone Transfers:\n"; | |
573 foreach my $Zone (keys %DeferredZoneTransfers) { | |
574 print " $Zone: $DeferredZoneTransfers{$Zone} Time(s)\n"; | |
575 } | |
576 } | |
577 | |
578 if ( ( $Detail >= 5 ) and (keys %ZoneRemoved) ) { | |
579 print "\nRemoved Zones:\n"; | |
580 foreach $ThisOne (sort {$a cmp $b} keys %ZoneRemoved) { | |
581 print " $ThisOne: $ZoneRemoved{$ThisOne} Time(s)\n"; | |
582 } | |
583 } | |
584 | |
585 if ( ( $Detail >= 5 ) and (keys %AXFR) ) { | |
586 print "\nZone Transfers:\n"; | |
587 foreach $ThisOne (keys %AXFR) { | |
588 print " Zone: $ThisOne\n"; | |
589 foreach $Temp (keys %{$AXFR{$ThisOne}}) { | |
590 print " by $Temp: $AXFR{$ThisOne}{$Temp} Time(s)\n"; | |
591 } | |
592 } | |
593 } | |
594 | |
595 if ( ( $Detail >= 10 ) and (keys %BadZone) ) { | |
596 print "\nBad Zone Transfer Request:\n"; | |
597 foreach $Reason (keys %BadZone) { | |
598 print " Reason: $Reason\n"; | |
599 foreach $ThisOne (sort {$a cmp $b} (keys %{$BadZone{$Reason}}) ) { | |
600 print " $ThisOne: $BadZone{$Reason}{$ThisOne} Time(s)\n"; | |
601 } | |
602 } | |
603 } | |
604 | |
605 if ( ( $Detail >= 5 ) and (keys %DeniedTCPClient) ) { | |
606 print "\nno more TCP clients warning:\n"; | |
607 foreach $ThisOne (keys %DeniedTCPClient) { | |
608 print " from $ThisOne: $DeniedTCPClient{$ThisOne} Time(s)\n"; | |
609 } | |
610 } | |
611 | |
612 if ( ( $Detail >= 5 ) and (keys %DeniedQuery) ) { | |
613 print "\nQueries (cached) that were denied:\n"; | |
614 foreach $ThisOne (keys %DeniedQuery) { | |
615 print " from $ThisOne: $DeniedQuery{$ThisOne} Time(s)\n"; | |
616 } | |
617 } | |
618 | |
619 if ( ( $Detail >= 10 ) and (keys %DeniedQueryNoCache) ) { | |
620 print "\nQueries (not cached) that were denied:\n"; | |
621 foreach $ThisOne (sort {$a cmp $b} keys %DeniedQueryNoCache) { | |
622 print " from $ThisOne: $DeniedQueryNoCache{$ThisOne} Time(s)\n"; | |
623 } | |
624 } | |
625 | |
626 if ( ( $Detail >= 10 ) and (@CNAMEAndOther) ) { | |
627 print "\nThese hosts have CNAME and other data (invalid):\n"; | |
628 foreach $ThisOne (@CNAMEAndOther) { | |
629 print " $ThisOne\n"; | |
630 } | |
631 } | |
632 | |
633 if ( ( $Detail >= 5 ) and (keys %ZoneFileErrors) ) { | |
634 print "\nSyntax errors in zone files:\n"; | |
635 for $File (keys %ZoneFileErrors) { | |
636 print " $File\n"; | |
637 for $Error ( keys %{$ZoneFileErrors{$File}} ) { | |
638 print " \"$Error\" " . $ZoneFileErrors{$File}{$Error} . " Time(s)\n"; | |
639 } | |
640 } | |
641 } | |
642 | |
643 if ( ( $Detail >= 10 ) and (keys %ConnectionRefused) ) { | |
644 print "\nConnection refused resolving:\n"; | |
645 foreach $Addr (sort keys %ConnectionRefused) { | |
646 print " $Addr:\n"; | |
647 foreach $Server (sort SortIP keys %{$ConnectionRefused{$Addr}}) { | |
648 print " $Server: $ConnectionRefused{$Addr}{$Server} Time(s)\n"; | |
649 } | |
650 } | |
651 } | |
652 | |
653 if ( ( $Detail >= 10 ) and (keys %LameServer) ) { | |
654 print "\nThese addresses had lame server references:\n"; | |
655 foreach $Addr (sort keys %LameServer) { | |
656 print " $Addr:\n"; | |
657 foreach $Server (sort SortIP keys %{$LameServer{$Addr}}) { | |
658 print " $Server: $LameServer{$Addr}{$Server} Time(s)\n"; | |
659 } | |
660 } | |
661 } | |
662 | |
663 if ( ( $Detail >= 10 ) and (keys %NonAuthoritative) ) { | |
664 print "\nNon-authoritative answer from master for these zones:\n"; | |
665 foreach $ThisOne (keys %NonAuthoritative) { | |
666 print " " . $ThisOne . ": " . $NonAuthoritative{$ThisOne} . " Time(s)\n"; | |
667 } | |
668 } | |
669 | |
670 if ( ($Detail >= 10) and (keys %RetryLimit) ) { | |
671 print "\nRetry limit exceeded for these zones:\n"; | |
672 foreach $Zone (sort {$a cmp $b} keys %RetryLimit) { | |
673 print " $Zone: $RetryLimit{$Zone} Time(s)\n"; | |
674 } | |
675 } | |
676 | |
677 if ( ($Detail >= 10) and (keys %NoSOA) ) { | |
678 print "\nNotify question sections of these clients contained no SOA:\n"; | |
679 foreach $Client (sort {$a cmp $b} keys %NoSOA) { | |
680 print " $Client: $NoSOA{$Client} Time(s)\n"; | |
681 } | |
682 } | |
683 | |
684 if ( ( $Detail >= 10 ) and (keys %NetworkUnreachable) ) { | |
685 print "\nNetwork is unreachable for:\n"; | |
686 foreach $ThisOne (sort {$a cmp $b} keys %NetworkUnreachable) { | |
687 print " $ThisOne:\n"; | |
688 foreach $Host (sort {$a cmp $b} keys %{$NetworkUnreachable{$ThisOne}}) { | |
689 print " $Host: $NetworkUnreachable{$ThisOne}{$Host} Time(s)\n"; | |
690 } | |
691 } | |
692 } | |
693 | |
694 if ( ( $Detail >= 10 ) and (keys %NUR) ) { | |
695 print "\nNetwork unreachable resolving for:\n"; | |
696 foreach $ThisOne (sort {$a cmp $b} keys %NUR) { | |
697 print " $ThisOne:\n"; | |
698 foreach $Host (sort {$a cmp $b} keys %{$NUR{$ThisOne}}) { | |
699 print " $Host: $NUR{$ThisOne}{$Host} Time(s)\n"; | |
700 } | |
701 } | |
702 } | |
703 | |
704 if ( ( $Detail >= 10 ) and (keys %HUR) ) { | |
705 print "\nHost unreachable resolving for:\n"; | |
706 foreach $ThisOne (sort {$a cmp $b} keys %HUR) { | |
707 print " $ThisOne:\n"; | |
708 foreach $Host (sort {$a cmp $b} keys %{$HUR{$ThisOne}}) { | |
709 print " $Host: $HUR{$ThisOne}{$Host} Time(s)\n"; | |
710 } | |
711 } | |
712 } | |
713 | |
714 if ( ( $Detail >= 5 ) and (keys %ZoneUpdates) ) { | |
715 print "\nZone Updates:\n"; | |
716 foreach $ThisOne (sort {$a cmp $b} keys %ZoneUpdates) { | |
717 print " $ThisOne:\n"; | |
718 foreach $Message (sort {$a cmp $b} keys %{$ZoneUpdates{$ThisOne}}) { | |
719 print " $Message: $ZoneUpdates{$ThisOne}{$Message} Time(s)\n"; | |
720 } | |
721 } | |
722 } | |
723 | |
724 if (($Detail >= 5) and (keys %UnexpRCODE)) { | |
725 print "\nUnexpected DNS RCODEs:\n"; | |
726 foreach $ThisOne (sort {$a cmp $b} keys %UnexpRCODE) { | |
727 print " " . $ThisOne . ":\n"; | |
728 foreach $Zone (sort {$a cmp $b} keys %{$UnexpRCODE{$ThisOne}}) { | |
729 print " " . $Zone . ":\n"; | |
730 foreach $Host (sort SortIP keys %{$UnexpRCODE{$ThisOne}{$Zone}}) { | |
731 print " " . $Host . ": " . $UnexpRCODE{$ThisOne}{$Zone}{$Host} . " Time(s)\n"; | |
732 } | |
733 } | |
734 } | |
735 } | |
736 | |
737 if (($Detail >= 5) and (keys %FormErr)) { | |
738 print "\nIncorrect response format:\n"; | |
739 foreach $ThisOne (keys %FormErr) { | |
740 print " " . $ThisOne . ": " . $FormErr{$ThisOne} . " Time(s)\n"; | |
741 } | |
742 } | |
743 | |
744 if (($Detail >= 10) and (keys %StartLog)) { | |
745 print "\nNamed startup logs:\n"; | |
746 foreach $ThisOne (keys %StartLog) { | |
747 print " " . $ThisOne . ": " . $StartLog{$ThisOne} . " Time(s)\n"; | |
748 } | |
749 } | |
750 | |
751 if (($Detail and (keys %CCCommands)) or (keys %UnknownCCCommands)) { | |
752 print "\nReceived control channel commands\n"; | |
753 foreach $ThisOne (keys %CCCommands) { | |
754 print " " . $ThisOne . ": " . $CCCommands{$ThisOne} . " Time(s)\n"; | |
755 } | |
756 foreach $ThisOne (keys %UnknownCCCommands) { | |
757 print " " . $ThisOne . "(unknown command): " . $CCCommands{$ThisOne} . " Time(s)\n"; | |
758 } | |
759 } | |
760 | |
761 if (keys %Hints) { | |
762 print "\nCheckhints:\n"; | |
763 foreach $ThisOne (sort {$a cmp $b} keys %Hints) { | |
764 print " " .$ThisOne .": $Hints{$ThisOne} Time(s)\n"; | |
765 } | |
766 } | |
767 | |
768 if (($Detail >= 5) and (keys %DNSSECInsec)) { | |
769 print "\nDNSSEC Insecure Responses: " . $DNSSECInsec{'__Total__'} . " Time(s)\n"; | |
770 foreach $Zone (sort keys %DNSSECInsec) { | |
771 if (($Detail >= 10) and ($Zone =~ /.+/) and ($Zone ne '__Total__')) { | |
772 foreach $RR (sort keys %{$DNSSECInsec{$Zone}}) { | |
773 print " " . "$Zone/$RR: " . $DNSSECInsec{$Zone}{$RR} . " Time(s)\n"; | |
774 } | |
775 } | |
776 } | |
777 } | |
778 | |
779 if (($Detail >= 5) and (keys %DNSSECInvalid)) { | |
780 print "\nDNSSEC No Valid Signature: " . $DNSSECInvalid{'__Total__'} . " Time(s)\n"; | |
781 foreach $Zone (sort keys %DNSSECInvalid) { | |
782 if (($Detail >= 10) and ($Zone =~ /.+/) and ($Zone ne '__Total__')) { | |
783 foreach $RR (sort keys %{$DNSSECInvalid{$Zone}}) { | |
784 print " " . "$Zone/$RR: " . $DNSSECInvalid{$Zone}{$RR} . " Time(s)\n"; | |
785 } | |
786 } | |
787 } | |
788 } | |
789 | |
790 if (($Detail >= 5) and (keys %DNSSECBadCache)) { | |
791 print "\nDNSSEC Bad Cache hit: " . $DNSSECBadCache{'__Total__'} . " Time(s)\n"; | |
792 foreach $Zone (sort keys %DNSSECBadCache) { | |
793 if (($Detail >= 10) and ($Zone =~ /.+/) and ($Zone ne '__Total__')) { | |
794 foreach $RR (sort keys %{$DNSSECBadCache{$Zone}}) { | |
795 print " " . "$Zone/$RR: " . $DNSSECBadCache{$Zone}{$RR} . " Time(s)\n"; | |
796 } | |
797 } | |
798 } | |
799 } | |
800 | |
801 if (($Detail >= 5) and (keys %DNSSECError)) { | |
802 print "\nDNSSEC Errors:\n"; | |
803 foreach $Error (sort keys %DNSSECError) { | |
804 print " $Error: " . $DNSSECError{$Error}{'__Total__'} . " Time(s)\n"; | |
805 if ($Detail >= 10) { | |
806 foreach $Host (sort keys %{$DNSSECError{$Error}}) { | |
807 print " " . "$Host: " . $DNSSECError{$Error}{$Host} . " Time(s)\n" unless ($Host eq '__Total__'); | |
808 } | |
809 } | |
810 } | |
811 } | |
812 | |
813 if (keys %OtherList) { | |
814 print "\n**Unmatched Entries**\n"; | |
815 foreach $line (sort {$a cmp $b} keys %OtherList) { | |
816 print " $line: $OtherList{$line} Time(s)\n"; | |
817 } | |
818 } | |
819 | |
820 exit(0); | |
821 | |
822 # vi: shiftwidth=3 tabstop=3 syntax=perl et | |
823 # Local Variables: | |
824 # mode: perl | |
825 # perl-indent-level: 3 | |
826 # indent-tabs-mode: nil | |
827 # End: |