Is it safe to go from the mac_clients branch to this super_clients branch? Or are there database items that could cause an incompatibility?
The corresponding ordinary clients are hidden, there are no duplicates.
Yes. Changing between these two is safe as new/super-clients
is built upon new/mac-clients
. Going back to master
or development
is not possible from new/super-clients
because it is also no possible from new/mac-clients
.
Do i add all my client whit the sql cmd?
Only those which you want grouped - together with the name you like to see. There is no need to add clients which only have one IP address in the first place.
My server give each clients 3 IPv6 adresse.
4 posts were merged into an existing topic: Force update of IP / hostname / clientname relation ship
Can I suggest psuedoclients
then instead? Super clients seems like they have powers and capabilities above normal clients.
My original post was moved away so we lost some of the conversation. I can see the moderator's reason why they did this , let me re-post the relevant part below:
As always, just opinions: I disagree with pseudoclients
. It somehow seems to suggest they are not really there. While one might argue that this is the case, they actually physically exist as devices and are no pseudo
. In my understanding the term pseudo
would cause more confusion. super
may not be optimal, either, but right now at least it seems more descriptive for the "it is more than one ordinary client".
Otherwise this is -- once again -- a really cool new thing. I just tried it in my network and it seems to work just as expected. I even configured all my devices now and have not seen anything odd.
A single post is the smallest unit for splitting, there's no way to just move parts of it - thank you for reposting relevant parts back here.
When i do:
pihole checkout new/super-clients
i get this msg [i] Requested option "new/super-clients" is not available
The tabel for
superclients
Does not get created after i did the checkout.
The table is called superclient
without the trailing s
, but watch my next post for further details before moving on.
Having seen @jpgpi250's interpretation of what this can be used for, I thought it may be a good idea to generalize the super-clients. So far, super-clients were set by using a MAC address as identifier. This is a limitation as you may have a device with:
- more than one MAC address (e.g., Ethernet and WiFi interface)
- devices without a MAC address being available (e.g., connected through VPN or on another VLAN)
So back to the drawing board!
Please first reset your database back to how it was before checking out the new/super-clients
branch using:
sudo sqlite3 /etc/pihole/pihole-FTL.db "DROP TABLE superclient;"
sudo sqlite3 /etc/pihole/pihole-FTL.db "UPDATE ftl SET value = 8 WHERE id = 0;"
Then check out the latest version of this branch.
The superclient
table now looks like this (hwaddr
gone, id
added):
ID | host name | comment |
---|---|---|
0 | linux-box-1 | (optional) |
The network
table - listing all devices - gets an extra column at the end: superclient_id
(referencing the superclient
table's IDs)
You can add a super-client ID to as many MAC addresses (may be real or mock-MAC addresses) as you like. This will give you a lot more flexibility and should work equally well.
Example:
-
Check out the FTL branch
pihole checkout ftl new/super-clients
-
Add a new super-client
sudo sqlite3 /etc/pihole/pihole-FTL.db
INSERT INTO superclient (id,name,comment) VALUES (0,'something',NULL);
-
Assign two MAC addresses to this super-client (ID = 0)
sudo sqlite3 /etc/pihole/pihole-FTL.db
UPDATE network SET superclient_id = 0 WHERE hwaddr = 'd0:50:99:33:78:33';
-
Ask FTL to re-import super-clients
sudo pkill -RTMIN+3 pihole-FTL
-
See that the said client is now inside the super-client
something
-
For the sake of demonstration, let's add the Top Client (25010 queries) to the same super-client:
sudo sqlite3 /etc/pihole/pihole-FTL.db
UPDATE network SET superclient_id = 0 WHERE hwaddr = 'd0:50:19:31:28:45';
followed by a
sudo pkill -RTMIN+3 pihole-FTL
-
Enjoy.
All statistics from all addresses of these two devices are summarized under one name:
This also works. It is even easier to configure.
It would be good if you could add a foreign-key constraint to the additional network
table column:
superclient_id INTEGER REFERENCES superclient(id) ON DELETE SET NULL
to ensure superclient_id
is reset to NULL
when a super-client gets removed.
The superclient
does not work whit client group, or my setup is buggy.
Yes, so far the supeclients only affect the computed statistics. I'm going forth and back on this, but should superclients even be used for group configuration? Given that - with the next version of Pi-hole - you can also specify per-client rules by MAC addresses, etc. It would be quite complex to bring them into this concept - and it would be working across databases (superclient
and network
in pihole-FTL.db
, all per-group settings in gravity.db
)
Better wait for next version
Thank you for tackling this! I will load it on one of my pi-holes to test layer tonight!
I see new/mac_clients
has been merged into development
by now. Is this the time to make a PR for this feature? Can it be considered ready? I did a lot of tests by now and everything seems to work everywhere. Another awesome feature. When you release this, you should definitely not make it a 5.1.3 micro step but jump straight to v5.2