mirror of
https://github.com/furaihan/simple-mikrotik-script.git
synced 2025-06-24 15:08:40 +02:00
some script added
added the following script:cpu monitoring, auto add dns address to addres list, and monitoring data usage send to telegram
This commit is contained in:
commit
8018bb5ef7
3 changed files with 136 additions and 0 deletions
27
data-usage-to-telegram
Normal file
27
data-usage-to-telegram
Normal file
|
@ -0,0 +1,27 @@
|
|||
:local keluar
|
||||
:delay 2s
|
||||
:local boros ([/interface get value-name=fp-rx-byte wlan1] + [/interface get value-name=fp-tx-byte wlan1])
|
||||
:delay 1s
|
||||
:local borostotal ($boros / 1024 / 1024 /1024);
|
||||
:delay 3s
|
||||
:local signall ("\F0\9F\93\B6 Signal Strength: ".[/int wir reg get value-name=signal-strength number=0]."%0A")
|
||||
:delay 5s
|
||||
:local murup ([/system resource get uptime])
|
||||
:local papan ([/system resource get board-name])
|
||||
:local ngalong ("MikroTik $papan%0A\E2\8C\9B Uptime: $murup%0A")
|
||||
:delay 5s
|
||||
:local ssid ("\F0\9F\86\94 SSID Connected: ".[/interface wireless get value-name=ssid wlan1]."%0A")
|
||||
:local MACAddr ("\F0\9F\8E\AC MAC Address: ".[/interface wireless get value-name=mac-address wlan1]."%0A")
|
||||
:local frequency ("\F0\9F\93\A1 Frequency Used: ".[/interface wireless get value-name=frequency wlan1]."%0A")
|
||||
:local RXTot ([/interface get wlan1 rx-byte])
|
||||
:local TXTot ([/interface get wlan1 tx-byte])
|
||||
:local byteyt ([/ip firewall filter get value-name=bytes number=3])
|
||||
:local TXGB ($TXTot / 1024 / 1024 / 1024);
|
||||
:local RXGB ($RXTot / 1024 / 1024 / 1024);
|
||||
:local YTGB ($byteyt / 1024 / 1024);
|
||||
:local upload ("\F0\9F\93\A4 Upload Usage: $TXGB GB%0A")
|
||||
:local download ("\F0\9F\93\A5 Download Usage $RXGB GB%0A")
|
||||
:local youtube ("\E2\96\B6 Youtube Usage: $YTGB MB%0A")
|
||||
:local catatan ("Data diatas adalah hasil perhitungan selama: $murup%0A")
|
||||
:set keluar ($ngalong.$ssid.$MACAddr.$frequency.$signall.$upload.$download.$youtube.$catatan."%0A")
|
||||
/tool fetch url="https://api.telegram.org/bot624175217:AAEbatoTY88FkeYvjwYQbzdlurwYjMOoaFU/sendMessage?chat_id=-487804024&text=$keluar" keep-result=no;
|
Loading…
Add table
Add a link
Reference in a new issue