Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Ping Variables
- :local avgRtt;
- :local pin
- :local pout
- :local pingit "8.8.8.8"
- :local WANINTERFACE
- :set WANINTERFACE pppoe-INDIHOME
- :local WANIP [/ip address get [find where interface=$WANINTERFACE] address];
- #Capture system identity for email subject
- :local sysID [/system identity get name]
- #Capture current time for logging
- :local datetime "$[/system clock get date] $[/system clock get time]"
- #Ping it real good
- /tool flood-ping $pingit count=10 do={
- :if ($sent = 10) do={
- :set avgRtt $"avg-rtt"
- :set pout $sent
- :set pin $received
- }
- }
- :local ploss (100 - (($pin * 100) / $pout))
- :local logmsg ("Ping Average for $pingit - ".[:tostr $avgRtt]."ms ")
- :log info $logmsg
- :log info message="Telegram Ping Results"
- delay 2
- :tool fetch url="https://api.telegram.org/bot817556732:AAGcaYARM4KI7nifYCzyL8rOLhU3JMpf-SE/sendMessage\?chat_id=928847447&text=Result:$pingit %0A$logmsg Pingtest results for user $sysID $WANIP $datetime " keep-result=no
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement