Advertisement
phukao_itm

mikrotik-ws-captrue-LINE

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