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 DEBUG_HELPER #914

Merged
merged 1 commit into from
Nov 3, 2020
Merged

Add DEBUG_HELPER #914

merged 1 commit into from
Nov 3, 2020

Conversation

DL6ER
Copy link
Member

@DL6ER DL6ER commented Oct 27, 2020

By submitting this pull request, I confirm the following:

  • 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


Add DEBUG_HELPER option. This option logs any helper activity (and possible errors) to pihole-FTL.log to ease debugging.

Exemplary configuration:

$ cat /etc/dnsmasq.d/99-script.conf 
dhcp-script=/tmp/dhcp-script.sh

$ cat /tmp/dhcp-script.sh
#!/bin/bash
echo "$@" >> /tmp/dhcp-script.log

$ cat /tmp/dhcp-script.log
old 11:55:1f:a1:55:3c 192.168.0.212 ThinkPad-Ubuntu

Exemplary log content:

$ grep "Script:" /var/log/pihole-FTL.log
[2020-10-27 07:29:46.105 3592/F3585] Script: Starting helper for action "old"
[2020-10-27 07:29:46.106 3598/F3585] Script: Executing "/tmp/dhcp-script.sh" with arguments: "old 11:55:1f:a1:55:3c 192.168.0.212 ThinkPad-Ubuntu"

On errors, the reason will be logged:

[2020-10-27 07:31:19.844 3592/F3585] Script: Starting helper for action "old"
[2020-10-27 07:31:19.845 3674/F3585] Script: Executing "/tmp/dhcp-script.sh" with arguments: "old 11:55:1f:a1:55:3c 192.168.0.212 ThinkPad-Ubuntu"
[2020-10-27 07:31:19.846 3674/F3585] Script: FAILED to execute "/tmp/dhcp-script.sh": No such file or directory

…e errors) to pihole-FTL.log

Signed-off-by: DL6ER <dl6er@dl6er.de>
@dschaper dschaper added the PR: Approved Open Pull Request, Approved by required number of reviewers label Oct 29, 2020
@DL6ER DL6ER merged commit 852c6a2 into development Nov 3, 2020
@DL6ER DL6ER deleted the new/DEBUG_HELPER branch November 3, 2020 22:11
@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/pi-hole-core-web-v5-2-and-ftl-v5-3-released/40909/1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Debugging PR: Approved Open Pull Request, Approved by required number of reviewers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants