What's new

uiDivStats uiDivstats 4.0.14 - WebUI Stats for Diversion

...
After reboot:
  1. CLI menu now shows "user7" as the UI page
  2. Database size still shows partialadminusername+"B"
  3. user7 works but shows a proper database size
The last 2 points above appear to indicate that you likely have installed some Entware packages that include binaries with the same name as the router built-in binaries but behave differently when using the same arguments, and your PATH environment variable is set up to give those Entware binaries priority over their built-in counterparts which would affect running the shell script via an interactive session but not via the WebGUI.

Please run the following commands via an SSH terminal session and post the output:
Bash:
env | grep PATH= ; which sed ; which ls ; which grep
 
The last 2 points above appear to indicate that you likely have installed some Entware packages that include binaries with the same name as the router built-in binaries but behave differently when using the same arguments, and your PATH environment variable is set up to give those Entware binaries priority over their built-in counterparts which would affect running the shell script via an interactive session but not via the WebGUI.

Please run the following commands via an SSH terminal session and post the output:
Bash:
env | grep PATH= ; which sed ; which ls ; which grep

Yep that must be it. For sure am getting the Entware versions.

Code:
PATH=/opt/bin:/opt/sbin:/bin:/usr/bin:/sbin:/usr/sbin:/home/adminuname:/mmc/sbin:/mmc/bin:/mmc/usr/sbin:/mmc/usr/bin:/opt/sbin:/opt/bin:/opt/usr/sbin:/opt/usr/bin

/opt/bin/sed
/opt/bin/ls
/opt/bin/grep
 
Release Notes for uiDivStats 4.0.8 version (now available):

1) Added "export PATH" statement to make the built-in binaries have higher priority than the equivalent Entware binaries.

2) Various code improvements & fine-tuning.

Nice. Fixed my CLI situation instantly.
 
Release Notes for uiDivStats 4.0.9 version (now available):

1) Added and modified code so that every time the SSH CLI menu is run, it checks if the WebGUI page has already been mounted. If not found mounted, the script will run the code to remount the WebGUI.
 
I used to have problems with router performance while uidivstats did trimdb on my semihuge database, we had some discussions here and got rid of the issue after some testing.
I don't really remember the details from that episode, but now I've noticed some performance struggles for my router again, especially DNS lookups. Turned off Diversion and it worked fine. Took a look at db size, and it is 1.7GB... Can't say why it has grown that large again (I keep 30 days), but I saw that I have the caching (to TMPFS) option on, and I don't think that will work well with the huge db so I turned that off. Then I ran trimdb, which shaved down the 1.7GB to 1.6GB. Hmm. Am I doing something wrong? Maybe I'm looking in the wrong place and making uidivstats a scapegoat for other issues, but should my db really be this big? Or maybe things will work fine now when I turned off the cache and/or ran trimdb, haven't had much time to test it, the problems are a bit sporadic but noticable many times during every day.
 
Release Notes for uiDivStats v4.0.11 production version now available
[2025-Jun-22]


1) FIXED: New code to remove duplicate parameter key names found in the configuration file. Getting duplicate key values can cause "bad number" or "arithmetic syntax" errors.

2) IMPROVED: New code to create a separate logfile to capture the SQLite3 errors with more verbosity.
Debug logfile default location: /opt/share/tmp/

3) IMPROVED: Added error-handling code when an SQLite3 database operation fails to create a file.

4) IMPROVED: When an SQLite3 operation returns error messages indicating a corrupted binary, the error-handling code will now log a separate message to the system logger and to its own debug logfile to let users know of the corrupted SQLite3 and the need to remove and reinstall its Entware package.

5) Miscellaneous code improvements.


The fork from @Jack Yaz's uiDivStats add-on is now hosted on the AMTM-OSR GitHub repo:
 
Release Notes for uiDivStats v4.0.14 production version now available
[2026-Jan-19]


1) FIXED: Removed a remnant function call from JavaScript code (i.e. comma()) that was causing an error when calls to show tooltips were made.
[Thanks to @EmeraldDeer for reporting the problem]​

