Commit Graph

63 Commits

Author SHA1 Message Date
DL6ER 032bfc085c Analyze and show file permissions for log files 2017-04-10 00:46:52 +02:00
DL6ER 66e8c72a4f Enhance error messages 2017-04-09 22:53:08 +02:00
DL6ER c7b3ddd2fe Reduce polling of pihole.log from 20x per second to 5x per second 2017-04-09 22:43:38 +02:00
DL6ER 371b7a0f32 Use stat() and don't keep pihole.log open forever. Fixes #16 2017-04-09 20:41:25 +02:00
DL6ER 76f2039a2a bzero is obsolete. Using memset instead 2017-04-08 23:46:33 +02:00
DL6ER e7658076d1 Improve log messages in parser thread 2017-04-08 22:57:23 +02:00
DL6ER 8d9cd43f9d More logging to syslog in case of critical errors 2017-04-08 22:28:34 +02:00
DL6ER 1985f8e6eb Removed logg_str_str 2017-04-08 18:39:41 +02:00
DL6ER 16a788429b Removed logg_str 2017-04-08 18:34:37 +02:00
DL6ER ece9f18c1b Removed logg_int 2017-04-08 18:27:56 +02:00
DL6ER 5c952f2cd6 Improve flexibility of log routines 2017-04-08 18:18:07 +02:00
DL6ER 2abc2caace Make client and domain finding algorithms faster by skipping candidates that fail for a comparison of the very first character 2017-04-04 15:28:52 +02:00
DL6ER baca4cbb26 Factor out client finding algorithm 2017-04-04 15:24:30 +02:00
DL6ER 7039b3db99 Factor out domain finding algorithm 2017-04-04 15:22:43 +02:00
DL6ER ba058c1372 Increase verbosity of log file 2017-04-03 10:33:08 +02:00
DL6ER d779673fa1 Re-parse all logs when receiving signal SIGUSR1 2017-04-02 23:59:49 +02:00
DL6ER b5a28edccb Debug mode: Print at which time query had to be enlarged (kind of log parsing process display for humongous logs 2017-04-02 22:57:23 +02:00
DL6ER fa37f92e33 ftell returns long int (not unsigned) 2017-04-01 16:00:00 +02:00
DL6ER e3b549e377 Improve code output 2017-03-31 14:17:21 +02:00
DL6ER c49b406fcc Calling backtrace inside a signal handler is (unfortunately) meaningless 2017-03-31 13:48:34 +02:00
DL6ER 3bcffa46f5 Improve log parser for pihole.log with file size > 4 GB 2017-03-30 00:53:58 +02:00
DL6ER 78f615201a Some non-POSIX systems use different conventions for exit status values.
For greater portability, we now use the macros EXIT_SUCCESS and EXIT_FAILURE for the conventional status value for success and failure, respectively.
They are declared in stdlib.h
2017-03-29 14:00:51 +02:00
DL6ER 3dd09df9bf Also print username if pihole.log cannot be read 2017-03-29 13:52:44 +02:00
DL6ER f506c28724 Refine checkLogForChanges() 2017-03-29 11:18:48 +02:00
DL6ER b43d077017 Check log reliably for filesize reduction (flushing event) 2017-03-29 10:37:16 +02:00
DL6ER cabc6800d6 Add Query Types over Time data structure 2017-03-28 14:45:16 +02:00
DL6ER ac9947ba89 Return early from log parsing if log flushing is detected half-way through 2017-03-27 10:42:29 +02:00
DL6ER 106498df9f Handle DST according to ISO/IEC 9899:TC3 2017-03-26 13:10:43 +02:00
DL6ER de41afeef4 Fix GC collector bug 2017-03-23 17:25:14 +01:00
DL6ER 2829970d74 Fix memory leak 2017-03-17 18:59:30 +01:00
DL6ER 779b18755c Extend summary output 2017-03-16 10:18:12 +01:00
DL6ER 8fd8e10212 Upgrade file pointer buffers from int to unsigned long int 2017-03-16 07:35:30 +01:00
DL6ER cc7ccc5921 Improve documentation of thread locks. Allow concurrently active clients accessing the data struction in read-only mode 2017-03-16 01:18:09 +01:00
DL6ER 722b062f2c Initialize FTL with default parameters if log file cannot be read 2017-03-15 14:10:02 +01:00
DL6ER a8a55a3857 Implement rolling 24h as standard behavior of FTL. Can be set to static views of up to 24h (analyzing pihole.log) and up to 48h (analyzing pihole.log.1 in addition) 2017-03-14 18:46:17 +01:00
DL6ER 7c9b1b4195 Add config file parser. First config arguments are
SOCKET_LISTENING=all|local
INCLUDE_YESTERDAY=true|false

If FTL we cannot find or interpret a config variable value, it will skip it and use the default value
2017-03-14 12:20:07 +01:00
DL6ER e70be89073 Remove moving time frame altogether 2017-03-14 10:38:16 +01:00
DL6ER 40375ab18e Garbage collect query types (speed enhancements, PTR, SRV) 2017-03-13 11:01:09 +01:00
DL6ER a859abcf60 Generate over time structure for forwarded data and discard old forwarded data on initial log parsing 2017-03-13 10:37:01 +01:00
DL6ER c7119444d8 Compare domains in parser with whitespace-padded domains to eliminate possible wildcard false-positives 2017-03-13 10:00:22 +01:00
DL6ER 093f13d432 Refine detection if forwarded to upstream DNS server (remove any false positives) 2017-03-12 23:49:46 +01:00
DL6ER f73ed48dbf Implement FTL garbage collector 2017-03-12 21:03:05 +01:00
DL6ER 7eef68e68a Re-read log line if dnsmasq hasn't finished writing it 2017-03-12 17:38:10 +01:00
DL6ER a299f9559b Don't start log re-parsing if threadlock is set (this could lead to an inifinite loop if ther are > 300.000 queries in todays log on slow devices) 2017-03-12 16:26:43 +01:00
DL6ER 89d6567259 Add thread names 2017-03-12 16:16:36 +01:00
DL6ER 3bb6f423dc FTL is now aware of how much memory it uses. Added ">memory" command. 2017-03-12 12:16:09 +01:00
DL6ER 3a9f02b468 Make reparsing_delay a compiletime variable 2017-03-12 10:42:51 +01:00
DL6ER 7486ebfac2 Prevent resource leaks 2017-03-10 14:02:31 +01:00
DL6ER 4cb9b58d33 Also analyze pihole.log.1 and keep only data of the most recent 24 hours (reparse logs every hour) 2017-03-10 13:49:09 +01:00
DL6ER 6ccfeea2da Guarantee FTL's thread safety 2017-03-08 11:47:58 +01:00