Change TOP Clients from default 10 to 20

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,

1 Like

I believe the TOP clients parameter is set here:

https://github.com/pi-hole/AdminLTE/blob/master/scripts/pi-hole/php/data.php#L154

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,

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.

2 Likes

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,

1 Like

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 ?

PHP is not compiled, you can edit it.

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

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,

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

Please ? Pretty please ? :smiley:

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

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

1 Like

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

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

I get more than 10 in both

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

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

That's a yes to both.

You should use

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

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,