Follow us on...
Follow us on G+ Follow us on Twitter Follow us on Facebook Watch us on YouTube
Register
Results 1 to 1 of 1
  1. #1
    Status
    Offline
    Stillhard's Avatar
    Newbie
    Join Date
    Sep 2007
    Posts
    47
    Reviews
    Read 0 Reviews
    Downloads
    4
    Uploads
    0
    Feedback Score
    0

    Lightbulb Setting Time NTP Client over HTTP

    Untuk teman-teman yang kesulitan mengupdate waktu menggunakan fasilitas NTP client pada RouterOS atau RouterBoard atau CCR nya dikarenakan sesuatu hal, dan atau untuk teman-teman lainnya yang memiliki web hosting (atau bisa buat web server sendiri di dalam jaringan lokal) dan ingin berbagi, bisa menggunakan hasil oprekan saya berikut ini:

    Upload atau buat file yang kita namakan misal "time.php" dan di dalamnya diisi:
    PHP Code:
    <?php
    $body 
    file_get_contents('http://www.timeapi.org/utc/in+seven+hours?format=/system%20clock%20set%20date=\b/\d/\Y%20time=\H:\M:\S%20time-zone-name=Asia/Jakarta\n');
    echo 
    $body;
    ?>
    Setelah selesai di upload atau dibuat, silahkan dicoba untuk diakses jika berfungsi dengan baik silahkan lanjutkan dengan membuat script scheduler berikut ini yang otomatis akan mengupdate waktu sesuka kalian, dalam contoh ini saya coba untuk mengupdate setiap RouterOS saya restart:

    Code:
    /system scheduler
    add name=time-fetch on-event=time-http policy=\
        ftp,reboot,read,write,policy,test,winbox,password,sniff,sensitive,api \
        start-time=startup
    
    /system script
    add name=time-http policy=\
        ftp,reboot,read,write,policy,test,winbox,password,sniff,sensitive,api \
        source="delay 30;\r\
        \n:log info \"HTTP NTP Client Updater - Created by Stillhard\"\r\
        \n:log info \">> Fetching Time...\"\r\
        \n:log info \"------------------------------------------------------------\
        --------------\"\r\
        \n/tool fetch mode=http url=\"http://alamat_atau_ip_webserver/time.php\" dst-path=\
        \"time.rsc\"\r\
        \n:log info \"HTTP NTP Client Updater - Created by Stillhard\"\r\
        \n:log info \">> Fetching Done!\"\r\
        \n:log info \"------------------------------------------------------------\
        --------------\"\r\
        \ndelay 10;\r\
        \n:log info \"HTTP NTP Client Updater - Created by Stillhard\"\r\
        \n:log info \">> Updating Time...\"\r\
        \n:log info \"------------------------------------------------------------\
        --------------\"\r\
        \n/import file-name=time.rsc\r\
        \n:log info \"HTTP NTP Client Updater - Created by Stillhard\"\r\
        \n:log info \">> Time Updated!\"\r\
        \n:log info \"------------------------------------------------------------\
        --------------\"\r\
        \n:log info \"HTTP NTP Client Updater - Created by Stillhard\"\r\
        \n:log info \">> Sending Report to Email...\"\r\
        \n:log info \"------------------------------------------------------------\
        --------------\"\r\
        \n/tool e-mail send to=\"alamat_email@dotcom\" subject=\"Info from \
        your router (\$[/system identity get name])\" body=\"\$[/system clock get \
        date] \$[/system clock get time] - Time Updated!\"\r\
        \n:log info \"HTTP NTP Client Updater - Created by Stillhard\"\r\
        \n:log info \">> Email Sent!\"\r\
        \n:log info \"------------------------------------------------------------\
        --------------\"\r\
        \n:local str [/file find name=time.rsc];\r\
        \n/file remove \$str\r\
        \n:log info \"HTTP NTP Client Updater - Created by Stillhard\"\r\
        \n:log info \">> Job's Done\"\r\
        \n:log info \"------------------------------------------------------------\
        --------------\"\r\
        \n"
    Silahkan disesuaikan dengan kebutuhan teman-teman dan selamat berkreasi Click here to enlarge

    Sumber: RouterOS saya dan dari berbagai sumber Click here to enlarge
    Terima kasih atas ide yang saya lihat
    Last edited by Stillhard; 21-12-2013 at 04:58. Reason: Fixed 24 hours time format + Added return

  2. The Following User Says Thank You to Stillhard For This Useful Post:


 

 

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [Help] Session Time / Time Left User Hotspot Kacau.
    By proxy in forum HotSpot, The Dude & User Manager
    Replies: 17
    Last Post: 22-04-2014, 13:42
  2. [ASK] ping ke beberapa no ip client time out
    By noldy79_04@yahoo.com in forum General Networking
    Replies: 7
    Last Post: 29-05-2012, 19:01
  3. [Lowongan] Marketing ( Part Time or Full Time ), Staff NOC Wil.JakBar
    By coco_nk4l in forum Lowongan
    Replies: 4
    Last Post: 19-05-2012, 12:23
  4. GMn Ya Setting Date, Time Di Mikrotik Versi Command??
    By warkirasep in forum Wireless Networking
    Replies: 3
    Last Post: 31-01-2010, 15:33
  5. [ask] client linux gak bisa akses http
    By q-fuck in forum Beginner Basics
    Replies: 4
    Last Post: 21-12-2007, 01:51

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •