الأربعاء، 28 أغسطس 2013

معرفة كمية التحميل من الخطوط بكل سهولة

السلام عليكم ورحمة الله وبركاته
معانا النهاردة طريقة مبسطة جدا لمعرفة كمية الداتا من كل خط بسهولة

- غير اسم كارت الدخول الاول الى WAN1 والكارت الثالث الى WAN3
-ضع الاسكربت ده فى الترمنال


 
/file print file=Fnan-txL1
/file print file=Fnan-rxL1
/file print file=Fnan-FW1tx
/file print file=Fnan-FW1rx
/file print file=Fnan-txL3
/file print file=Fnan-rxL3
/file print file=Fnan-FW3tx
/file print file=Fnan-FW3rx
:delay 5s
/file set "Fnan-txL1.txt" contents="0"
/file set "Fnan-rxL1.txt" contents="0"
/file set "Fnan-FW1tx.txt" contents="0"
/file set "Fnan-FW1rx.txt" contents="0"
/file set "Fnan-txL3.txt" contents="0"
/file set "Fnan-rxL3.txt" contents="0"
/file set "Fnan-FW3tx.txt" contents="0"
/file set "Fnan-FW3rx.txt" contents="0"

:global trfctx1 (0)
:global trfcrx1 (0)
:global trfctx3 (0)
:global trfcrx3 (0)

:global lasttx1 (($trfctx1 + [/interface ethernet get WAN1 tx-bytes]) / 1024 / 1024 )
:global lastrx1 (($trfcrx1 + [/interface ethernet get WAN1 rx-bytes]) / 1024 / 1024 )
/interface ethernet set WAN1 comment "Tx=$lasttx1 MiB Rx=$lastrx1 MiB"
:global lasttx3 (($trfctx3 + [/interface ethernet get WAN3 tx-bytes]) / 1024 / 1024 )
:global lastrx3 (($trfcrx3 + [/interface ethernet get WAN3 rx-bytes]) / 1024 / 1024 )
/interface ethernet set WAN3 comment "Tx=$lasttx3 MiB Rx=$lastrx3 MiB"


/system scheduler
add disabled=no interval=8m name=Bandwidth on-event=": if ( [ /system resource\
    &#92;_get uptime  ] < &#92;"11m&#92;" ) do={&#92;r&#92;
    &#92;n:global trfctx1 [/file get &#92;"Fnan-txL1.txt&#92;" contents]&#92;r&#92;
    &#92;n}&#92;r&#92;
    &#92;n: if ( [ /system resource get uptime  ] < &#92;"11m&#92;" ) do={&#92;r&#92;
    &#92;n:global trfcrx1 [/file get &#92;"Fnan-rxL1.txt&#92;" contents]&#92;r&#92;
    &#92;n}&#92;r&#92;
    &#92;n: if ( [ /system resource get uptime  ] < &#92;"11m&#92;" ) do={&#92;r&#92;
    &#92;n:global trfctx3 [/file get &#92;"Fnan-txL3.txt&#92;" contents]&#92;r&#92;
    &#92;n}&#92;r&#92;
    &#92;n: if ( [ /system resource get uptime  ] < &#92;"11m&#92;" ) do={&#92;r&#92;
    &#92;n:global trfcrx3 [/file get &#92;"Fnan-rxL3.txt&#92;" contents]&#92;r&#92;
    &#92;n}" policy=&#92;
    ftp,reboot,read,write,policy,test,winbox,password,sniff,sensitive,api &#92;
    start-time=startup
add disabled=no interval=11m name=Bandwidth1 on-event=":global currenttx1 [/in&#92;
    terface ethernet get WAN1 tx-bytes]&#92;r&#92;
    &#92;n:global currentrx1 [/interface ethernet get WAN1 rx-bytes]&#92;r&#92;
    &#92;n:global currenttx3 [/interface ethernet get WAN3 tx-bytes]&#92;r&#92;
    &#92;n:global currentrx3 [/interface ethernet get WAN3 rx-bytes]&#92;r&#92;
    &#92;n/file set &#92;"Fnan-txL1.txt&#92;" contents=(&#92;$trfctx1 + &#92;$currenttx1)&#92;r&#92;
    &#92;n/file set &#92;"Fnan-rxL1.txt&#92;" contents=(&#92;$trfcrx1 + &#92;$currentrx1)&#92;r&#92;
    &#92;n/file set &#92;"Fnan-txL3.txt&#92;" contents=(&#92;$trfctx3 + &#92;$currenttx3)&#92;r&#92;
    &#92;n/file set &#92;"Fnan-rxL3.txt&#92;" contents=(&#92;$trfcrx3 + &#92;$currentrx3)&#92;r&#92;
    &#92;n/file set &#92;"Fnan-FW1tx.txt&#92;" contents=((&#92;$trfctx1 + &#92;$currenttx1)/ 1024 &#92;
    / 1024)&#92;r&#92;
    &#92;n/file set &#92;"Fnan-FW1rx.txt&#92;" contents=((&#92;$trfcrx1 + &#92;$currentrx1)/ 1024 &#92;
    / 1024)&#92;r&#92;
    &#92;n/file set &#92;"Fnan-FW3tx.txt&#92;" contents=((&#92;$trfctx3 + &#92;$currenttx3)/ 1024 &#92;
    / 1024)&#92;r&#92;
    &#92;n/file set &#92;"Fnan-FW3rx.txt&#92;" contents=((&#92;$trfcrx3 + &#92;$currentrx3)/ 1024 &#92;
    / 1024)&#92;r&#92;
    &#92;n:global lasttx1 ((&#92;$trfctx1 + [/interface ethernet get WAN1 tx-bytes]) /&#92;
    &#92;_1024 / 1024 )&#92;r&#92;
    &#92;n:global lastrx1 ((&#92;$trfcrx1 + [/interface ethernet get WAN1 rx-bytes]) /&#92;
    &#92;_1024 / 1024 )&#92;r&#92;
    &#92;n/interface ethernet set WAN1 comment &#92;"Tx=&#92;$lasttx1 MiB Rx=&#92;$lastrx1 MiB&#92;
    &#92;"&#92;r&#92;
    &#92;n:global lasttx3 ((&#92;$trfctx3 + [/interface ethernet get WAN3 tx-bytes]) /&#92;
    &#92;_1024 / 1024 )&#92;r&#92;
    &#92;n:global lastrx3 ((&#92;$trfcrx3 + [/interface ethernet get WAN3 rx-bytes]) /&#92;
    &#92;_1024 / 1024 )&#92;r&#92;
    &#92;n/interface ethernet set WAN3 comment &#92;"Tx=&#92;$lasttx3 MiB Rx=&#92;$lastrx3 MiB&#92;
    &#92;"&#92;r&#92;
    &#92;n" policy=&#92;
    ftp,reboot,read,write,policy,test,winbox,password,sniff,sensitive,api &#92;
    start-time=startup
 
 

ليست هناك تعليقات:

إرسال تعليق