Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Unbound stats? #363

Closed
webnetwiz opened this issue Aug 26, 2023 · 4 comments
Closed

Add support for Unbound stats? #363

webnetwiz opened this issue Aug 26, 2023 · 4 comments

Comments

@webnetwiz
Copy link

webnetwiz commented Aug 26, 2023

Is your feature request related to a problem? Please describe.
So like lots of people out there, I've been using PiHole with Unbound DNS server. I have grabbed a very elegant solution to adding Unbound stats to PADD from this source: https://giuliomagnifico.medium.com/add-unbound-stats-to-padd-for-pi-hole-38b2ea87db2b and everything worked like a charm I see that since the version of PADD I'm running, which is 3.6.7, a lot has changed, and it looks like simply copying and pasting the right code from the link above will not simply add Unbound stats where needed. It would be awesome to have a version of the PADD script that it tailored towards those that run PiHole with Unbound.

Describe the solution you'd like
Add Unbound stats to script using the following code or something better that would yield the same results:

CleanEcho "UNBOUND ==========================================================================="
    CleanPrintf " %-10s%-19s%-10s%-9s\e[0K\\n" "Total: " "$(sudo unbound-control stats_noreset | awk -F '=' '/total.num.queries=/ {printf $NF}') queries" " Reply:" " $(sudo unbound-control stats_noreset | awk -F '=' '/total.recursion.time.avg/ {printf "%.3f\n", $NF}') seconds" 
    CleanPrintf " %-10s%-19s%-10s%-9s\e[0K\\n" "Missed: " "$(sudo unbound-control stats_noreset | awk -F '=' '/total.num.cachemiss=/ {printf $NF}') queries" " Cached:" " $(sudo unbound-control stats_noreset | awk -F '=' '/total.num.cachehits/ {printf $NF}') queries"

This is located in the PrintNetworkInformation function in my version of the script.

Describe alternatives you've considered
I haven't looked at any alternatives as I haven't found anyhting better than PADD.

Additional context
Attaching complete version of my customized padd script.
padd-unb.txt

THANK YOU IN ADVANCE!!! This is an amazing piece of code that does help a lot in running PiHole effectively!

@yubiuser
Copy link
Member

This request comes up from time to time but I see little chance of implementation. The overhead for implementing this is to big: we need to check if users run unbound at all and if they have enabled the stats. Additionally, this would require to (re-)add sudo requirements to padd which I'd like to avoid.

@github-actions
Copy link

This issue is stale because it has been open 30 days with no activity. Please comment or update this issue or it will be closed in 5 days.

@github-actions github-actions bot added the Stale label Sep 25, 2023
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Oct 1, 2023
@webnetwiz
Copy link
Author

There seems to be a lot of guides out there pointing to this type if setup (Pihole + Unbound) when users do not want to rely on external DNS servers and want to run local DNS servers. Almost every guide I saw talks about enabling stats for Unbound. This is the reason I asked this, as I use the external DNS as forwarders, but run Unbound locally behind my Pihole (on the same RP4 box). Either way, let me know if there's a possibility that you may pick this up at some point. Thank you!

@github-actions github-actions bot removed the Stale label Nov 8, 2023
@MatthK
Copy link

MatthK commented Dec 11, 2024

One up on this. Ever since I started using Pihole, I also chose the provided guide to install and configure Unbound with it. It would be really nice to see that integrated into the script.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants