Sometimes I need to run pihole restartdns
to fix some pihole issues, currently this command clears "Total queries over last 24 hours" and causes empty history in Dashboard page (i.e., no data for "Totoal Queries" "Queries Blocked", "Percent Blocked", and "Total queries over last 24 hours" graph).
I am not sure why a simple "restarting server" needs to clear its log/history, but please give us an option to keep and reload the history so after "restartdns" we still have last 24 hours' queries.
By the way, I don't have /etc/pihole/pihole-FTL.db because I have
MAXDBDAYS is the parameter that controls the duration of query storage in this file.
A separate configuration parameter (MAXLOGAG) determines how many hours of data are read from his file on restart: Default and maximum are 24 hours. When there is no database, there is nothing to read. This is why MAXDBDAYS = 1 will provide enough history to populate the dashboard.
Thanks for the reply, but my question was: during its run, how is pihole able to accumulate and display these query data when it does not save or have /etc/pihole/pihole-FTL.db at all? these data must be somewhere, maybe in the memory?
They are kept in memory, as well as being written to the database if available. When you restartdns, this clears the memory and the information is lost. Normally this would be populated from the long term database on FTL startup, but if the long term database is disabled, you have nothing.
You have disabled the existing option to restore the previous 24 hour query history.
What problems are you having that cause you to restartdns frequently? Most Pi-hole will run forever without ever doing this.