Community discussions

 
Kurosudo
just joined
Topic Author
Posts: 20
Joined: Wed Aug 01, 2018 1:21 pm

If traffic is lower than 1Mbps run script

Tue Sep 18, 2018 9:09 am

Hello, i m trying make few scripts for my network and i found little problem.

Is there any way to monitor traffic if it is lower than 1Mbps? For example if traffic from ether2 is for example 512kbps run script.

I tried traffic-monitor but it will run script only if traffic peak 1Mbps. Is there any elegant way to do it?

Thanks :)
 
Kurosudo
just joined
Topic Author
Posts: 20
Joined: Wed Aug 01, 2018 1:21 pm

Re: If traffic is lower than 1Mbps run script

Tue Sep 18, 2018 9:31 am

I found how done it
/interface monitor-traffic ether1 once do={
:local up (tx-bits-per-second /1000 );
:local down (rx-bits-per-second /1000 );

:if ( $up < 1024 ) do={
:put "DOWN LINK"
}

:if ( $up > 1024 ) do={
:put "UP LINK"
}

}

Who is online

Users browsing this forum: No registered users and 10 guests