Packet-Clearing-House / DNSAuth

Go-lang app to aggregate DNS queries to 1 minute buckets and write them to influxdb
MIT License
2 stars 2 forks source link

Mallformed file name causes DNSAuth to quit #8

Closed mrjones-plip closed 6 years ago

mrjones-plip commented 6 years ago

If I push a file called SZC_mon-02.fra.pchnet.net.dmp.gz into my monitor directory which is /var/dnasuth/ instead of skipping the file because it doesn't have the correct time stamp format in the filename, DNSAuth quits:

# sudo ./go/bin/DNSAuth -c ./dnsauth.toml 
2018/06/14 21:42:04 Loading config file...
2018/06/14 21:42:04 OK!
2018/06/14 21:42:04 Initializing customer DB (will be refresh every 10 hours)...
2018/06/14 21:42:04 BGP lookups will be ignored, no BGP config provided.
2018/06/14 21:42:04 [CustomerDB] Refreshing list from mysql...
[mysql] 2018/06/14 21:42:04 auth.go:293: unknown auth plugin:
[mysql] 2018/06/14 21:42:04 driver.go:120: could not use requested auth plugin '': this authentication plugin is not supported
2018/06/14 21:43:34 parsing time "r/dnsauth/SZC_mo" as "2006-01-02.15-04": cannot parse "r/dnsauth/SZC_mo" as "2006"
# 

Instead DNSAuth should print the full filename in the logs (currently on screen) and skip it, not quit.

mrjones-plip commented 6 years ago

just a quick not to confirm this now works as requested - thanks!