Advertisement
Guest User

Untitled

a guest
Oct 14th, 2019
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.99 KB | None | 0 0
  1. #Ping Variables
  2. :local avgRtt;
  3. :local pin
  4. :local pout
  5. :local pingit "8.8.8.8"
  6. :local WANINTERFACE
  7. :set WANINTERFACE pppoe-INDIHOME
  8.  
  9. :local WANIP [/ip address get [find where interface=$WANINTERFACE] address];
  10.  
  11. #Capture system identity for email subject
  12. :local sysID [/system identity get name]
  13.  
  14. #Capture current time for logging
  15. :local datetime "$[/system clock get date] $[/system clock get time]"
  16.  
  17. #Ping it real good
  18. /tool flood-ping $pingit count=10 do={
  19.  
  20. :if ($sent = 10) do={
  21.  
  22. :set avgRtt $"avg-rtt"
  23.  
  24. :set pout $sent
  25.  
  26. :set pin $received
  27. }
  28.  
  29. }
  30.  
  31. :local ploss (100 - (($pin * 100) / $pout))
  32.  
  33. :local logmsg ("Ping Average for $pingit - ".[:tostr $avgRtt]."ms ")
  34.  
  35. :log info $logmsg
  36.  
  37. :log info message="Telegram Ping Results"
  38. delay 2
  39. :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