Advertisement
phukao_itm

mikrotik-ws-captrue-LINE (ROS v7.10++)

Jun 16th, 2023 (edited)
218
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ######## MIKROTIK - DIAY GRAPHING CAPTURE REPORT - LINE #########
  2. # #
  3. # build 0.3.20230616 public review #
  4. # BY: PHUKAO PONGSUWAN #
  5. # #
  6. # * * * * FOR ROS v7.10++ please use * * * * * #
  7. # LINE Script: https://pastebin.com/w6vWjjav #
  8. # TELEGRAM Script: https://pastebin.com/jnRBkwCx #
  9. # #
  10. # Capture with https://github.com/elestio/ws-screenshot #
  11. # #
  12. # fix 20231105 - add uniq value in url to avoid caching #
  13. # fix 20230616 - update uniq for ROS 7.10++ to more Uniq with date #
  14. # #
  15. # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
  16.  
  17. # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
  18. # #
  19. # !!! NEED THIS SCRIPT "func_LINEdateTime" as INCLUDE FIELS !!!! #
  20. # #
  21. # https://pastebin.com/tznx0BSu #
  22. # #
  23. # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
  24.  
  25. # Multiple interface use =>
  26. #
  27. # :local interfaces { "<interface-name-1>"; "<interface-name-2>"; "<interface-name-n>" }
  28.  
  29. :local interfaces { "<interface-name>" }
  30. :local token "<LINE_API_TOKEN>";
  31. :local domainWS "<DOMAIN_OR_IP_WS-CAPTURE-SERVICE>"
  32. :local domianGRAPH "<IP_PORT_TO_GRAPH>"
  33. :local msg "<MESSAGE TEXT>"
  34.  
  35.  
  36.  
  37. :foreach inf in=$interfaces do={
  38. :local datetime [[:parse [/system/script/get func_LINEdateTime source]]]
  39. :local uniq ([/system clock get date]."-".[:rndnum from=100000 to=999999])
  40. :local url "https://$domainWS/api/screenshot%3Funiq=$uniq%26resX=1024%26resY=500%26outFormat=png%26waitTime=50%26isFullPage=true%26url=http://$domianGRAPH/graphs/iface/$inf/"
  41.  
  42. :local postmsg "message=$msg$inf\n$datetime&imageThumbnail=$url&imageFullsize=$url"
  43.  
  44. /tool/fetch http-method=post \
  45. http-header-field="Content-Type: application/x-www-form-urlencoded\nAuthorization: Bearer $token" \
  46. http-data=$postmsg \
  47. https://notify-api.line.me/api/notify \
  48. output=none
  49.  
  50. :log info ("LINE Notify: $msg$inf")
  51. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement