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 blocked per client counter #275

Merged
merged 3 commits into from May 11, 2018
Merged

Conversation

DL6ER
Copy link
Member

@DL6ER DL6ER commented May 10, 2018

By submitting this pull request, I confirm the following (please check boxes, eg [X]) Failure to fill the template will close your PR:

Please submit all pull requests against the development branch. Failure to do so will delay or deny your request

  • I have read and understood the contributors guide.
  • I have checked that another pull request for this purpose does not exist.
  • I have considered, and confirmed that this submission will be valuable to others.
  • I accept that this submission may not be used, and the pull request closed at the will of the maintainer.
  • I give this submission freely, and claim no ownership to its content.

How familiar are you with the codebase?:

10


This adds a new counter for blocked queries per client. This duplicates the functionality we already have for domains (either total or blocked count).

The new info can be queried from the API by specifying the keyword blocked in addition to >top-clients. This option is in agreement with other available options, e.g. >top-clients withzero blocked (29) will work as expected.

This template was created based on the work of udemy-dl.

DL6ER added 3 commits May 10, 2018 14:22
Signed-off-by: DL6ER <dl6er@dl6er.de>
…ithzero (20)")

Signed-off-by: DL6ER <dl6er@dl6er.de>
Signed-off-by: DL6ER <dl6er@dl6er.de>
@pralor-bot
Copy link

This pull request has been mentioned on Pi-hole Userspace. There might be relevant details there:

https://discourse.pi-hole.net/t/top-blocked-domains-per-client/5055/6

@PromoFaux
Copy link
Member

This appears to be working as written.

I had an odd moment where pihole-FTL got stuck, and I could not stop or restart it (with either service or systemctl), though that may be unrelated. Once I rebooted the pi I could control it again. I may have had a rogue process...

pi@pihole:~ $ sudo service pihole-FTL stop
pi@pihole:~ $ sudo service pihole-FTL status
● pihole-FTL.service - LSB: pihole-FTL daemon
   Loaded: loaded (/etc/init.d/pihole-FTL; generated; vendor preset: enabled)
   Active: inactive (dead) since Thu 2018-05-10 22:30:16 UTC; 44s ago
     Docs: man:systemd-sysv-generator(8)
  Process: 4120 ExecStop=/etc/init.d/pihole-FTL stop (code=exited, status=0/SUCCESS)
  Process: 3701 ExecStart=/etc/init.d/pihole-FTL start (code=exited, status=0/SUCCESS)

May 10 22:28:21 pihole systemd[1]: Starting LSB: pihole-FTL daemon...
May 10 22:28:21 pihole pihole-FTL[3701]: Not running
May 10 22:28:21 pihole su[3724]: Successful su for pihole by root
May 10 22:28:21 pihole su[3724]: + ??? root:pihole
May 10 22:28:21 pihole su[3724]: pam_unix(su:session): session opened for user pihole by (uid=0)
May 10 22:28:21 pihole pihole-FTL[3701]: dnsmasq: failed to bind DHCP server socket: Address already in use
May 10 22:28:21 pihole systemd[1]: Started LSB: pihole-FTL daemon.
May 10 22:30:16 pihole systemd[1]: Stopping LSB: pihole-FTL daemon...
May 10 22:30:16 pihole pihole-FTL[4120]: Not running
May 10 22:30:16 pihole systemd[1]: Stopped LSB: pihole-FTL daemon.
pi@pihole:~ $ sudo netstat -tulpn
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 0.0.0.0:53              0.0.0.0:*               LISTEN      3960/pihole-FTL

@PromoFaux
Copy link
Member

Discussed issue above internally with @DL6ER, he cannot see how it would be related to this branch

@PromoFaux PromoFaux self-requested a review May 11, 2018 14:40
@DL6ER DL6ER merged commit 51fae2c into development May 11, 2018
@DL6ER DL6ER deleted the new/more_per_client_details branch May 11, 2018 14:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants