What's new

AdGuardHome [RELEASE] Asuswrt-Merlin-AdGuardHome-Installer (AMAGHI)

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

Every few days...

1644035765027.png


I will need to start digging deeper... love running this on the router instead of on my main box.

My blocklists add up to around 147K, so not too much I feel. I don't think this is memory releated.

What is the harm of running the checks every 15 or even 5 minutes? 3 hours without DNS when I am not home makes the family unhappy. 5 they may not notice.
 
Every few days...

View attachment 39268

I will need to start digging deeper... love running this on the router instead of on my main box.

My blocklists add up to around 147K, so not too much I feel. I don't think this is memory releated.

What is the harm of running the checks every 15 or even 5 minutes? 3 hours without DNS when I am not home makes the family unhappy. 5 they may not notice.
I can make the checks even more frequent then that, but if I do I will ditch the Successful logger messages, unless everyone is "okay" with that.
 
I can make the checks even more frequent then that, but if I do I will ditch the Successful logger messages, unless everyone is "okay" with that.

I am good with that. But I will modify by hand and test. Also turned on syslog for Adguard. From what I could see in the querylog it had crashed about 20 minutes before I realized. Looking to see if it generates any crash log info, but main syslog had no events during the gap which looked odd...

You may also want to add a delay between found dead check and start and then following found alive but not responding... From what I see, it is starting up and then killing it and trying again because it didn't start up quick enough.
 
I am good with that. But I will modify by hand and test. Also turned on syslog for Adguard. From what I could see in the querylog it had crashed about 20 minutes before I realized. Looking to see if it generates any crash log info, but main syslog had no events during the gap which looked odd...

You may also want to add a delay between found dead check and start and then following found alive but not responding... From what I see, it is starting up and then killing it and trying again because it didn't start up quick enough.
Do me a favor, time for me how many seconds it takes to complete a check on a normal scenario, I am going to factor that into the check.
at the beginning of the check put
Code:
start=`date +%s`

at the end of the check put
Code:
end=`date +%s`
runtime=$((end-start))
echo "$runtime"
 
Encountered this today. Anyone have met with this before?

Code:
Feb  5 15:17:55 RT-AC86U-7510 AdGuardHome[31767]: 2022/02/05 15:17:40.849763 [error] handling tcp: handling tcp request: talking to dns upstream: getting connection to tls://security.cloudflare-dns.com:853: connecting to security.cloudflare-dns.com: read tcp [WAN IPV4]:59031->1.0.0.2:853: i/o timeout
Feb  5 15:19:13 RT-AC86U-7510 AdGuardHome[31767]: 2022/02/05 15:18:35.030329 [info] responding to udp request: writing message: write udp [::]:53->192.168.1.181:60777: i/o timeout
Feb  5 15:19:36 RT-AC86U-7510 AdGuardHome[31767]: 2022/02/05 15:19:36.528230 [info] responding to udp request: writing message: write udp [::]:53->192.168.1.161:49293: i/o timeout
Feb  5 15:20:15 RT-AC86U-7510 AdGuardHome[31767]: 2022/02/05 15:20:12.105887 [error] handling tcp: handling tcp request: talking to dns upstream: getting connection to tls://security.cloudflare-dns.com:853: connecting to security.cloudflare-dns.com: write tcp [WAN IPV4]:46889->1.1.1.2:853: i/o timeout
Feb  5 15:21:22 RT-AC86U-7510 AdGuardHome[31767]: 2022/02/05 15:21:22.588635 [error] handling tcp: handling tcp request: talking to dns upstream: getting connection to tls://security.cloudflare-dns.com:853: connecting to security.cloudflare-dns.com: read tcp [WAN IPV4]:59408->1.0.0.2:853: i/o timeout
Feb  5 15:21:43 RT-AC86U-7510 AdGuardHome[31767]: 2022/02/05 15:21:43.979173 [error] handling tcp: handling tcp request: talking to dns upstream: getting connection to tls://security.cloudflare-dns.com:853: connecting to security.cloudflare-dns.com: read tcp [WAN IPV4]:59361->1.0.0.2:853: i/o timeout
Feb  5 15:22:25 RT-AC86U-7510 AdGuardHome[31767]: 2022/02/05 15:22:25.647789 [info] responding to udp request: writing message: write udp [::]:53->192.168.1.135:51080: i/o timeout
Feb  5 15:22:59 RT-AC86U-7510 AdGuardHome[31767]: 2022/02/05 15:22:27.994767 [error] handling tcp: handling tcp request: talking to dns upstream: getting connection to tls://security.cloudflare-dns.com:853: connecting to security.cloudflare-dns.com: read tcp [WAN IPV6]:34903->[2606:4700:4700::1002]:853: i/o timeout
Feb  5 15:23:58 RT-AC86U-7510 AdGuardHome[31767]: 2022/02/05 15:23:48.231218 [error] handling tcp: handling tcp request: talking to dns upstream: getting connection to tls://security.cloudflare-dns.com:853: connecting to security.cloudflare-dns.com: write tcp [WAN IPV4]:59151->1.0.0.2:853: i/o timeout
Feb  5 15:23:58 RT-AC86U-7510 AdGuardHome[31767]: 2022/02/05 15:23:49.776286 [error] handling tcp: handling tcp request: talking to dns upstream: getting connection to tls://security.cloudflare-dns.com:853: connecting to security.cloudflare-dns.com: read tcp [WAN IPV4]:47523->1.1.1.2:853: i/o timeout
Feb  5 15:23:58 RT-AC86U-7510 AdGuardHome[31767]: 2022/02/05 15:23:51.417432 [info] responding to udp request: writing message: write udp [::]:53->[fe80::a2c:2664:1e49:9711%br0]:56501: i/o timeout
 
Cloudflare had issues this am. Your router is telling you that since its one of your up stream dns sources.

To avoid whole home outages its good to have at least two seperate upstream providers like cloudflare and google.
Its not as likely both with have an issue at the same time.
 
https://github.com/jumpsmm7/Asuswrt-Merlin-AdGuardHome-Installer/commits/master

Install/Update/Reconfig/Uninstall:​

Run this command from ssh shell and following the prompt for AdGuardHome:

Code:
curl -L -s -k -O https://raw.githubusercontent.com/jumpsmm7/Asuswrt-Merlin-AdGuardHome-Installer/master/installer && sh installer

Commands to Stop/Start/Restart AdGuardHome​


Code:
/opt/etc/init.d/S61AdGuardHome {stop|start|restart}

How to check if it works​

Run this command in the ssh shell:
Code:
pidof AdGuardHome
will return a number.
or
Code:
/opt/etc/init.d/S99AdGuardHome check
which will return
Code:
 Checking AdGuardHome...              alive.

  1. While this is an ad-blocker just like Diversion, for all intensive purposes it shall be treated as an alternative and not a replacement. Diversion will continue to function as is.
  2. This script is not intended to be run on Access Points or Bridges.
  3. While browser adblocking can benefit along side AdGuardHome, AdGuardHome is meant to be your only DNS ad-blocking solution, support will not be provided for missconfigurations involving more than one DNS ad-blocking solution.
  4. This script is only intended to install AdGuardHome as a basic local DNS service on an Asuswrt-Merlin router running in router mode, any extra configurations or missconfigurations on your part are beyond the scope of this installer.
  5. This script does not install/configure AdGuardHome as a Remote DoH,DoT,DoQ, or Dnscrypt DNS server.
  6. Feel free to use this thread to share information with each other.

Hello. If I install AdGuardHome and it simply does not work with my configuration and I cannot resolve it, will uninstalling it restore my scripts back to a working state? I have Diversion, Skynet and Entware installed. Thankfully they all run flawlessly as debugging this stuff would put me in the loony bin.

thanks,
 
Hello. If I install AdGuardHome and it simply does not work with my configuration and I cannot resolve it, will uninstalling it restore my scripts back to a working state? I have Diversion, Skynet and Entware installed. Thankfully they all run flawlessly as debugging this stuff would put me in the loony bin.

thanks,
I have uninstall a few times and have no issues.
 
Just realized v1.1.7 is available. Updated to it and everything is working fine.
What I noticed is all my cronjob are still intact without the need to reboot. Also noticed a more aggressive check
Code:
*/2 * * * * for i in {1..5}; do /opt/etc/init.d/S99AdGuardHome check; sleep 15; done #S99AdGuardHome#
With the loop and sleep interval, is the intention to make it run every 15 seconds for a total of 5 times every 2 minutes? Somehow looks like cronjob does not like {1..5} and now it run once every 2 minutes. cronjob takes 1 2 3 4 5 though.
 
Just realized v1.1.7 is available. Updated to it and everything is working fine.
What I noticed is all my cronjob are still intact without the need to reboot. Also noticed a more aggressive check
Code:
*/2 * * * * for i in {1..5}; do /opt/etc/init.d/S99AdGuardHome check; sleep 15; done #S99AdGuardHome#
With the loop and sleep interval, is the intention to make it run every 15 seconds for a total of 5 times every 2 minutes? Somehow looks like cronjob does not like {1..5} and now it run once every 2 minutes. cronjob takes 1 2 3 4 5 though.
sounds about right. and it works. patching now.
 
Just realized v1.1.7 is available. Updated to it and everything is working fine.
What I noticed is all my cronjob are still intact without the need to reboot. Also noticed a more aggressive check
Code:
*/2 * * * * for i in {1..5}; do /opt/etc/init.d/S99AdGuardHome check; sleep 15; done #S99AdGuardHome#
With the loop and sleep interval, is the intention to make it run every 15 seconds for a total of 5 times every 2 minutes? Somehow looks like cronjob does not like {1..5} and now it run once every 2 minutes. cronjob takes 1 2 3 4 5 though.
Done.
 
Just went ahead and pushed v1.1.8 to encompass all the new changes. Next plan is to come up with an update check for edge version, currently the installer can only check beta and release versions.
 
is there any way to get debug logging out of AGH? anything that needs checking to be up every 2 minutes cannot be considered stable :eek: :(
curious to see if we can narrow down the root cause of the exits


EDIT: Apparently this should do it
The debug logging is able to be enabled, I will research it more, but from my understanding, the problem could be as simple as the router killing the process in favor of other reasources, but i am not even sure how to begin to troubleshoot if that is the case. I have seen the router do such with other similar go style daemon processes running in similar manner to adguardhome. If this is the case I am not sure placing the debug log at higher verbosity will help too much because the normal process should show that it is being killed in the regular logs which is the case if you manually kill the process yourself. Adguardhome does output logs indicating killing of the process.
 
The debug logging is able to be enabled, I will research it more, but from my understanding, the problem could be as simple as the router killing the process in favor of other reasources, but i am not even sure how to begin to troubleshoot if that is the case. I have seen the router do such with other similar go style daemon processes running in similar manner to adguardhome. If this is the case I am not sure placing the debug log at higher verbosity will help too much because the normal process should show that it is being killed in the regular logs which is the case if you manually kill the process yourself. Adguardhome does output logs indicating killing of the process.
at the very least, it might help rule in or out a pattern of activity in AGH that leads to it terminating
 
at the very least, it might help rule in or out a pattern of activity in AGH that leads to it terminating
From other users logs , it seems other deamons are impacted at the same time. Numerous processes are restarted at the same time, kind of like if the router had been rebooted. Most likely a wan connection restart or something along those lines. Adguardhome probably crashes at that point and there is no indication because the debug is not enabled. Still this seems to be speculation from the other users logs I have seen so far.
 
Last edited:
is there any way to get debug logging out of AGH? anything that needs checking to be up every 2 minutes cannot be considered stable :eek: :(
curious to see if we can narrow down the root cause of the exits


EDIT: Apparently this should do it
At your advice I considerably relaxed the checks for now.
 
at the very least, it might help rule in or out a pattern of activity in AGH that leads to it terminating
I enabled the verbose logging to /opt/var/log/AdGuardHome.log, coincidentally this is where all the logs are being sent now.
I setup my own scribe filter to view it through UiScribe


Code:
# put AdGuardHome messages into /opt/var/log/AdGuardHome.log

destination d_AdGuardHome {
    file("/opt/var/log/AdGuardHome.log");
};

filter f_AdGuardHome {
    program("AdGuardHome") or
    message("AdGuardHome");
};

log {
    source(src);
    filter(f_AdGuardHome);
    destination(d_AdGuardHome);
    flags(final);
};

#eof

I imagine by the time adguardhome fails, either the router would have crashed by the heavy verbose logging or someone would be spending hours trying to figure out what went wrong in the hail storm of mix sloppy verbose logging. all messages queries and debug are thrown into one file.
 
Last edited:

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top