Solo Cyber City

Catatan Telogodog Belajar MikroTik

Traffic Monitor

Ditulis oleh telogodog di/pada Maret 29, 2009

Bahasa Indonesia

Traffic monitor executes scripts on a specific datarate throough an interface.

Specifications

Packages required: advanced-tools
License required: Level1
Submenu level: /tool traffic-monitor
Standards and Technologies: none
Hardware usage: Not significant

Related Documents

Traffic Monitor

Submenu level: /tool traffic-monitor

Description

The traffic monitor tool is used to execute console scripts when interface traffic crosses a given threshold. Each item in traffic monitor list consists of its name (which is useful if you want to disable or change properties of this item from another script), some parameters, specifying traffic condition, and the pointer to a script or scheduled event to execute when this condition is met.

Property Description

interface (name) – interface to monitorname (name) – name of the traffic monitor itemon-event (name) – script source. Must be present under /system script threshold (integer; default: 0) – traffic thresholdtraffic (transmitted | received; default: transmitted) – type of traffic to monitor

transmitted – transmitted traffic
received – received traffic

trigger (above | always | below; default: above) – condition on which to execute the script

above – the script will be run each time the traffic exceeds the threshold
always – triggers scripts on both – above and below condition
below – triggers script in the opposite condition, when traffic reaches a value that is lower than the threshold

Example

In this example the traffic monitor enables the interface ether2, if the received treffic exceeds 15kbps on ether1, and disables the interface ether2, if the received traffic falls below 12kbps on ether1.

[admin@MikroTik] system script> add name=eth-up source={/interface enable ether2}
[admin@MikroTik] system script> add name=eth-down source={/interface disable
{... ether2}
[admin@MikroTik] system script> /tool traffic-monitor
[admin@MikroTik] tool traffic-monitor> add name=turn_on interface=ether1 \
\... on-event=eth-up threshold=15000 trigger=above traffic=received
[admin@MikroTik] tool traffic-monitor> add name=turn_off interface=ether1 \
\... on-event=eth-down threshold=12000 trigger=below traffic=received
[admin@MikroTik] tool traffic-monitor> print
Flags: X - disabled, I - invalid
  #   NAME           INTERFACE     TRAFFIC     TRIGGER THRESHOLD  ON-EVENT
  0   turn_on        ether1        received    above   15000      eth-up
  1   turn_off       ether1        received    below   12000      eth-down
[admin@MikroTik] tool traffic-monitor>

©

Tinggalkan Balasan

XHTML: Anda dapat gunakan tag ini: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <pre> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>