What's new

ntpMerlin ntpMerlin - NTP Daemon for AsusWRT Merlin

  • 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!

Jack Yaz

Part of the Furniture
v3.0.0
Updated 2020-10-24

ntpMerlin implements an NTP time server for AsusWRT Merlin with charts for daily, weekly and monthly summaries of performance. A choice between ntpd and chrony is available.

ntpMerlin is free to use under the GNU General Public License version 3 (GPL 3.0).

This project is hosted on GitHub

Love the script and want to support future development? Any and all donations gratefully received!
PayPal donation
Buy me a coffee

Supported firmware versions
You must be running Merlin 384.15/384.13_4 or Fork 43E5 (or later) Asuswrt-Merlin

Installation
Using your preferred SSH client/terminal, copy and paste the following command, then press Enter:
Code:
/usr/sbin/curl --retry 3 "https://raw.githubusercontent.com/jackyaz/ntpMerlin/master/ntpmerlin.sh" -o "/jffs/scripts/ntpmerlin" && chmod 0755 /jffs/scripts/ntpmerlin && /jffs/scripts/ntpmerlin install

Usage
WebUI
ntpMerlin can be configured via the WebUI, in the Addons section.

Command Line
To launch the ntpMerlin menu after installation, use:
Code:
ntpmerlin

If this does not work, you will need to use the full path:
Code:
/jffs/scripts/ntpmerlin
 
Last edited:
Screenshots

ea90b33f61.png


b48a8bf2bf.png
 
Last edited:
Thank you, I tired this on my AC86U about a year ago and had problems getting it to work. At the same time I was trying to setup syslog-ng and had more serious issues. I finally gave up on both.

I just ran this script and it was so quick and painless I almost thought it did not work.

Now the question is does it use the time server settings in the router? No reason to think otherwise, I just had too many attempts to contact servers in countries that I would rather not have connection attempts.

This looks like another candidate for @thelonelycoder to add to amtm menu. :D
 
Thank you, I tired this on my AC86U about a year ago and had problems getting it to work. At the same time I was trying to setup syslog-ng and had more serious issues. I finally gave up on both.

I just ran this script and it was so quick and painless I almost thought it did not work.

Now the question is does it use the time server settings in the router? No reason to think otherwise, I just had too many attempts to contact servers in countries that I would rather not have connection attempts.

This looks like another candidate for @thelonelycoder to add to amtm menu. :D
No, ntpd uses the time server settings in /jffs/configs/ntp.conf. By default this is pool.ntp.org servers which use geolocation DNS. However, I have noticed inconsistent results. You may want to use more specific pool servers such as 0.us.pool.ntp.org.
 
No, ntpd uses the time server settings in /jffs/configs/ntp.conf. By default this is pool.ntp.org servers which use geolocation DNS. However, I have noticed inconsistent results. You may want to use more specific pool servers such as 0.us.pool.ntp.org.
Ok, I added the four suggested on the NTP site for the us, 0-3 as you show. Now I am getting results in the graph, before that change it was not showing anything.
 
ACK!!! Jack, please use logger, not sed to write to syslog. Those of us that use syslog-ng almost as a rule have syslog.log symlinked to a file on a USB device. When you sed to it you destroy the symlink.
 
Last edited:
ACK!!! Jack, please use logger, not sed to write to syslog. Those of us that use syslog-ng almost as a rule have syslog.log symlinked to a file on a USB device. When you sed to it you destroy the symlink.
That was my original problem a year back trying to setup syslog-ng, was the symlink being killed. This is too bad, I like this graph. :oops:
 
ACK!!! Jack, please use logger, not sed to write to syslog. Those of us that use syslog-ng almost as a rule have syslog.log symlinked to a file on a USB device. When you sed to it you destroy the symlink.
Misread the sed line, Jack is deleting something from the syslog, not writing to it. Same problem, please don't do that either Jack. :)
 
Misread the sed line, Jack is deleting something from the syslog, not writing to it. Same problem, please don't do that either Jack. :)

Just need to add --follow-symlink to the sed command


Sent from my iPhone using Tapatalk
 
Just need to add --follow-symlink to the sed command
--follow-symlink isn't compiled into busybox's sed. Using that would require installing Entware's sed.
 
ACK!!! Jack, please use logger, not sed to write to syslog. Those of us that use syslog-ng almost as a rule have syslog.log symlinked to a file on a USB device. When you sed to it you destroy the symlink.
Sadly dropping that line means a cron line being printed every 5 minutes. Syslog-ng users feel free to comment the line in the script for the time being - until I can find a way to keep everyone happy
 
Sadly dropping that line means a cron line being printed every 5 minutes. Syslog-ng users feel free to comment the line in the script for the time being - until I can find a way to keep everyone happy
And on that note... I think I've got something

@cmkelley could you confirm how/where you symlink the log files to?
 
Also, slightly off-topic, but is there a way I can route all ntp traffic EXCEPT from one particular IP on my network to be routed to that same IP? I have a gps-driven time server on an RPi, so my ntp.conf file on the router just points to it (I take a perverse pleasure in seeing that my network time is accurate to ~10 usec). I think I read somewhere it's not a good idea to use a GPS timeserver completely stand-alone, it should point to some external time servers as well. Can't remember the logic behind that though.
 
Also, slightly off-topic, but is there a way I can route all ntp traffic EXCEPT from one particular IP on my network to be routed to that same IP? I have a gps-driven time server on an RPi, so my ntp.conf file on the router just points to it (I take a perverse pleasure in seeing that my network time is accurate to ~10 usec). I think I read somewhere it's not a good idea to use a GPS timeserver completely stand-alone, it should point to some external time servers as well. Can't remember the logic behind that though.
Yes, I think you can add -s ! IP to the dnat rule in the script

(if not that, then ! -s IP)
 
--follow-symlink isn't compiled into busybox's sed. Using that would require installing Entware's sed.

Given this script now relies on entware anyway is that an issue


Sent from my iPhone using Tapatalk
 
Given this script now relies on entware anyway is that an issue
Entware's sed is not automatically installed with Entware. If we can get away with not requiring it, so much the better.
 
Given this script now relies on entware anyway is that an issue


Sent from my iPhone using Tapatalk
My current idea shouldn't require any additional packages. I would script it to test now but its 6.30am and my wife and pets are still quietly asleep, so I'm reluctant to disturb them!

I have to get up around 7 anyway to take the dog for a walk, so there should be time for a small update this morning
 
My current idea shouldn't require any additional packages. I would script it to test now but its 6.30am and my wife and pets are still quietly asleep, so I'm reluctant to disturb them!

I have to get up around 7 anyway to take the dog for a walk, so there should be time for a small update this morning

Guess it’s easy enough to sed to a tmp file and then cat it into the original - that would follow the symlink and is all that -i does anyway.


Sent from my iPhone using Tapatalk
 
Code:
 Checking ntpd...              dead.
 Starting ntpd...              failed.
ntpq: error while loading shared libraries: libcrypto.so.1.1: cannot open shared object file: No such file or directory
Receive the above when running the script; what am I missing?
 

Similar threads

Latest threads

Sign Up For SNBForums Daily Digest

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