2) FIXED: Modified code to better handle long domain name strings, which were shown in an unreadable format when selecting a horizontal bar chart. Now, those long strings are truncated and ended with an ellipsis to indicate that only a portion of the domain name string is being shown. Tooltips will still show the full domain name strings.

3) FIXED: Modified code to show the pie chart as expected when long domain name strings are found.

Sample screenshot of long domain name strings being shown in an unreadable format:
uiDivStats_HorizBar_Chart_LongStrings.jpg


Now, long domain name strings are shown in a truncated format:
uiDivStats_HorizBar_Chart_ShortStrings.jpg


The pie chart was missing when using long domain name strings:
uiDivStats_Pie_Chart_LongStrings.jpg


Now, the pie chart is shown when long domain name strings are truncated:
uiDivStats_Pie_Chart_ShortStrings.jpg




The fork from @Jack Yaz's uiDivStats add-on is now hosted on the AMTM-OSR GitHub repo:
 
I see these in the syslog:
Mar 11 17:48:00 uiDivStats_[10060]: SQLite3 Failure[gql1]: Parse error near line 6: no such table: dnsqueries
Mar 11 17:48:01 uiDivStats_[10060]: SQLite3 Failure[gql1]: Parse error near line 6: no such table: dnsqueries
Mar 11 17:48:02 uiDivStats_[10060]: SQLite3 Failure[gql1]: Parse error near line 6: no such table: dnsqueries
Mar 11 17:48:02 uiDivStats_[10060]: SQLite process[gql1] reported error(s).

As the result no data to display:
1773244651885.png

I tried to uninstall and install again but this doesn't help.

How to get it fixed?
 
I see these in the syslog:
Mar 11 17:48:00 uiDivStats_[10060]: SQLite3 Failure[gql1]: Parse error near line 6: no such table: dnsqueries
Mar 11 17:48:01 uiDivStats_[10060]: SQLite3 Failure[gql1]: Parse error near line 6: no such table: dnsqueries
Mar 11 17:48:02 uiDivStats_[10060]: SQLite3 Failure[gql1]: Parse error near line 6: no such table: dnsqueries
Mar 11 17:48:02 uiDivStats_[10060]: SQLite process[gql1] reported error(s).

As the result no data to display:
View attachment 70693
I tried to uninstall and install again but this doesn't help.

How to get it fixed?
Which router and which firmware version?
 
I see these in the syslog:
Mar 11 17:48:00 uiDivStats_[10060]: SQLite3 Failure[gql1]: Parse error near line 6: no such table: dnsqueries
Mar 11 17:48:01 uiDivStats_[10060]: SQLite3 Failure[gql1]: Parse error near line 6: no such table: dnsqueries
Mar 11 17:48:02 uiDivStats_[10060]: SQLite3 Failure[gql1]: Parse error near line 6: no such table: dnsqueries
Mar 11 17:48:02 uiDivStats_[10060]: SQLite process[gql1] reported error(s).
It looks like either your database file or your SQLite3 installation has been corrupted.

First, let's make sure the SQLite3 binaries are OK, so please download and execute the following script to remove and then reinstall the package along with any dependencies:
Bash:
curl  -LS --retry 3 --retry-delay 5 --retry-connrefused \
https://raw.githubusercontent.com/Martinski4GitHub/CustomMiscUtils/master/Misc/SQLite3_ResetPackage.sh \
-o "$HOME/SQLite3_ResetPackage.sh" && chmod a+x "$HOME/SQLite3_ResetPackage.sh"
You can save the script file wherever you want if you want to keep it across reboots.

Now, execute the script with no arguments:
Bash:
./SQLite3_ResetPackage.sh
The last step of the script execution prompts you to reboot the router.

After the reboot, check again if the errors are still generated. If you still have errors, you can try deleting the database file as a last resort:
Bash:
rm -f /opt/share/uiDivStats.d/dnsqueries.db

HTH.
 
SQLite repair did not helped but before uiDivStats uninstallation I looked into the folder where dnsqueries.db is located and I realized it is only 16KB file - probably corrupted, so I uninstalled addon and installed it again and now I see this file's size is growing to already 180KB, so it looks there is a chance now it would work.
Thanks for your support and guidance where to look.



:)
 
Last edited:

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!
Back
Top