Community discussions

 
n3rvano
just joined
Topic Author
Posts: 2
Joined: Tue Oct 23, 2018 1:54 pm

Monitor traffic by telegram

Sun Feb 03, 2019 3:52 pm

Hello every one , i try so hard to make if statement with monitor traffic i write a code was oky for me to send every 1 hour the status of the traffic

what i need to make
if the traffic go down send message by email or telegram
##################SETUP CONFIG#########
#set the name of the interface to monitor
:local int "sfp-sfpplus1"
:local counter [/interface monitor-traffic [/interface find name=$int] once do={
:local tx ((tx-bits-per-second / 1000)/1000);
:local rx ((rx-bits-per-second / 1000)/1000);
:put $tx;
:put $rx;
:local limit "600" mbps
:local ipsend 10.10.90.10
#=========telegram-Setup========#
:local id 481471917:AAGCeYgjUk615ljdP6W9RLYvKlALnsssUMDzXoaaa  #(i change it ) for security reasons
:local chatid -21602sad1570                                                                        #(change it ) for security reasons
:if ($rx > $limit) do={
:log info "the traffic go down please call the admin of network"
 /tool fetch url="https://api.telegram.org/bot$id/sendMessage\?chat_id=$chatid&text=Hello,It's emergency Message call the admin of network the traffic now $rx" keep-result=no src-address=10.10.90.10 
        }
So can any one Help me to completely this mission



With all respect
 
n3rvano
just joined
Topic Author
Posts: 2
Joined: Tue Oct 23, 2018 1:54 pm

Re: Monitor traffic by telegram

Mon Feb 11, 2019 10:42 am

so any want need to help

Who is online

Users browsing this forum: vish1234 and 7 guests