Follow us on...
Follow us on G+ Follow us on Twitter Follow us on Facebook Watch us on YouTube
Register
Results 1 to 15 of 15
  1. #1
    Status
    Offline
    guebanget's Avatar
    Baru Gabung
    Join Date
    Sep 2007
    Posts
    7
    Reviews
    Read 0 Reviews
    Downloads
    0
    Uploads
    0
    Feedback Score
    0

    Question .:: Scripit U/ Find Queue Name + Set Enable/Disable ::>

    Om om master, akuy mu minta ilmunya boleh? Begini om, gimana sih script untuk nyari List Simple Queue berdasarkan Queue namenya, trus langsung set enable/disable klo ketemu, contoh 12 list queue seperti ini :
    ======================
    Name ---------- Disable
    ======================
    Client01_128 ----- No
    Client02_128 ----- No
    Client03_64 ------ No
    Client04_64 ------ No

    xClient01_64 ----- Yes
    xClient02_64 ----- Yes
    xClient03_32 ----- Yes
    xClient04_32 ----- Yes

    xxClient01_32 ---- Yes
    xxClient02_32 ---- Yes
    xxClient03_24 ---- Yes
    xxClient04_24 ---- Yes
    ======================
    Misalkan kita mu set enable yang quenamenya mengandung kata "xClient" sementara yang lainnya d set disable, itu gimana yah caranya? Mohon pencerahannya..... Click here to enlarge
    Last edited by guebanget; 16-09-2007 at 16:32.

  2. #2
    Status
    Offline
    d3v4's Avatar
    Forum Guru
    Join Date
    Jul 2007
    Location
    di alam baka
    Posts
    1,015
    Reviews
    Read 0 Reviews
    Downloads
    0
    Uploads
    0
    Feedback Score
    0
    /que simple set [/que simple find=bakpao] max-limit=1000000/1000000

  3. #3
    Status
    Offline
    okto_2005's Avatar
    Member Super Senior
    Join Date
    Jul 2007
    Posts
    655
    Reviews
    Read 0 Reviews
    Downloads
    0
    Uploads
    0
    Feedback Score
    0
    lebih jelasnya lihat sini:

  4. #4
    Status
    Offline
    azzura's Avatar
    Baru Gabung
    Join Date
    Aug 2007
    Posts
    6
    Reviews
    Read 0 Reviews
    Downloads
    0
    Uploads
    0
    Feedback Score
    0
    /que simple set [/que simple find=bakpao] max-limit=1000000/1000000

    saya coba contoh scriptnya kok ndak mau jalan ya Click here to enlarge
    saya pakai dom versi 2.9.48

  5. #5
    Status
    Offline
    okto_2005's Avatar
    Member Super Senior
    Join Date
    Jul 2007
    Posts
    655
    Reviews
    Read 0 Reviews
    Downloads
    0
    Uploads
    0
    Feedback Score
    0
    jangan di tulis bakpao dong.... Click here to enlarge

    /queue simple disable [find name="Client01_128"]

    kalo client cuman sedikit ulangin aja/dikopi dibaris bawahnya, kecuali ada >10 client pake loop

    :for i from=1 to=100 step=1 do={/queue simple disable [find name="Client0".$i. "_128"]}
    Last edited by okto_2005; 08-11-2007 at 07:14.

  6. #6
    Status
    Offline
    azzura's Avatar
    Baru Gabung
    Join Date
    Aug 2007
    Posts
    6
    Reviews
    Read 0 Reviews
    Downloads
    0
    Uploads
    0
    Feedback Score
    0

    Wink

    Sip,

    tidak terpikir untuk di looping di nama Click here to enlarge

    tapi sekarang saya sudah bisa, kebetulan cara saya pakai foreach, jadi walau namanya tidak memakai urutan nomer atau bahkan berbeda beda tetap bisa dan tidak perlu mendefinisikan jumlah berapa kali harus loop.

    btw terimakasih untuk idenya

  7. #7
    Status
    Offline
    d3v4's Avatar
    Forum Guru
    Join Date
    Jul 2007
    Location
    di alam baka
    Posts
    1,015
    Reviews
    Read 0 Reviews
    Downloads
    0
    Uploads
    0
    Feedback Score
    0
    Click here to enlarge

    kan klo di tulis bakpao jadi penasaran.. jadi kutak katik script sendiri

  8. #8
    Status
    Offline
    guebanget's Avatar
    Baru Gabung
    Join Date
    Sep 2007
    Posts
    7
    Reviews
    Read 0 Reviews
    Downloads
    0
    Uploads
    0
    Feedback Score
    0
    Click here to enlarge Originally Posted by okto_2005 Click here to enlarge
    jangan di tulis bakpao dong.... Click here to enlarge

    /queue simple disable [find name="Client01_128"]

    kalo client cuman sedikit ulangin aja/dikopi dibaris bawahnya, kecuali ada >10 client pake loop

    :for i from=1 to=100 step=1 do={/queue simple disable [find name="Client0".$i. "_128"]}
    Kok pake looping di saya "invalid argument name" yah??? Click here to enlarge

    (di test di queue yang namenya Client010_128 s/d Client099_128)
    Last edited by guebanget; 12-11-2007 at 12:48.

  9. #9
    Status
    Offline
    okto_2005's Avatar
    Member Super Senior
    Join Date
    Jul 2007
    Posts
    655
    Reviews
    Read 0 Reviews
    Downloads
    0
    Uploads
    0
    Feedback Score
    0
    oups sorry telah gue baca2 lagi di manual, untuk name ga bisa dikasi looping gitu, jadinya harus kalimat lengkap:

    Notes

    Variable substitution, command substitution and expressions are allowed only for path_args and unnamed parameter values. prefix, path, action and name[=value] pairs can be given only directly, as a word. Therefore, Click here to enlargeut (1 + 2) is valid and Click here to enlarge"pu" . "t") 3 is not.

  10. #10
    Status
    Offline
    lini's Avatar
    Forum Guru
    Join Date
    Sep 2007
    Location
    Karawaci
    Posts
    1,961
    Reviews
    Read 0 Reviews
    Downloads
    0
    Uploads
    0
    Feedback Score
    2 (100%)
    Lom pernah coba...tapi gimana kalo dijadiin variable dulu, misal (logic aja yah)

    for $i=1 to 100 do
    {
    $nama = "client_0".$i;
    /queue simple disable [find name=$nama];
    }

    mungkin getu...kaleeee Click here to enlarge

  11. #11
    Status
    Offline
    okto_2005's Avatar
    Member Super Senior
    Join Date
    Jul 2007
    Posts
    655
    Reviews
    Read 0 Reviews
    Downloads
    0
    Uploads
    0
    Feedback Score
    0
    mungkin bisa juga Click here to enlarge

  12. #12
    Status
    Offline
    eethore's Avatar
    Baru Gabung
    Join Date
    Jan 2008
    Posts
    3
    Reviews
    Read 0 Reviews
    Downloads
    0
    Uploads
    0
    Feedback Score
    0
    kalau saya punya client yang banyak...
    cape juga bikin mangle satu-satu...

    gimana scriptnya ya? biar tinggal dijalanin kan enak tuh ngelopping dari 192.168.5.1 sampai 192.168.5.255...
    sekali jalan langsung jadi

    hasil-nya saya pengen kaya gini salah satu contoh ip-nya

    add chain=forward dst-address=192.168.5.55 connection-mark=all-conn \
    src-address-list=!nice action=mark-packet new-packet-mark=ip5.55.down.int \
    passthrough=yes comment="ip5.55" disabled=no
    add chain=forward dst-address=192.168.5.55 connection-mark=all-conn \
    src-address-list=nice action=mark-packet new-packet-mark=ip5.55.down.ixp \
    passthrough=yes comment="" disabled=no
    add chain=prerouting src-address=192.168.5.55 connection-mark=all-conn \
    dst-address-list=!nice action=mark-packet new-packet-mark=ip5.55.up.int \
    passthrough=yes comment="" disabled=no
    add chain=prerouting src-address=192.168.5.55 connection-mark=all-conn \
    dst-address-list=nice action=mark-packet new-packet-mark=ip5.55.up.ixp \
    passthrough=yes comment="" disabled=no

  13. #13
    Status
    Offline
    okto_2005's Avatar
    Member Super Senior
    Join Date
    Jul 2007
    Posts
    655
    Reviews
    Read 0 Reviews
    Downloads
    0
    Uploads
    0
    Feedback Score
    0
    1. pake address list aja ato
    2. kalo engga kenapa ga pake subnet??? 192.168.5.0/24 di src add nya? kalo mo pake equal BW loh.
    Last edited by okto_2005; 20-02-2008 at 16:44.

  14. #14
    Status
    Offline
    yosanpro's Avatar
    Co-Admin
    Join Date
    Nov 2007
    Location
    Bantul, Bantul, Yogyakarta
    Posts
    2,548
    Reviews
    Read 0 Reviews
    Downloads
    11
    Uploads
    4
    Feedback Score
    1 (100%)
    Aku mencoba variabel untuk name= bisa tuh, cuman syntaxnya diperhatikan, contoh untuk rename:

    Code:
    :for c from=1 to=100 do={
    /que sim set [find name=("client_0" . ($c))] name=("client" . ($c))
    }
    Kalo dari hasil trial and error-ku syntax nya aturannya kurang lebih gini:
    - kalo itu merupakan variabel gunakan tanda kurung (liat contoh diatas)
    - kalo menggunakan titik untuk menggabung string/array jangan lupa dikasih ekstra spasi "string 1" . "string 2" bukan "string 1"."string 2".
    Last edited by yosanpro; 29-02-2008 at 12:00.

  15. The Following User Says Thank You to yosanpro For This Useful Post:


  16. #15
    Status
    Offline
    okto_2005's Avatar
    Member Super Senior
    Join Date
    Jul 2007
    Posts
    655
    Reviews
    Read 0 Reviews
    Downloads
    0
    Uploads
    0
    Feedback Score
    0
    thanks atas infonya

 

 

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. queue tree or queue simple
    By c0nf in forum General Networking
    Replies: 116
    Last Post: 21-04-2013, 00:06
  2. [Info] Auto Enable P2P Firewall Rule in certain Time
    By okto_2005 in forum Scripting @ Mikrotik
    Replies: 5
    Last Post: 05-06-2009, 00:46
  3. Replies: 3
    Last Post: 29-09-2007, 16:25
  4. [ask] Beda Simple Queue deengan Queue Tree
    By tobi_cjr in forum General Networking
    Replies: 1
    Last Post: 09-08-2007, 16:37
  5. enable interface gagal terus
    By kresek in forum Beginner Basics
    Replies: 5
    Last Post: 06-08-2007, 14:36

Posting Permissions

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