Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ######## MIKROTIK - DIAY GRAPHING CAPTURE REPORT - TELEGRAM #########
- # #
- # build 0.2.20231105 public review #
- # BY: PHUKAO PONGSUWAN #
- # #
- # LINE Script: https://pastebin.com/Jk9kjH2A #
- # TELEGRAM Script: https://pastebin.com/v6RCJqBh #
- # #
- # * * * * IF USE ROS > v7.10 please use * * * * * #
- # LINE Script: https://pastebin.com/w6vWjjav #
- # TELEGRAM Script: https://pastebin.com/jnRBkwCx #
- # #
- # Capture with https://github.com/elestio/ws-screenshot #
- # #
- # fix 20231105 - add uniq value in url to avoid caching #
- # #
- # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
- # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
- # #
- # !!! NEED THIS SCRIPT "func_LINEdateTime" as INCLUDE FIELS !!!! #
- # #
- # https://pastebin.com/tznx0BSu #
- # #
- # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
- #
- # Multiple interface use =>
- #
- # :local interfaces { "<interface-name-1>"; "<interface-name-2>"; "<interface-name-n>" }
- #
- :local interfaces { "<interface-name>" }
- :local telegramtoken "<TELEGRAM_TOKEN>"
- :local telegramchannel "<TELEGRAM CHANNEL>"
- :local domainWS "<DOMAIN_OR_IP_WS-CAPTURE-SERVICE>"
- :local domianGRAPH "<IP_PORT_TO_GRAPH>"
- :local msg "<MESSAGE TEXT>"
- :local datetime [[:parse [/system/script/get func_LINEdateTime source]]]
- :local msg "$msg$datetime"
- /tool/fetch url="https://api.telegram.org/bot$telegramtoken/sendmessage?chat_id=$telegramchannel&text=$msg" http-method=get output=none
- :foreach inf in=$interfaces do={
- :local uniq [:rndnum from=100000 to=999999]
- :local url "https://$domainWS/api/screenshot%3Funiq=$uniq%26resX=1024%26resY=500%26outFormat=png%26waitTime=50%26isFullPage=true%26url=http://$domianGRAPH/graphs/iface/$inf/"
- /tool/fetch url="https://api.telegram.org/bot$telegramtoken/sendPhoto?chat_id=$telegramchannel&photo=$url" http-method=get output=none
- :log info ("Telegram: $msg - $inf")
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement