Dismiss Notice

Welcome To SNBForums

SNBForums is a community for anyone who wants to learn about or discuss the latest in wireless routers, network storage and the ins and outs of building and maintaining a small network.

If you'd like to post a question, simply register and have at it!

While you're at it, please check out SmallNetBuilder for product reviews and our famous Router Charts, Ranker and plenty more!

NTP Daemon for ASUSWRT/Merlin

Discussion in 'Asuswrt-Merlin' started by kvic, Nov 6, 2015.

  1. kvic

    kvic Very Senior Member

    Joined:
    Aug 11, 2014
    Messages:
    1,480
    Location:
    Hong Kong
    Done and available from Github. Sorry for the much delay :)

     
    joegreat likes this.
  2. kvic

    kvic Very Senior Member

    Joined:
    Aug 11, 2014
    Messages:
    1,480
    Location:
    Hong Kong
    Changed. Thanks for reporting!
     
    joegreat likes this.
  3. kvic

    kvic Very Senior Member

    Joined:
    Aug 11, 2014
    Messages:
    1,480
    Location:
    Hong Kong
    Very happy to hear you enjoy the stuff. I recall seeing the NTP author recommended seven servers. It's okay to add as many as you like. I have eight on my setup (7 IPv4 1 IPv6). At the minimum, I suggest you to have three: NTP's algorithm will pick one as primary and two as backup and the rest will be on waiting list.

    Nevertheless, the quality of servers i.e. small "delay" and "jitter" is more crucial. You can check by "/jffs/bin/ntpq -pn" and look at the columns.
     
    joegreat likes this.
  4. joegreat

    joegreat Very Senior Member

    Joined:
    Jan 9, 2013
    Messages:
    1,478
    Location:
    Vienna, Austria
    Sorry, but the freshly downloaded ntpstats.sh script (ARM version) is still broken on Github... :rolleyes:

    [email protected]:/jffs/bin# diff ntpstats.sh ntpstats.sh.fixed
    --- ntpstats.sh
    +++ ntpstats.sh.fixed
    @@ -37,7 +37,7 @@

    export TZ=`cat /etc/TZ`

    -DATE=`date "+%a %b %e %H:%M %Y`
    +DATE=`date "+%a %b %e %H:%M %Y"`

    COMMON='-c SHADEA#475A5F -c SHADEB#475A5F -c BACK#475A5F -c CANVAS#92A0A520 -c AXIS#92a0a520 -c FONT#ffffff -c ARROW#475A5F -n TITLE:10 -n AXIS:9 -g -w 525 -h 175'
     
  5. kvic

    kvic Very Senior Member

    Joined:
    Aug 11, 2014
    Messages:
    1,480
    Location:
    Hong Kong
  6. joegreat

    joegreat Very Senior Member

    Joined:
    Jan 9, 2013
    Messages:
    1,478
    Location:
    Vienna, Austria
    Ahhh, ... I see! :rolleyes:

    But maybe you should then also update the Installation Guide - it still references the r2 version... ;)

    Sorry, but r3 has also an error in ntpstats.sh:
    [email protected]:/jffs/bin# ./ntpstats.sh
    ERROR: opening '/stats.rrd': No such file or directory

    Looks like line no. 35 is causing the error as the variable DBPATH is not defined - maybe you mismatched the variable with defined RDB at line 16 - at least using RDB is not causing an error anymore... :cool:

    Update: Line 35 need to look like this to work ${RRD_BIN}/rrdtool update ${RDB} \
     
    Last edited: Mar 21, 2017
    kvic likes this.
  7. kvic

    kvic Very Senior Member

    Joined:
    Aug 11, 2014
    Messages:
    1,480
    Location:
    Hong Kong
    Doh! You're right. I didn't test the data snapping portion of the code. That's why...

    A side note: In my local setup, I've separated the script into two scripts. One for data snapping and one for graphing. The graphing script will be run on demand and generate graphs to ramdisk when the page is loaded in lighttpd. Some variables are changed... I've to piece together to create this single script for the R3 package.

    Guess I've to update and make another upload. Meanwhile, anyone using R3 take note of @joegreat finding in #146.
     
    joegreat likes this.
  8. mikelees2

    mikelees2 Regular Contributor

    Joined:
    Feb 20, 2017
    Messages:
    57
    Location:
    U.S.A.
    I installed the NTP Daemon for ASUSWRT/Merlin today. It seems to be working ok but i just wanted to look at it so i ran the following command as root and got the following back.
    /root# ntpq -p
    -sh: ntpq: not found

    Anyone know what i forgot to do or need to do to get this to work?

    Thanks
     
  9. Martineau

    Martineau Very Senior Member

    Joined:
    Jul 8, 2012
    Messages:
    1,233
    Location:
    UK

    Try 'ntpd' :rolleyes:
     
  10. joegreat

    joegreat Very Senior Member

    Joined:
    Jan 9, 2013
    Messages:
    1,478
    Location:
    Vienna, Austria
    You need to learn what PATH mean in Linux... :rolleyes:

    If you are not in the folder of the ntpq binary file you need to use:
    [email protected]:/tmp/home/root# /jffs/bin/ntpq -p
    remote refid st t when poll reach delay offset jitter
    ==============================================================================
    +fetchmail.media 193.171.23.163 2 u 45m 1024 164 27.283 19.172 25.149
    *ts1.aco.net .PZF. 1 u 494 1024 377 13.828 -2.668 22.869
    ntp.cnh.at .INIT. 16 u - 1024 0 0.000 0.000 0.000
    +manage.mediainv 131.130.251.107 2 u 413 1024 41 25.889 -6.132 12.591



    If you in the folder where ntpq is installed you have to use:
    [email protected]:/jffs/bin# ./ntpq -p
    remote refid st t when poll reach delay offset jitter
    ==============================================================================
    +fetchmail.media 193.171.23.163 2 u 45m 1024 164 27.283 19.172 25.149
    *ts1.aco.net .PZF. 1 u 506 1024 377 13.828 -2.668 22.869
    ntp.cnh.at .INIT. 16 u - 1024 0 0.000 0.000 0.000
    +manage.mediainv 131.130.251.107 2 u 425 1024 41 25.889 -6.132 12.591
     
  11. joegreat

    joegreat Very Senior Member

    Joined:
    Jan 9, 2013
    Messages:
    1,478
    Location:
    Vienna, Austria
    You need to learn what PATH mean in Linux... :rolleyes:

    If you are not in the folder of the ntpq binary file you need to use:
    [email protected]:/tmp/home/root# /jffs/bin/ntpq -p

    If you in the folder where ntpq is installed you have to use:
    [email protected]:/jffs/bin# ./ntpq -p
     
    mikelees2 likes this.
  12. mikelees2

    mikelees2 Regular Contributor

    Joined:
    Feb 20, 2017
    Messages:
    57
    Location:
    U.S.A.
    Thank you very much.
    This worked great. Thanks again
     
  13. kvic

    kvic Very Senior Member

    Joined:
    Aug 11, 2014
    Messages:
    1,480
    Location:
    Hong Kong
    Done. Package: ntpd_stats-arm-R3-1.tar.gz
     
    swetoast and joegreat like this.
  14. swetoast

    swetoast Guest

    Joined:
    Apr 12, 2016
    Messages:
    804
  15. Beherit

    Beherit Regular Contributor

    Joined:
    Sep 19, 2016
    Messages:
    64
    I've upgraded to R3-1, but dont't get the nice, darker colour theme in the webUI.

    I uninstalled everything completely, and then reinstalled it according to the instructions. The good news are that all of the previous hiccups are gone, no workarounds are needed any longer. But I still have the same old yellowish graphs and not the new orange ones.

    Edit: Silly me, the web browser still had the old .css colour code cached.

    I decided to leave this post in case someone else is scratching their head. :oops:
     
    kvic likes this.
  16. JemTheWire

    JemTheWire Regular Contributor

    Joined:
    Jan 12, 2016
    Messages:
    76
    Location:
    UK, Manchester
    I must be dumb, I am certainly a noob but following the installation guide, when I enter 'ntpd_stats-arm-R3-1.tar.gz' in step 3 for an ARM router, I get ntpd_stats-arm-R3-1.tar.gz not found. What can I do?
     
  17. kvic

    kvic Very Senior Member

    Joined:
    Aug 11, 2014
    Messages:
    1,480
    Location:
    Hong Kong
    Just made correction in Step 3 (replaced "ntpd_stats-arm-R2.tar.gz" with "ntpd_stats-arm-R3-1.tar.gz" in the wget URL).
     
  18. JemTheWire

    JemTheWire Regular Contributor

    Joined:
    Jan 12, 2016
    Messages:
    76
    Location:
    UK, Manchester
    Sorry, but I still get "ntpd_stats-arm-R3-1.tar.gz not found".

    Everything up to this point went well, but don't seem to be able to get this all important file.

    What am I doing wrong?

    Edit: Sorted! I've got it working, graphs and all. Sorry to have been a pain, steep learning curve for me.

    Thanks!
     
    Last edited: Apr 14, 2017
  19. JemTheWire

    JemTheWire Regular Contributor

    Joined:
    Jan 12, 2016
    Messages:
    76
    Location:
    UK, Manchester
    One more question though.

    Do I still have to keep the NTP server entry in the Admin page, or can I delete it?

    Thanks again.
     
  20. joegreat

    joegreat Very Senior Member

    Joined:
    Jan 9, 2013
    Messages:
    1,478
    Location:
    Vienna, Austria
    You should delete it by all means: What does a secure DNS help if the router can fall back to the default insecure one??? :confused:
     

Share This Page