Change TOP Clients from default 10 to 20


#1

I have discovered that pi-hole is an amazing tool for not only blocking ads but monitoring what is happening on the network at a top level on a per client basis. I am more curious to see what is happening with many of the connected devices which will not show up in the top clients. (TVs, cameras, etc)

I have been searching for a way to increase the TOP Clients from the default 10 to 20; however I am struggling to find a solution that works. If I can get some insight ir recommendations on what needs to be changed in the code, that would be great.

Thank you,


#2

I believe the TOP clients parameter is set here:


#3

That was the first change that I had tested from Google searches. I had changed that to 20, restarted the box; however there was no change. I would only see the top 10. I have 18 clients connected, DHCP addresses are handed out via PiHole. That seems to be the most logical change that is needed, but there must be something else that is needed to be changed. Has anyone else been successful with testing or changing this?

Best regards,


#4

The code section @ramset quoted is from the legacy API (purely PHP, no FTL) which is not used since over one year and is subject to be removed rather sooner than later.

You could change it either where it is requested:


where you would put

  $.getJSON("api.php?summaryRaw&getQuerySources=20", function(data) {

or where it is sent to FTL:

I’d recommend changing it in the former location as everything will then pass through nicely and the solution will be less hacky.


#5

Hello DL6ER,

Thank you! That was another change I also had made before, but it did not take. Now that I had moved to FTL fork last night, this change did take and is working. I now see all clients that are connected to the LAN

Best regards,


Option to 'Show all clients'
#6

Sorry for the n00b question,
But I presume this is only possible if you recompile it your self ?
It isn’t possible to edit this on a already installed pi-hole on a raspberry ?


#7

PHP is not compiled, you can edit it.


#8

Thnx,
Stupid me i wasn’t looking in the right location to edit it.


#9

Hello,

With the recent upgrade to the web version 4.0, I had to revert the changes that I had made to /var/html/admin/scripts/js/index.js in order to perform the upgrade. No problem with the upgrade; however when trying to add the top clients as well as the total of permitted/blocked domains, I seem to not get the results that I has expected.

For Top Clients: I do not see more than 10 top clients
function updateTopClientsChart() {
$.getJSON(“api.php?summaryRaw&getQuerySources&topClientsBlocked=25”, function(data)

For Top Items: I do see the Top 20 blocked and permitted.
function updateTopLists() {
$.getJSON(“api.php?summaryRaw&topItems=20”, function(data)

I am curious if anyone else was able to increase their top clients visible in the GUI?

Thank you and best regards,


#10

Why not make this an option in the next release ?!

Please ? Pretty please ? :smiley:


#11

I was not. My top clients (blocked only) increased, but the top clients (total) and top permitted and top blocked domains stayed at 10.


#12

Do http://pi.hole/admin/api.php?topClients=25 and http://pi.hole/admin/api.php?topItems=25 give you more than 10 results?


#13

It does not. On Safari and Brave (both on Mac), I see this:


#14

You need to be logged into Pi-hole’s dashboard in the same browser to have the permissions to request these data.


#15

I get more than 10 in both


#16


#17

When your system knows only 4 clients, there is no chance that the table can show more than 10 :wink:


#18

Oops, wrong Pi-Hole. The other one with 20 clients shows a similar list, with all 20.

That’s a yes to both.


#19

You should use

api.php?summaryRaw&getQuerySources=25&topClientsBlocked=25

#20

Hello,

Thank you for the hint, this was the trick and I now can see the additional clients.

For those that are interested, the same for the top domains can be done with:
function updateTopLists() {
$.getJSON(“api.php?summaryRaw&topItems=15”, function(data) {

Best regards,