What's new

Diversion dnsmasq.log file empty

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

tratek

Occasional Visitor
Hi,
I've noticed that dnsmasq.log file is empty and I'm unable to see which hosts are called/blocked in Diversion

==>> logging is on yet the file is empty:

-rw-rw---- 1 nobody root 0 Mar 18 12:26 dnsmasq.log

Any hints what's missing/wrong?
 
Disable and re-enable logging, see what happens.
 
Do you actually have dnsmasq logging enabled in Diversion?
Screenshot_2024-03-19-07-18-26-60_96079702262017ccfd2f2f70f93088e6.jpg

From ssh run "cru l" (without the quotes).
You should find 4 entries for Diversion (and 4 for uiDivStats, if that's installed)
 
Last edited:
adrim@RT-AX86U_Pro-0D20:/tmp/home/root# cru l
*/2 * * * * /etc/openvpn/server1/vpn-watchdog1.sh #CheckVPNServer1#
*/2 * * * * /etc/openvpn/server2/vpn-watchdog2.sh #CheckVPNServer2#
5 0 * * * /opt/sbin/logrotate /opt/etc/logrotate.conf >> /opt/tmp/logrotate.daily 2>&1 #logrotate#
25 1 * * * sh /jffs/scripts/firewall banmalware #Skynet_banmalware#
19 1 * * Mon sh /jffs/scripts/firewall update #Skynet_autoupdate#
0 * * * * sh /jffs/scripts/firewall save #Skynet_save#
40 */12 * * * sh /jffs/scripts/firewall debug genstats #Skynet_genstats#
00 2 * * Thu /bin/sh /opt/share/diversion/file/update-bl.div reset #Diversion_UpdateBL#
20 5 * * * /bin/sh /opt/share/diversion/file/rotate-logs.div #Diversion_RotateLogs#
20 17 * * * diversion count_ads count #Diversion_CountAds#
adrim@RT-AX86U_Pro-0D20:/tmp/home/root#
 
adrim@RT-AX86U_Pro-0D20:/tmp/home/root# cru l
*/2 * * * * /etc/openvpn/server1/vpn-watchdog1.sh #CheckVPNServer1#
*/2 * * * * /etc/openvpn/server2/vpn-watchdog2.sh #CheckVPNServer2#
5 0 * * * /opt/sbin/logrotate /opt/etc/logrotate.conf >> /opt/tmp/logrotate.daily 2>&1 #logrotate#
25 1 * * * sh /jffs/scripts/firewall banmalware #Skynet_banmalware#
19 1 * * Mon sh /jffs/scripts/firewall update #Skynet_autoupdate#
0 * * * * sh /jffs/scripts/firewall save #Skynet_save#
40 */12 * * * sh /jffs/scripts/firewall debug genstats #Skynet_genstats#
00 2 * * Thu /bin/sh /opt/share/diversion/file/update-bl.div reset #Diversion_UpdateBL#
20 5 * * * /bin/sh /opt/share/diversion/file/rotate-logs.div #Diversion_RotateLogs#
20 17 * * * diversion count_ads count #Diversion_CountAds#
adrim@RT-AX86U_Pro-0D20:/tmp/home/root#
Run this in the terminal:
Code:
grep log /etc/dnsmasq.conf
 
interesting, indeed. I will need to investigate what has filled the file system.

adrim@RT-AX86U_Pro-0D20:/tmp/mnt/sda5/entware/var/log# df -k .
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sda5 3038544 2879944 0 100% /tmp/mnt/sda5


I've now deleted (2GB) and recreated Swap (1GB)

adrim@RT-AX86U_Pro-0D20:/tmp/mnt/sda5/entware/var/log# df -k .
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sda5 3038544 1831492 1033484 64% /tmp/mnt/sda5

Logging in back to normal.

Thanks!
 
adrim@RT-AX86U_Pro-0D20:/tmp/mnt/sda5/entware/share/uiDivStats.d# ls -lh
-rw-rw-rw- 1 adrim root 472 Jan 2 11:00 SQLData.js
drwxrwxrwx 2 adrim root 4.0K Jan 2 11:01 csv
-rw-r--r-- 1 adrim root 548.2M Jan 2 11:00 dnsqueries.db
-rw-r--r-- 1 adrim root 6.3M Oct 27 00:01 dnsqueries.db.bak
 
on my other router =>

adrim@RT-AX56U-3740:/tmp/mnt/sda1/entware/share/uiDivStats.d# ls -lh
-rw-rw-rw- 1 adrim root 471 Dec 22 12:00 SQLData.js
drwxrwxrwx 2 adrim root 1.0K Dec 22 12:38 csv
-rw-r--r-- 1 adrim root 1.2G Jan 14 08:59 dnsqueries.db
-rw-r--r-- 1 adrim root 3.8M Aug 1 2022 dnsqueries.db.bak

how to uninstall uiDivStats as it exits when selecting j5 from menu
1710852029493.png
 
adrim@RT-AX86U_Pro-0D20:/tmp/mnt/sda5/entware/share/uiDivStats.d# /jffs/scripts/uiDivStats uninstall
Removing uiDivStats...


Do you want to delete uiDivStats stats and config? (y/n) y
Uninstall completed

that solves the problem ;)
 
Reinstall uiDivStats now. One of the cron jobs it installs trims the DB file (uiDivStats_trim). I don't see any of the four uiDivStats in your cru list and only two for diversion, meaning either it didn't install correctly, or you've had some of the mystery disappearing cron jobs discussed here:
The disappearing cron jobs is fixed in the current 388.7_alpha1. I wouldn't normally recommend an alpha but this one is proving stable and has a specific fix I feel is needed here.
 
1) uiDivStats reinstalled
2) cron updated:
4-59/5 * * * * /jffs/scripts/uiDivStats flushtodb #uiDivStats_flushtodb#
3) I've set the data retention to 14d
4) I'll keep monitoring it for the next couple of days to see how fast data volume grows

at this point - solved;=)
 
These are the four uidivstats cron jobs I see, and would expect you to see as well:
Code:
0 1-23 * * * /jffs/scripts/uiDivStats generate #uiDivStats_generate#
1 0 * * * /jffs/scripts/uiDivStats trimdb #uiDivStats_trim#
* * * * * /jffs/scripts/uiDivStats querylog #uiDivStats_querylog#
4-59/5 * * * * /jffs/scripts/uiDivStats flushtodb #uiDivStats_flushtodb#
The trim one is important as it keeps dnsmasq.db down to a reasonable size.
Why they're not all showing is a mystery right now. I wonder if they'd all show up after a reboot(?).
 
Code:
find / -size +10000 -exec ls -al {} \; | sort -k 5,5 -n | tail -15
 
Code:
du -k / | sort -k 1,1 -n | tail -15
 
I resized my USB filesystems from 4 GB to 8 GB. It is like open heart surgery but Partition Wizard was successful.
 
These are the four uidivstats cron jobs I see, and would expect you to see as well:
Code:
0 1-23 * * * /jffs/scripts/uiDivStats generate #uiDivStats_generate#
1 0 * * * /jffs/scripts/uiDivStats trimdb #uiDivStats_trim#
* * * * * /jffs/scripts/uiDivStats querylog #uiDivStats_querylog#
4-59/5 * * * * /jffs/scripts/uiDivStats flushtodb #uiDivStats_flushtodb#
The trim one is important as it keeps dnsmasq.db down to a reasonable size.
Why they're not all showing is a mystery right now. I wonder if they'd all show up after a reboot(?).

correct, I see 4:

0 1-23 * * * /jffs/scripts/uiDivStats generate #uiDivStats_generate#
1 0 * * * /jffs/scripts/uiDivStats trimdb #uiDivStats_trim#
* * * * * /jffs/scripts/uiDivStats querylog #uiDivStats_querylog#
4-59/5 * * * * /jffs/scripts/uiDivStats flushtodb #uiDivStats_flushtodb#
 
correct, I see 4:

0 1-23 * * * /jffs/scripts/uiDivStats generate #uiDivStats_generate#
1 0 * * * /jffs/scripts/uiDivStats trimdb #uiDivStats_trim#
* * * * * /jffs/scripts/uiDivStats querylog #uiDivStats_querylog#
4-59/5 * * * * /jffs/scripts/uiDivStats flushtodb #uiDivStats_flushtodb#
Keep an eye on. If you notice strange things again check for these four jobs.
 

Latest threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top