Community discussions

MikroTik App

Search found 375 matches

  • 1
  • 2
by diamuxin
Tue Apr 09, 2024 8:59 pm
Forum: Announcements
Topic: NEW FEATURE: Back to Home VPN
Replies: 296
Views: 236551

Re: NEW FEATURE: Back to Home VPN

With the latest beta (7.15beta9), I now get this new message all the time when disconnecting (peer with resolver checked)
back-to-home-vpn: [peer19] CHWCHPuLuweWVZkq3r2HynUP59yxk3GsMX4i9XamAQw=: Handshake for peer did not complete after 20 attempts, giving up
by diamuxin
Tue Mar 19, 2024 12:13 pm
Forum: Scripting
Topic: RouterOS get uptime days [SOLVED]
Replies: 10
Views: 2148

Re: RouterOS get uptime days [SOLVED]

Please use the code tag, to avoid Cool smile face when posting code pre formatted.
Key </>
OK
by diamuxin
Tue Mar 19, 2024 11:35 am
Forum: Scripting
Topic: RouterOS get uptime days [SOLVED]
Replies: 10
Views: 2148

Re: RouterOS get uptime days [SOLVED]

I need the unit to be days. Try: # rextended's function (thanks Master) # Convert uptime to seconds :global timetoseconds do={ :local inTime $1 :local wPos [:find $inTime "w" -1] :local dPos [:find $inTime "d" -1] :local itLen [:find $inTime "." -1] ; :if ([:typeof $it...
by diamuxin
Sun Mar 17, 2024 11:59 pm
Forum: Scripting
Topic: Reprogramming WPS button to execute scripts [SOLVED]
Replies: 3
Views: 1249

Re: Reprogramming WPS button to execute scripts [SOLVED]

/system routerboard wps-button
set enabled=yes on-event=":if ([system leds settings get all-leds-off] = \"never\") do={\r\
    \n/system leds settings set all-leds-off=immediate \r\
    \n} else={\r\
    \n/system leds settings set all-leds-off=never \r\
    \n}"
by diamuxin
Sat Mar 16, 2024 9:13 pm
Forum: Scripting
Topic: How to delete backup and RSC files that have been stored for more than 1 month
Replies: 5
Views: 970

Re: How to delete backup and RSC files that have been stored for more than 1 month

Hi ! Please, how could a counter be added to know the number of files that the cycle is going to delete? { :global datetime2epoch /system clock :local now [$datetime2epoch ("$[get date] $[get time]")] :local wait 2592000 ; # seconds, 1 month :local fdate 0 :local countFiles /file :foreach ...
by diamuxin
Wed Mar 13, 2024 2:15 pm
Forum: Scripting
Topic: get IP ADDRESSES on interface
Replies: 13
Views: 15791

Re: get IP ADDRESSES on interface

{
/ip cloud
:local ipv4 [get public-address]
:local ipv6 [get public-address-ipv6]
:put $ipv4
:put $ipv6
}
by diamuxin
Wed Mar 13, 2024 10:25 am
Forum: Scripting
Topic: Network address instead of IP address
Replies: 5
Views: 390

Re: Network address instead of IP address

:global currentIP :local newIP [/ip address get [find interface="ether1"] address] :set newIP [:pick $newIP 0 [:find $newIP "/" -1]] :if ($newIP != $currentIP) do={ :put [/ip firewall/address-list/add list=wan_ip address=$newIP dynamic=yes] :put "ip address $currentIP chang...
by diamuxin
Tue Mar 12, 2024 4:30 pm
Forum: Announcements
Topic: v7.14.2 [stable] is released!
Replies: 556
Views: 128260

Re: v7.14.1 [stable] is released!

Version 7.15 will include WireGuard peer functionality "responder". Then you will be able to mark your peer as "responder". Then the peer will not spam your log, if you enable this option manually.
Great news!
Thank you very very much.
by diamuxin
Tue Mar 12, 2024 12:42 pm
Forum: Announcements
Topic: v7.14.2 [stable] is released!
Replies: 556
Views: 128260

Re: v7.14.1 [stable] is released!

of course this is expected behavior. people finally need to stop thinking of wireguard being just another server / client vpn software, which gives up after x unsuccessful connection attempts; it is not! once a peer has learned a peer's remote address, it will try to establish a connection indefini...
by diamuxin
Tue Mar 12, 2024 12:16 pm
Forum: Announcements
Topic: v7.14.2 [stable] is released!
Replies: 556
Views: 128260

Re: v7.14.1 [stable] is released!

WireGuard fix solves an issue where RouterOS was trying to connect to peers which have not been used yet and there is no known endpoint-address. WireGuard is a bidirectional tunnel. Once you connect peer, it knows "last remote endpoint" information and tries to connect to it. Fix solved t...
by diamuxin
Tue Mar 12, 2024 9:53 am
Forum: Announcements
Topic: v7.14.2 [stable] is released!
Replies: 556
Views: 128260

Re: v7.14.1 [stable] is released!

We can compare the configs, just in case: Thanks for sharing: My roadwarrior configuration: /interface wireguard add comment="vpn: roadwarrior" listen-port=54321 mtu=1420 name=wg-rw /interface wireguard peers add allowed-address=<redacted>.30.2/32 comment="My Mobile" interface=w...
by diamuxin
Mon Mar 11, 2024 10:33 pm
Forum: Announcements
Topic: v7.14.2 [stable] is released!
Replies: 556
Views: 128260

Re: v7.14.1 [stable] is released!

Nope, I don't...
Just tested, deliberately.
That is why I am actually wondering, maybe some specific config setting is involved.
Maybe, let's wait and see if someone from the staff can enlighten us.
Thx.
by diamuxin
Mon Mar 11, 2024 8:23 pm
Forum: Announcements
Topic: v7.14.2 [stable] is released!
Replies: 556
Views: 128260

Re: v7.14.1 [stable] is released!

Must be something config specific, I do use wireguard for road-warrior setup and I have 0 such logs.
I don't use or have BTH though.
Try to connect with road-warrior and when you disconnect you will see that the handshak messages start coming out, this started since the first versions of 7.13.
by diamuxin
Mon Mar 11, 2024 8:14 pm
Forum: Announcements
Topic: NEW FEATURE: Back to Home VPN
Replies: 296
Views: 236551

Re: NEW FEATURE: Back to Home VPN

Idem...

With the latest update 7.14.1 the logging problems with the handshake have NOT been solved, both in the wireguard road-warrior links and with BTH.

Image

BR.
by diamuxin
Mon Mar 11, 2024 8:07 pm
Forum: Announcements
Topic: v7.14.2 [stable] is released!
Replies: 556
Views: 128260

Re: v7.14.1 [stable] is released!

Mr. Support, with the latest update 7.14.1 the logging problems with the handshake have NOT been solved, both in the wireguard road-warrior links and with BTH. https://i.postimg.cc/kg0MwDQq/image.png 1. I have connected with the RW, I navigate a little bit and when I disconnect, the messages in the ...
by diamuxin
Mon Mar 11, 2024 1:28 pm
Forum: Announcements
Topic: v7.14.2 [stable] is released!
Replies: 556
Views: 128260

Re: v7.14.1 [stable] is released!

Missing "routeros" directory: https://upgrade.mikrotik.com/routeros/7.14.1/CHANGELOG Hi, Access to CHANGELOG information via CLI does not work: [admin@MikroTik] > :put ([/tool fetch "https://upgrade.mikrotik.com/7.14.1/CHANGELOG" output=user as-value] -> "data") failur...
by diamuxin
Mon Mar 11, 2024 1:14 pm
Forum: Announcements
Topic: v7.14.2 [stable] is released!
Replies: 556
Views: 128260

Re: v7.14.1 [stable] is released!

Hi,

Access to CHANGELOG information via CLI does not work:

[admin@MikroTik] > :put ([/tool fetch "https://upgrade.mikrotik.com/7.14.1/CHANGELOG" output=user as-value] -> "data")
failure: Fetch failed with status 404

Thx.
by diamuxin
Sun Mar 10, 2024 8:06 pm
Forum: Scripting
Topic: Feature request: /tool fetch HTTP-POST can send a file
Replies: 23
Views: 13036

Re: Feature request: /tool fetch HTTP-POST can send a file

I send the backup files directly to my FTP server located on my NAS. e.g. /tool fetch address=$ftpserver mode=ftp user=$username password=$password \ src-path=$backupfilename dst-path=$backupfilename upload=yes port=$port; The data is declared in local variables at the beginning of the script. By Te...
by diamuxin
Fri Mar 08, 2024 5:19 pm
Forum: Announcements
Topic: v7.14.2 [stable] is released!
Replies: 556
Views: 128260

Re: v7.14 [stable] is released!

That a passive peer (without endpoint) constantly tries to perform a handshake, transmitting data to nothing, just because it has a 0.0.0.0.0/0 in the allowed address, which is what is happening. This behavior is irregular, and is a bug to be fixed. SOLVED in 7.15beta6 *) wireguard - do not attempt...
by diamuxin
Sun Mar 03, 2024 11:44 pm
Forum: Announcements
Topic: v7.14.2 [stable] is released!
Replies: 556
Views: 128260

Re: v7.14 [stable] is released!

You seem to be contradicting yourself. Which one is it? I am not contradicting myself (if you had tried it you would understand). I keep insisting that it makes no sense for the passive peer without endpoint to constantly try to handshake, it's a debugging problem not a wireguard interface problem....
by diamuxin
Sun Mar 03, 2024 10:22 pm
Forum: Announcements
Topic: v7.14.2 [stable] is released!
Replies: 556
Views: 128260

Re: v7.14 [stable] is released!

Wireguard behavior is not the problem.
The all of a sudden excessive logging is.
This is debug and by default it should be off.
Same with dns, ntp, dhcp... I've seen it all pass by.
Exactly, I think the same.
by diamuxin
Sun Mar 03, 2024 8:37 pm
Forum: Announcements
Topic: v7.14.2 [stable] is released!
Replies: 556
Views: 128260

Re: v7.14 [stable] is released!

+1 is very, very annoying especially with road-warrior type wireguard connections. Disable wireguard logging and stop bitching. That a passive peer (without endpoint) constantly tries to perform a handshake, transmitting data to nothing, just because it has a 0.0.0.0.0/0 in the allowed address, whi...
by diamuxin
Sat Mar 02, 2024 8:15 pm
Forum: Announcements
Topic: v7.14.2 [stable] is released!
Replies: 556
Views: 128260

Re: v7.14 [stable] is released!

Handshake for peer did not complete after 5 seconds, retrying (try 2) Handshake for peer did not complete after 5 seconds, retrying (try 2) Handshake for peer did not complete after 5 seconds, retrying (try 2) +1, the same by me +1 is very, very annoying especially with road-warrior type wireguard ...
by diamuxin
Sat Feb 17, 2024 11:24 am
Forum: Scripting
Topic: BACKUP Automatic
Replies: 4
Views: 531

Re: BACKUP Automatic

Another simpler method, for RouterOS 7.10+ versions for backup, sending files to an ftp server, local deletion of files and telegram notification. # ------------------ # Function: Telegram # ------------------ :global tgFunc do={ :do { :local BotToken "XXXXXXXXXX:XXXXXXXXXXXX-XXXXXXXXXXXXXXXXXX...
by diamuxin
Thu Feb 15, 2024 11:32 pm
Forum: Scripting
Topic: BACKUP Automatic
Replies: 4
Views: 531

Re: BACKUP Automatic

The idea of the script is to take backup with the name of the identity and the current date automatically, so just pasting it on a computer and scheduling a schedule would be guaranteed the copy. I hope you like it and find it useful. I also accept comments to make modifications and see if we can i...
by diamuxin
Tue Jan 30, 2024 3:11 pm
Forum: Scripting
Topic: Log Filter
Replies: 66
Views: 8846

Re: Log Filter

I tried to apply this script to CRS with OS version 7.12, but the script sent all the last logs that appeared in CRS and did not select what was written in :local mkwd What do you think is the cause? Run the script from CLI (between {...}) and check if it dumps any errors, the script works fine for...
by diamuxin
Fri Jan 26, 2024 9:44 pm
Forum: Scripting
Topic: Exporting IP addresses from an address-list to a file
Replies: 1
Views: 401

Re: Exporting IP addresses from an address-list to a file

Can I search for content within a file? /ip firewall address-list :foreach id in=[find list=servers] do={ :local ipAddr [:toip [get $id address]] :local filenameIP "servers100.txt" /file :if ([:len [find where name="flash" and type="disk"]] = 1) do={:set filenameIP &quo...
by diamuxin
Fri Jan 26, 2024 6:24 pm
Forum: Scripting
Topic: Exporting IP addresses from an address-list to a file
Replies: 1
Views: 401

Exporting IP addresses from an address-list to a file

Hi, I have this script that exports the IP addresses of this list to a file. /ip firewall address-list :foreach id in=[find list=servers] do={ :local ipAddr [:toip [get $id address]] :local filenameIP "servers100.txt" /file :if ([:len [find where name="flash" and type="disk&...
by diamuxin
Thu Jan 25, 2024 10:41 pm
Forum: Scripting
Topic: ✂ Rextended Fragments of Snippets
Replies: 96
Views: 64919

Re: ✂ Rextended Fragments of Snippets

Bad news :(

We will miss your very good scripts (especially your functions) thanks to them I have been able to learn a little more every day.
Thanks for your contribution to the Mikrotik universe.

Best regards.
by diamuxin
Tue Jan 23, 2024 8:50 pm
Forum: Scripting
Topic: Address lists downloader (DShield, Spamhaus DROP/EDROP, etc)
Replies: 284
Views: 75446

Re: Address lists downloader (DShield, Spamhaus DROP/EDROP, etc)

I have tried the script you've mentioned with the today released 7.14beta8 version - it still does not work. Is there a possibility to debug a script to see where the error occurs? So far I just removed the "nolog" parameter but the only thing I get is Starting import of address-list: spa...
by diamuxin
Tue Jan 16, 2024 6:29 pm
Forum: Scripting
Topic: Can the content written to the file be added? [SOLVED]
Replies: 17
Views: 1793

Re: Can the content written to the file be added? [SOLVED]

Can multiple results be stored in the same file? Is HTTP or FTP okay? Or can it only be FTP? Can you provide some sample scripts? 1) Yes, you can save several results in the same file: see example in my previous post. 2) I have only tested it by FTP and it works. 3) Example of script using FTP # FT...
by diamuxin
Tue Jan 16, 2024 5:01 pm
Forum: Scripting
Topic: Can the content written to the file be added? [SOLVED]
Replies: 17
Views: 1793

Re: Can the content written to the file be added? [SOLVED]

Thank you for your script example, but this is not what I want. My script loop will produce some results, and my main purpose is to save these results to a file because saving to a file can prevent sudden power outages from time to time. Besides/file set, is there any other good way? I store my sen...
by diamuxin
Tue Jan 16, 2024 11:58 am
Forum: Scripting
Topic: Can the content written to the file be added? [SOLVED]
Replies: 17
Views: 1793

Re: Can the content written to the file be added? [SOLVED]

/system clock :local dt "$[get date] $[get time]" :local filename "datetime.txt" /file :if ([:len [find where name="flash" and type="disk"]] = 1) do={:set filename "flash/$filename"} :if ([:len [find where name=$filename]] = 0) do={print file="...
by diamuxin
Thu Jan 04, 2024 7:24 pm
Forum: Scripting
Topic: Log Filter
Replies: 66
Views: 8846

Re: Log Filter

The script I'm using is as per below I've only altered the Bot ID and ChatID. I'm not getting an error so much as the output has been warped as per my last post I get a download link to the telegram API with my BOTID, The message I'm supposed to get is appended at the end aka "Login failure fo...
by diamuxin
Wed Jan 03, 2024 10:21 pm
Forum: Scripting
Topic: Log Filter
Replies: 66
Views: 8846

Re: Log Filter

Hi folks I hate to ask you but this seems to be the right place, have any of you for some weird reason updated to RouterOS V7.13? I did it against my better judgment and now LogFilter is broken The Logfilter works on another router I have around and it worked on here until I updated from RouterOS 7...
by diamuxin
Mon Jan 01, 2024 1:07 pm
Forum: Scripting
Topic: DynDNS Script from Mikrotik Wiki (correction)
Replies: 29
Views: 30893

Re: DynDNS Script from Mikrotik Wiki (correction)

False... and define what is "latest versions" for you. uff I can't get used to those manners ;-) but I like him... My answer is based on my own experience (when switching to 7.13) and that's why I wanted to help, nothing more. At the time it didn't work with "mode=https" and swi...
by diamuxin
Sun Dec 31, 2023 1:07 pm
Forum: Scripting
Topic: DynDNS Script from Mikrotik Wiki (correction)
Replies: 29
Views: 30893

Re: DynDNS Script from Mikrotik Wiki (correction)

With the latest versions of RouterOS the "fetch" command does not work https anymore.

Image

Try this: (Something similar happened to me with a script)
/tool fetch mode=https \

# change to:

/tool fetch mode=http \
by diamuxin
Sat Dec 30, 2023 8:28 pm
Forum: Announcements
Topic: v7.14beta [testing] is released!
Replies: 510
Views: 154040

Re: v7.14beta [testing] is released!

Ok, thanks.
by diamuxin
Sat Dec 30, 2023 5:07 pm
Forum: Announcements
Topic: v7.14beta [testing] is released!
Replies: 510
Views: 154040

Re: v7.14beta [testing] is released!

do you have a persistent-keepalive configured? that may trigger that log msg also, maybe the logging became more verbose. means, the message always has "been there" but never popped up in the log. cannot verify a) Persistent-keepalive is not configured. b) With "fetch" new messa...
by diamuxin
Sat Dec 30, 2023 3:24 pm
Forum: Announcements
Topic: v7.14beta [testing] is released!
Replies: 510
Views: 154040

Re: v7.14beta [testing] is released!

Hi, When installing the latest beta 7.14beta4 I got these messages on a wireguard road warrior connection, with the stable 7.13 (and earlier) it didn't happen: wg-rw: XN58CdM6ppiSQpDaQT0bh1IMYgUP0czYYY92N1IBwE3c=: Handshake for peer did not complete after 5 seconds, retrying (try 2). When I connect ...
by diamuxin
Mon Dec 25, 2023 6:31 pm
Forum: Scripting
Topic: Script MD5 Hash Generator
Replies: 20
Views: 18015

Re: Script MD5 Hash Generator

Very interesting.. Thanks.
by diamuxin
Wed Dec 20, 2023 8:30 pm
Forum: Scripting
Topic: Netwatch tool + script: Are global variables truly global?
Replies: 25
Views: 10805

Re: Netwatch tool + script: Are global variables truly global?

+1 It would be interesting if we could change the permissions of the *sys user assigned internally to the Netwatch tool, Scheduler or IP DHCP-Server script , for example to allow "policy" to be able to read the content of global variables created by admin or other users. This would make th...
by diamuxin
Wed Dec 20, 2023 11:48 am
Forum: Announcements
Topic: v7.13.5 [stable] is released!
Replies: 909
Views: 264457

Re: v7.13 [stable] is released!



/system logging
set 0 disabled=yes
add topics=info,!fetch
I just edited default info rule. Is it correct?

Yes.
You have already added it in the new rule

Image
by diamuxin
Wed Dec 20, 2023 11:37 am
Forum: Announcements
Topic: v7.13.5 [stable] is released!
Replies: 909
Views: 264457

Re: v7.13 [stable] is released!

Hmmm... all my fetch scripts works well without ftp policy. WDIDW?

Also how to disable this new fetch logging?
/system logging
set 0 disabled=yes
add topics=info,!fetch

Image
by diamuxin
Tue Dec 19, 2023 5:39 pm
Forum: Announcements
Topic: v7.13.5 [stable] is released!
Replies: 909
Views: 264457

Re: v7.13 [stable] is released!

I have several scripts like these (they serve to telegram alert temperature and voltage etc. of the LTE modem) and they no longer work: Try with: :global temp2 :global url "https://192.168.5.2:8443/json.htm?username=mE&ghy&l&password=dGMntyhju&type=command&param=udevice&...
by diamuxin
Tue Dec 19, 2023 4:59 pm
Forum: Announcements
Topic: v7.13.5 [stable] is released!
Replies: 909
Views: 264457

Re: v7.13 [stable] is released!

is enabled. I get this from the logs: fetch,info,debug Download from https://api.telegram.org/bot42558852236:AAR_pTRe0CjksgfdydhdncbvfdtY4/sendMessage to RAM FAILED: Fetch failed with status 400 My Telegram script works fine in v7.13 :global tgFunc do={ :do { :local BotToken "XXXXXXXXX:XXXXXXX...
by diamuxin
Tue Dec 19, 2023 4:56 pm
Forum: Announcements
Topic: v7.13.5 [stable] is released!
Replies: 909
Views: 264457

Re: v7.13 [stable] is released!

Very interesting...


Image
by diamuxin
Tue Dec 19, 2023 12:55 am
Forum: Announcements
Topic: v7.13.5 [stable] is released!
Replies: 909
Views: 264457

Re: v7.13 [stable] is released!

If after this you do not understand it open a support ticket with Mikrotik. @diamuxin, you are correct ... I did not fully comprehend the meaning of your comment " You have to delete (uninstall) the existing packages except the "routeros" package, then do the downgrade ." Please...
by diamuxin
Tue Dec 19, 2023 12:34 am
Forum: Announcements
Topic: v7.13.5 [stable] is released!
Replies: 909
Views: 264457

Re: v7.13 [stable] is released!

My CCR1009 shows under /system/packages routeros wireless I do not see a match under 7.12.1 in the archive Plus why would CCR1009 load a wireless package ? I have explained it to you several times but you don't want to understand. https://forum.mikrotik.com/viewtopic.php?t=202423#p1042842 v7.12.1 P...
by diamuxin
Mon Dec 18, 2023 6:28 pm
Forum: Announcements
Topic: v7.13.5 [stable] is released!
Replies: 909
Views: 264457

Re: v7.13 [stable] is released!

What process did you follow? 1st step is copy file routeros-7.12.1-tile.npk to Files except I renamed the file like you suggested routeros 2nd step is via terminal issue /system/package/downgrade This did not work The procedure that is outlined in the MikroTiK Docs as follows also did not work for ...
by diamuxin
Mon Dec 18, 2023 5:57 pm
Forum: Announcements
Topic: v7.13.5 [stable] is released!
Replies: 909
Views: 264457

Re: v7.13 [stable] is released!

Hi diamuxin
Your suggested fix did not work for me ...
I did it with an RB4011 and it worked for me.

What process did you follow?
by diamuxin
Mon Dec 18, 2023 5:48 pm
Forum: Announcements
Topic: v7.13.5 [stable] is released!
Replies: 909
Views: 264457

Re: v7.13 [stable] is released!

they may have changed the address.
> :put ([/tool fetch url="http://upgrade.mikrotik.com/routeros/NEWESTa7.stable" as-value output=user]->"data")
7.13 1702545848
thanks a lot!!
by diamuxin
Mon Dec 18, 2023 5:47 pm
Forum: Scripting
Topic: Script to update RouterOS after X days of release
Replies: 51
Views: 8759

Re: Script to update RouterOS after X days of release

I'm still using the script version that extracts the date from change log, not the URL. Seem to be still working just fine. At the moment. But MT could change that too. This is the change: [ ] > :put ([/tool fetch url="http://upgrade.mikrotik.com/routeros/NEWEST a 7.stable" as-value outpu...
by diamuxin
Mon Dec 18, 2023 4:44 pm
Forum: Scripting
Topic: Script to update RouterOS after X days of release
Replies: 51
Views: 8759

Re: Script to update RouterOS after X days of release

Use httpS MikroTik is changing the urls for the new v7.10+ versions and also for latest v6: Long term: https://upgrade.mikrotik.com//routeros/NEWEST7.long-term (at time I write: "0.0 \r \n" no long-term version) Stable: https://upgrade.mikrotik.com//routeros/NEWEST7.stable (at time I writ...
by diamuxin
Mon Dec 18, 2023 4:30 pm
Forum: Announcements
Topic: v7.13.5 [stable] is released!
Replies: 909
Views: 264457

Re: v7.13 [stable] is released!

And still. You HAVE to pass 7.12 or 7.12.1 before you can go up. Maybe I have not explained well, it is not about upgrading, my version before upgrading to 7.13 was version 7.12.1 that I know, that web address I use in some of my scripts to know the last available version 7.X and its upgrade date i...
by diamuxin
Mon Dec 18, 2023 4:25 pm
Forum: Announcements
Topic: v7.13.5 [stable] is released!
Replies: 909
Views: 264457

Re: v7.13 [stable] is released!

It should report: 7.13 and epoch date: 1702542240 approx. I suspect that URL was used by RouterOS itself to check for new versions. Now that they mandate the 7.12.x to be an intermediate stop on the upgrade path to 7.13 and newer, I believe they introduced a new URL, and the old one will point to t...
by diamuxin
Mon Dec 18, 2023 3:19 pm
Forum: Announcements
Topic: v7.13.5 [stable] is released!
Replies: 909
Views: 264457

Re: v7.13 [stable] is released!

Dear Staff, on hAP ac^2 (and lower) with v7.13 equipment the RAM memory available is ridiculous, 128 MB -> 26 or 28 MB available. I think you should improve the wireless packages so that they don't consume so much.

..
by diamuxin
Mon Dec 18, 2023 3:08 pm
Forum: Announcements
Topic: v7.13.5 [stable] is released!
Replies: 909
Views: 264457

Re: v7.13 [stable] is released!

on my CCR1009 After upgrade to 7.13 from 7.12.1 when I attempt to downgrade back to 7.12.1 the downgrade fails. Log file shows omitting package system-7.12.1: newer package system-7.13 is already installed I tried 2 methods for the downgrade 1. via terminal 2. via Packages Both return the same resu...
by diamuxin
Mon Dec 18, 2023 3:01 pm
Forum: Announcements
Topic: v7.13.5 [stable] is released!
Replies: 909
Views: 264457

Re: v7.13 [stable] is released!

AFAIK it will only report 7.12.1 if your current version is below 7.12.1. This is because else the update to 7.13 will likely fail. It makes no sense what you say, if I consult that web address (I use it in my scripts) it has to inform you which is the latest stable version that Mikrotik has, just ...
by diamuxin
Mon Dec 18, 2023 12:53 pm
Forum: Announcements
Topic: v7.13.5 [stable] is released!
Replies: 909
Views: 264457

Re: v7.13 [stable] is released!

Hi, follow this error:

[ ] > :put ([/tool fetch url="https://upgrade.mikrotik.com/routeros/NEWEST7.stable" as-value output=user]->"data")
7.12.1 1700221125

It should report: 7.13 and epoch date: 1702542240 approx.
by diamuxin
Sun Dec 17, 2023 8:39 pm
Forum: Scripting
Topic: reboot - ping down
Replies: 8
Views: 1680

Re: reboot - ping down

In the Netwatch?

# Netwatch (Host tab)
Host: 8.8.8.8
Type: simple
Interval: 00:05:00 
Timeout: 1.00

# Netwatch (Test tab)
:local HOST $host
:local HostStatus [/tool netwatch get value-name=status [find host=$HOST]]
:if ($HostStatus="down") do={/system reboot}
by diamuxin
Sun Dec 17, 2023 8:22 pm
Forum: Announcements
Topic: v7.13.5 [stable] is released!
Replies: 909
Views: 264457

Re: v7.13 [stable] is released!

small note outside the version. . . hap ax2 if it had at least USB2 (better USB3.X) it would be an ideal small device and I think its sales would increase several times. . . This way we have ac2 with USB but little storage space and limited RAM, and ax2 without USB but with lots of RAM and enough s...
by diamuxin
Sun Dec 17, 2023 2:13 pm
Forum: Announcements
Topic: v7.13.5 [stable] is released!
Replies: 909
Views: 264457

Re: v7.13 [stable] is released!

Hi all! I have the same problem with script on CHR after upgrade :( Download from https://antifilter.download/list/ip.lst to <nothing> FINISHED Download from https://antifilter.download/list/ip.lst to RAM FAILED: Fetch failed with status 206 What can i do with this? https://en.wikipedia.org/wiki/Li...
by diamuxin
Sat Dec 16, 2023 8:03 pm
Forum: Announcements
Topic: v7.13.5 [stable] is released!
Replies: 909
Views: 264457

Re: v7.13 [stable] is released!

Hi all! I have the same problem with script on CHR after upgrade :( Download from https://antifilter.download/list/ip.lst to <nothing> FINISHED Download from https://antifilter.download/list/ip.lst to RAM FAILED: Fetch failed with status 206 What can i do with this? The fetch command has incorporat...
by diamuxin
Sat Dec 16, 2023 6:02 pm
Forum: Announcements
Topic: v7.13.5 [stable] is released!
Replies: 909
Views: 264457

Re: v7.13 [stable] is released!

+1, report the same error: - fetch with ipv4 url are automatically "translated" into ipv6 by being prefixed with "::ffff:" - This results in either host unreachable or data content = null Had to roll back to 7.12.1 Indeed that is the problem, you have explained it better than me...
by diamuxin
Fri Dec 15, 2023 5:43 pm
Forum: Announcements
Topic: v7.13.5 [stable] is released!
Replies: 909
Views: 264457

Re: v7.13 [stable] is released!

This AM i upgraded my CCR1009 from version 7.12.1 to version 7.13 now getting the following error when running a script Download from https://view.sentinel.turris.cz/greylist-data/greylist-latest.csv to RAM FAILED: Fetch failed with status 206 The same script was working fine under 7.12.1 and earli...
by diamuxin
Fri Dec 15, 2023 4:52 pm
Forum: Announcements
Topic: v7.13.5 [stable] is released!
Replies: 909
Views: 264457

Re: v7.13 [stable] is released!

Hi friends,

In my script this sequence failed:
[ ] > :put ([/tool fetch url="https://upgrade.mikrotik.com/routeros/NEWEST7.stable" as-value output=user]->"data")
7.12.1 1700221125
It should report: 7.13 and epoch date: 1702542240 approx.
by diamuxin
Tue Dec 05, 2023 2:02 pm
Forum: Scripting
Topic: Send a unicode symbol to Telegram from an array list
Replies: 4
Views: 2043

Re: Send a unicode symbol to Telegram from an array list

Thank you very much Sertik and Amm0 for your help.

By the way Amm0, your site is very useful:
https://observablehq.com/@a2m0/utf2rsc#decodeStart

BR.
by diamuxin
Tue Dec 05, 2023 1:03 am
Forum: Scripting
Topic: Send a unicode symbol to Telegram from an array list
Replies: 4
Views: 2043

Send a unicode symbol to Telegram from an array list

Hi, I would like to know if it is possible based on this code, to insert two (or three) Unicode symbols in a text to send to Telegram, a single symbol if it works fine. # Function $tgFunc by @diamuxin :global tgFunc do={ :local BotToken "XXXXXXXXX:XXXXXXXXXXXX-XXXXXXXXXXXXXXXXXX" :local Ch...
by diamuxin
Sun Dec 03, 2023 5:12 pm
Forum: Scripting
Topic: SSH_Exec command options
Replies: 8
Views: 1798

Re: SSH_Exec command options

I'm not sure if the ConnectTimeout command is supported as there is no mention of it here - https://wiki.mikrotik.com/wiki/Manual:System/SSH_client However if it is supported, would this work? /system ssh-exec connecttimeout=20 address=192.168.88.10 user=root command="shutdown now" This c...
by diamuxin
Sun Dec 03, 2023 5:07 pm
Forum: Scripting
Topic: SSH_Exec command options
Replies: 8
Views: 1798

Re: SSH_Exec command options

the
/delay 30s
doesn't seem to work ?
/delay 30s

Change it to:

:delay 30s
by diamuxin
Sat Dec 02, 2023 12:35 pm
Forum: Scripting
Topic: Foreach syntax
Replies: 5
Views: 1701

Re: Foreach syntax

Good, thanks!
by diamuxin
Fri Dec 01, 2023 4:40 pm
Forum: Scripting
Topic: Foreach syntax
Replies: 5
Views: 1701

Re: Foreach syntax

OK, thanks for the tip @Amm0.

BR.
by diamuxin
Fri Dec 01, 2023 1:50 pm
Forum: Scripting
Topic: Foreach syntax
Replies: 5
Views: 1701

Re: Foreach syntax

Sorry, but after several tests I have already discovered the solution.

{
/interface list
add name=ListB

:delay 1s

/interface/list/member
:foreach i in=[find where ((interface~"ospf") and (list~"ListA"))] do={
    set $i list="ListB"
}
}

by diamuxin
Fri Dec 01, 2023 12:36 pm
Forum: Scripting
Topic: Foreach syntax
Replies: 5
Views: 1701

Foreach syntax

Hi, could you help me with this? It may be silly but I don't know what I'm missing... I want to change the "interface list" of a number of interfaces that contain the word "ospf" and replace ListA with the new ListB. [ ] > interface/list/member pr Columns: LIST, INTERFACE # LIST ...
by diamuxin
Thu Nov 30, 2023 11:58 am
Forum: Scripting
Topic: Send Log to FTP Server
Replies: 4
Views: 1361

Re: Send Log to FTP Server

Hi Tangent,

thanks for your reply.

but i using NAS Synology as FTP Server. There is no Syslog features
I have syslog enabled on the Synology NAS, it is an application called Log Center (Centro de registros in spanish) and it works correctly receiving information from all my mikrotik devices.
by diamuxin
Tue Nov 28, 2023 8:24 pm
Forum: Scripting
Topic: Useful scripts
Replies: 116
Views: 297145

Re: Useful scripts

I was surprised that /user active request-logout is undocumented. Also it's not a request :lol: This one uses the date too. Apparently force logging out a user requires reboot permission for this script to work. It works fine but the active session via Winbox does not disconnect, it only disconnect...
by diamuxin
Thu Nov 23, 2023 8:35 pm
Forum: Scripting
Topic: Script to update RouterOS after X days of release
Replies: 51
Views: 8759

Re: Script to update RouterOS after X days of release

Here is my implementation of update script P.S. If somebody want to see code of functions and telegram script used in this script - reply and I'll show you. Very useful your script, thanks. Could you share your $FuncStatus function? A tip: It is not necessary to end each line of code with " ; ...
by diamuxin
Mon Nov 20, 2023 11:28 am
Forum: Scripting
Topic: GPT4 and writing scripts for Mikrotik
Replies: 51
Views: 5663

Re: GPT4 and writing scripts for Mikrotik

ChatGPT search: "mikrotik scripting replace character".

Response:

Image

:regsub ???
:lol: :lol: :lol: :lol:
by diamuxin
Sun Nov 19, 2023 11:16 pm
Forum: Scripting
Topic: No-IP Updater Scripting
Replies: 2
Views: 1381

Re: No-IP Updater Scripting

Example of noip script without global variables (simpler). # Data to be modified :local noipuser "username" :local noippass "MyStr0ngPassWoRd!" :local noiphost "mydomain.sytes.net" # From now on, do not modify :local cIP [/ip cloud get public-address] :if ([:resolve $no...
by diamuxin
Sat Nov 18, 2023 12:42 pm
Forum: Scripting
Topic: Splitting/parsing variable data [SOLVED]
Replies: 21
Views: 15561

Re: Splitting/parsing variable data [SOLVED]

Ok I understand. The data comes from computers INSIDE my LAN. They are not external data. I'm careful with that evidently,
But thanks for the advice.
by diamuxin
Sat Nov 18, 2023 12:08 am
Forum: Scripting
Topic: Splitting/parsing variable data [SOLVED]
Replies: 21
Views: 15561

Re: Splitting/parsing variable data [SOLVED]

The data used is for learning use only.
by diamuxin
Fri Nov 17, 2023 7:54 pm
Forum: Scripting
Topic: Splitting/parsing variable data [SOLVED]
Replies: 21
Views: 15561

Re: Splitting/parsing variable data [SOLVED]

For convert x|y|z on one array of 3 elements, two way are simpler: first replace inside the string all | with , and use :toarray or use a "while" until you do not process the string from the start to the end and create a new string inside the array fore each | and the last at the end of t...
by diamuxin
Fri Nov 17, 2023 7:28 pm
Forum: Scripting
Topic: Splitting/parsing variable data [SOLVED]
Replies: 21
Views: 15561

Re: Splitting/parsing variable data [SOLVED]

Thank you all for your advice.

BR.
by diamuxin
Fri Nov 17, 2023 3:30 pm
Forum: Scripting
Topic: Splitting/parsing variable data [SOLVED]
Replies: 21
Views: 15561

Re: Splitting/parsing variable data [SOLVED]

Is just an example for a little complex string, if the fields are more, a cycle is better... What would be the way to do it without pick? I have tried as an array but only "the comma" works as a separator between values. The vertical bar does not work. { :local test [:toarray "081234...
by diamuxin
Tue Nov 14, 2023 1:53 pm
Forum: Scripting
Topic: Use fetch wil create the File
Replies: 8
Views: 1837

Re: Use fetch wil create the File

:lol: :lol:
by diamuxin
Thu Nov 09, 2023 1:51 am
Forum: Scripting
Topic: Splitting/parsing variable data [SOLVED]
Replies: 21
Views: 15561

Re: Splitting/parsing variable data [SOLVED]

A little difficult but with your excellent explanation I understand.
Thank you magister!
by diamuxin
Thu Nov 09, 2023 1:00 am
Forum: Scripting
Topic: Splitting/parsing variable data [SOLVED]
Replies: 21
Views: 15561

Re: Splitting/parsing variable data [SOLVED]

{ :local test "081234567890|West Java|John Due" :put [:pick $test 0 [:find $test "|" -1] ] :put [:pick $test ([:find $test "|" -1] + 1) [:find $test "|" [:find $test "|" -1]] ] :put [:pick $test ([:find $test "|" [:find $test "|"...
by diamuxin
Sun Oct 29, 2023 5:35 pm
Forum: Scripting
Topic: script to calculate next date [SOLVED]
Replies: 16
Views: 13203

Re: script to calculate next date [SOLVED]

Another way to do it (based on @rextended functions) :global unixtodatetime do={ :local ux [:tonum $1] :local Fzerofill do={:return [:pick (100 + $1) 1 3]} :local prMntDays [:toarray "0,0,31,59,90,120,151,181,212,243,273,304,334"] :local vgmt [:tonum [/system clock get gmt-offset]]; :if ($...
by diamuxin
Tue Oct 17, 2023 9:20 pm
Forum: Announcements
Topic: v7.12rc is released!
Replies: 225
Views: 93115

Re: v7.12rc is released!

Sorry about that. Changelogs are fixed now.
It's perfect now, thank you very much.

BR.
by diamuxin
Tue Oct 17, 2023 7:40 pm
Forum: Announcements
Topic: v7.12rc is released!
Replies: 225
Views: 93115

Re: v7.12rc is released!

In the following link (which I use in my scripts) the correct content of the Changelog is not updated, it only reports the previous version 7.12rc1 Use the correct URLs... https://forum.mikrotik.com/viewtopic.php?t=200103#p1030161 https://upgrade.mikrotik.com//routeros/NEWEST7.testing 7.12rc2 16974...
by diamuxin
Tue Oct 17, 2023 6:54 pm
Forum: Announcements
Topic: v7.12rc is released!
Replies: 225
Views: 93115

Re: v7.12rc is released!

In the following link (which I use in my scripts) the correct content of the Changelog is not updated, it only reports the previous version 7.12rc1 https://upgrade.mikrotik.com/routeros/ 7.12rc2 /CHANGELOG Please, can you check it? What's new in 7.12rc1 (2023-Oct-05 08:46): Changes in this release: ...
by diamuxin
Tue Oct 17, 2023 12:27 pm
Forum: Scripting
Topic: Best Script Editor for RouterOS?
Replies: 4
Views: 1855

Re: Best Script Editor for RouterOS?

I use Visual Studio Code with the "RouterOS Syntax Highlighting" extension installed.

Image
by diamuxin
Mon Oct 16, 2023 2:29 pm
Forum: Scripting
Topic: Script to update RouterOS after X days of release
Replies: 51
Views: 8759

Re: Script to update RouterOS after X days of release

And about [/system clock get gmt-offset], the correct way to use it is how is used inside my script... (until mikrotik do not fix something...) OK, very helpful { :local vgmt [/system clock get gmt-offset] :if ($vgmt > 0x7FFFFFFF) do={:set vgmt ($vgmt - 0x100000000)} :if ($vgmt < 0) do={:set vgmt (...
by diamuxin
Sun Oct 15, 2023 10:43 pm
Forum: Scripting
Topic: Script to update RouterOS after X days of release
Replies: 51
Views: 8759

Re: Script to update RouterOS after X days of release

Now I understand, it's because of the time difference in my country: GMT +2 (summer time). My router is set like this. Thanks. Possible fix?: :local currEpoch :if ([/system clock get gmt-offset] = 7200) do={ # Summer time. GMT Offset +02:00 :set currEpoch ([$datetime2epoch [/system/package get [find...
by diamuxin
Sun Oct 15, 2023 10:33 pm
Forum: Scripting
Topic: Script to update RouterOS after X days of release
Replies: 51
Views: 8759

Re: Script to update RouterOS after X days of release

Hi @rextended, I have detected a small discrepancy: the EPOCH calculations performed by MikroTik are different from the calculations performed by your $datetime2epoch function, what do you think? :global datetime2epoch do={ :local dtime [:tostr $1] /system clock :local cyear [get date] ; :if ($cyear...
by diamuxin
Fri Oct 13, 2023 12:56 pm
Forum: Scripting
Topic: Script to update RouterOS after X days of release
Replies: 51
Views: 8759

Re: Script to update RouterOS after X days of release

Much better this way. Nice! One question: Is it only applicable to the "stable" version? https://upgrade.mikrotik.com/routeros/LATEST.7 I have another script to control the "testing" version (I use the extraction of the build date from the changelog), do you know if it is possibl...
by diamuxin
Fri Oct 13, 2023 12:38 am
Forum: Scripting
Topic: Script to update RouterOS after X days of release
Replies: 51
Views: 8759

Re: Script to update RouterOS after X days of release

This way, I have tested it and it works OK. I hope it helps. The $datetime2epoch and $date2ymd functions should already be in memory. /system package update; check-for-updates without-paging as-value; :delay 3s :global datetime2epoch :global date2ymd :local LatestVer [get latest-version] :local Stat...
by diamuxin
Thu Oct 12, 2023 6:22 pm
Forum: Scripting
Topic: Script to update RouterOS after X days of release
Replies: 51
Views: 8759

Re: Script to update RouterOS after X days of release

I think the script is not well designed. In this part: :if ($DSR <= $DaysToWait) do={ :log info "~~~~~~~~~ New RouterOS release is out for $DSR so NOT updating this device until release has been out for $DaysToWait days ~~~~~~~~~~~~~~~~" :set $DaysSinceRelease $newdays; /file set "Day...
by diamuxin
Wed Oct 11, 2023 5:44 pm
Forum: Scripting
Topic: I did it! Script to compute UNIX time!
Replies: 33
Views: 23905

Re: I did it! Script to compute UNIX time!

:local A [$datetime2epoch "2023-09-30 16:55"] 1696085700 :local B [$datetime2epoch "2023-08-31 16:55"] 1693493700 Result: A - B / 86400 = 30 days Note: The converter to change the Changelog date to the MT date can be found at: https://forum.mikrotik.com/viewtopic.php?t=200103#p1...
by diamuxin
Wed Oct 11, 2023 5:20 pm
Forum: Scripting
Topic: Script to update RouterOS after X days of release
Replies: 51
Views: 8759

Re: Script to update RouterOS after X days of release

Trouble is the date format in the changelog is different than that in the router "2023-Aug-31 16:55" has to be converted to "2023-08-31 16:55" found a script from @rextended to convert to epoch to do the math but even that does not like the "Aug" format. the datetime2e...
by diamuxin
Wed Oct 11, 2023 1:43 am
Forum: Scripting
Topic: invalid internal item number [SOLVED]
Replies: 13
Views: 5250

Re: invalid internal item number [SOLVED]

With this script I have the same error: "invalid internal item number". It works on a hAP ac^2 and does not work on a RB4011. Both with v7.11.2. :local output :local filename :local sysname [/system identity get name] :set filename ($"sysname"."-"."Leases.txt"...
by diamuxin
Fri Oct 06, 2023 10:07 pm
Forum: Scripting
Topic: I did it! Script to compute UNIX time!
Replies: 33
Views: 23905

Re: I did it! Script to compute UNIX time!

I think I have found the solution, before the next local variable in the code of @rextended https://forum.mikrotik.com/viewtopic.php?p=1029048#p994849 :local yyyy [:pick $vdate ($vdoff->0) ($vdoff->1)] ; :if (((($yyyyy - 1968) % 4) = 0) do={:set ($arrm->1) -1; :set ($arrm->2) 30} Add this code snipp...
by diamuxin
Fri Oct 06, 2023 9:40 pm
Forum: Scripting
Topic: Script to update RouterOS after X days of release
Replies: 51
Views: 8759

Re: Script to update RouterOS after X days of release

There would be a solution to get the build date: /system package update :local latest [get latest-version] :local changeLog ([/tool fetch "http://upgrade.mikrotik.com/routeros/$latest/CHANGELOG" output=user as-value] -> "data") :local dateEx [:pick $changeLog ([:find $changeLog &...
by diamuxin
Fri Oct 06, 2023 8:08 pm
Forum: Scripting
Topic: I did it! Script to compute UNIX time!
Replies: 33
Views: 23905

Re: I did it! Script to compute UNIX time!

Hi Rex ! For your super-function "datetime2epoch" how could we adapt the following date? 2023-Aug-31 16:55 It is to extract the date from a changelog that comes with a somewhat peculiar format (Mikrotik has not yet unified the dates to ISO 8601). What's new in 7.11.2 ( 2023-Aug-31 16:55 ):...
by diamuxin
Fri Oct 06, 2023 2:34 pm
Forum: Scripting
Topic: Script to update RouterOS after X days of release
Replies: 51
Views: 8759

Re: Script to update RouterOS after X days of release

that also returns the build date? When executing the command: :put [/system/package/update/ get] channel=stable;installed-version=7.11.2;latest-version=7.11.2;status=System is already up to date No compilation date available, I have only seen it in the changelog itself: What's new in 7.11.2 ( 2023-...
by diamuxin
Wed Oct 04, 2023 10:01 pm
Forum: Scripting
Topic: Compare RouterOS version in script
Replies: 9
Views: 3185

Re: Compare RouterOS version in script

I have a function that converts the version to a numerical value: https://git.eworm.de/cgit/routeros-scripts/tree/global-functions.rsc?id=9069f71ee6168a651fd42f90b7aea309fefa260b#n1269 [admin@MikroTik] > :put [ $VersionToNum 7.9 ] 118095616 [admin@MikroTik] > :put [ $VersionToNum 7.10beta5 ] 118120...
by diamuxin
Tue Oct 03, 2023 12:59 am
Forum: Scripting
Topic: Script to check for new developer versions [SOLVED]
Replies: 2
Views: 1844

Re: Script to check for new developer versions [SOLVED]

try requesting 2 times with a delay
:local latest [/system package update get latest-version]
:delay 1
:set latest [/system package update get latest-version]
sometimes it returns empty value or check for empty value
Ok thanks, this way it seems that it has not given error again.
by diamuxin
Sun Oct 01, 2023 8:50 pm
Forum: Scripting
Topic: Script to check for new developer versions [SOLVED]
Replies: 2
Views: 1844

Script to check for new developer versions [SOLVED]

Hi, I have created this script to inform me about new testing versions, but sometimes I get an error: failure: closing connection: <404 Not Found> 159.148.172.226:80 (4) And sometimes it works fine. Do you see any error in the code? thanks. :global prev "" :local ch [/system package update...
by diamuxin
Wed Sep 13, 2023 11:53 pm
Forum: Beginner Basics
Topic: Documentation for CLI follow, follow-only and follow-strict
Replies: 8
Views: 2672

Re: Documentation for CLI follow, follow-only and follow-strict

Indeed, follow-strict does not add any thing different than print already do. It might be interesting to replace it with a option to limited the number of lines shown, beginning from last. follow-last=10 -> shows the last ten lines (.id) from the otherwise printed text. See here for an example for ...
by diamuxin
Sat Sep 09, 2023 11:37 pm
Forum: Scripting
Topic: New command in RouterOs 7
Replies: 34
Views: 6626

Re: New command in RouterOs 7

A great masterclass!
Thank you very much for helping me to understand it.

BR.
by diamuxin
Sat Sep 09, 2023 9:37 pm
Forum: Scripting
Topic: New command in RouterOs 7
Replies: 34
Views: 6626

Re: New command in RouterOs 7

So, to keep it short, if I just want to get information about a specific command, for example "/ip/firewall", it would be something like this? :put [/console/inspect as-value request=syntax path="/ip/firewall/"] I've tried it and it doesn't work Can you give me an example please?...
by diamuxin
Sat Sep 09, 2023 9:13 pm
Forum: Scripting
Topic: New command in RouterOs 7
Replies: 34
Views: 6626

Re: New command in RouterOs 7

/console/inspect - this is an "easter egg" – but I have an partial example of usage here: https://forum.mikrotik.com/viewtopic.php?t=175564&hilit=%2Fconsole%2Finspect#p966543 Hi @Amm0, Is it possible to dump the command list (/console/inspect) in a file for future reference? Thanks.
by diamuxin
Thu Sep 07, 2023 11:57 pm
Forum: Scripting
Topic: DHCP-Client script not working [SOLVED]
Replies: 7
Views: 3554

Re: DHCP-Client script not working [SOLVED]

Rex, In the tests you have performed and from what you have opened the other thread in the General forum, how did you create the user *sys ? it would be like the linux "root" user, right ? You tell me that the DHCP-Server script uses this *sys user, so if you have the highest rights, why d...
by diamuxin
Thu Sep 07, 2023 6:27 pm
Forum: Scripting
Topic: DHCP-Client script not working [SOLVED]
Replies: 7
Views: 3554

Re: DHCP-Client script not working [SOLVED]

Thanks Rex, for your escalation of this issue.

BR.
by diamuxin
Wed Sep 06, 2023 7:54 pm
Forum: Scripting
Topic: DHCP-Client script not working [SOLVED]
Replies: 7
Views: 3554

Re: DHCP-Client script not working [SOLVED]

Hi, I have found a solution to the problem of using the ssh-exec command from the lease script tab of the dhcp-server since it seems that from this part it does not use the RSA keys assigned to the administrator user (possible bug?). 1. Create a Scheduler task with the following content: (runs with ...
by diamuxin
Sun Sep 03, 2023 11:55 am
Forum: Scripting
Topic: DHCP-Client script not working [SOLVED]
Replies: 7
Views: 3554

Re: DHCP-Client script not working [SOLVED]

Apparently nothing wrong...
Probably dhcp script have less right than "normal script"...
Maybe you are right Rex, that it is a problem of execution permissions when it involves executing a command on another mikrotik (via SSH with RSA keys).

Thanks.
by diamuxin
Sat Sep 02, 2023 2:10 pm
Forum: Scripting
Topic: DHCP-Client script not working [SOLVED]
Replies: 7
Views: 3554

DHCP-Client script not working [SOLVED]

Hi, I am trying this script to report each lease of my DHCP server (RB4011) but there is some problem in the "ether4" part as I don't get the AP information. :if ($leaseBound = 1) do={ :do { /ip dhcp-server lease :local Comment [get value-name=comment number=[find address=$leaseActIP]] /in...
by diamuxin
Sat Sep 02, 2023 12:14 am
Forum: Scripting
Topic: Script to release/renew WAN IP when offline? [SOLVED]
Replies: 5
Views: 3027

Re: Script to release/renew WAN IP when offline? [SOLVED]

I am not running pppoe client. My ether2 is WAN. Where do you get the WAN IP? Check IP > DHCP-Client to see if "ether2" appears. Try: :if ([/ping 1.1.1.1 count=6] = 0) do={/ip dhcp-client release [find interface=ether2]} :delay 2s :if ([/ping 1.1.1.1 count=6] = 0) do={/ip dhcp-client rene...
by diamuxin
Fri Sep 01, 2023 1:00 am
Forum: Scripting
Topic: Script to release/renew WAN IP when offline? [SOLVED]
Replies: 5
Views: 3027

Re: Script to release/renew WAN IP when offline? [SOLVED]

Something like this might work for you. { :if ([/ping 8.8.8.8 interval=500ms count=10]<8) do={ :log error "Warning: no internet connection. Reconnecting..."; # Reset WAN interface. e.g. "pppoe-out1" interface /interface/pppoe-client/disable 0 :delay 5s /interface/pppoe-client/ena...
by diamuxin
Tue Aug 29, 2023 9:42 am
Forum: Scripting
Topic: Automatic Config Backup --> Not working in December
Replies: 7
Views: 3004

Re: Automatic Config Backup --> Not working in December

share your backup script so they can help you...
by diamuxin
Fri Aug 25, 2023 9:20 pm
Forum: Scripting
Topic: Voltage Monitoring in ROS v.7 and send message to TELEGRAM [SOLVED]
Replies: 13
Views: 4417

Re: Voltage Monitoring in ROS v.7 and send message to TELEGRAM [SOLVED]

how to set text in the telegram message as BOLD FONT in the script??? In your code: :local emessage ($thisbox . " !!!_POWER is UP_!!! - current voltage is: " . [:pick $voltage 0 2] . "." . [:pick $voltage 2 3]) use HTML code for bold type: <b>text</b> Example: :local emessage ($...
by diamuxin
Wed Aug 16, 2023 12:21 pm
Forum: Announcements
Topic: v7.11.2 [stable] is released!
Replies: 348
Views: 164692

Re: v7.11 [stable] is released!

usually that error is firewall problem, try allowing UDP "5246,5247" on input chain on your bidge side and see if fixes it on v.7.11
But CAPSMAN has always worked fine with v7.10 without the need to open ports 5246 and 5247, I understand that internally CAPSMAN already enables them.
by diamuxin
Wed Aug 16, 2023 10:46 am
Forum: Announcements
Topic: v7.11.2 [stable] is released!
Replies: 348
Views: 164692

Re: v7.11 [stable] is released!

Hi,

Issues with CAPSMAN on a RB4011 router, error type "removing stale connection". Back to version v7.10 and OK.

BR.
by diamuxin
Mon Aug 14, 2023 8:50 pm
Forum: Scripting
Topic: Voltage Monitoring in ROS v.7 and send message to TELEGRAM [SOLVED]
Replies: 13
Views: 4417

Re: Voltage Monitoring in ROS v.7 and send message to TELEGRAM [SOLVED]

Simpler script without using so many global variables. /system health :local tempSystem [:tonum ([get [find where name=temperature]]->"value")] :local voltSystem ([get [find where name=voltage]]->"value") :local tempMax 55 :local voltMin 20 # Check Temperature :if ($tempSystem >=...
by diamuxin
Mon Aug 14, 2023 8:07 pm
Forum: Scripting
Topic: Voltage Monitoring in ROS v.7 and send message to TELEGRAM [SOLVED]
Replies: 13
Views: 4417

Re: Voltage Monitoring in ROS v.7 and send message to TELEGRAM [SOLVED]

I am now trying to run this same script on the latest firmware (7.10.2) and it is not running at all.
Where I have problem?
change this:
:local voltage [/system health get voltage]
by:
:local voltage [/system health get [find name=voltage] value]
by diamuxin
Sun Aug 13, 2023 1:54 pm
Forum: Scripting
Topic: Disconnect wireguard vpn when it has been inactive for a long time
Replies: 0
Views: 1827

Disconnect wireguard vpn when it has been inactive for a long time

Hello!

Is it possible to create a script for wireguard type roadwarrior to disconnect the vpn when it has been inactive for more than X minutes?

BR.
by diamuxin
Thu Aug 10, 2023 7:47 pm
Forum: Scripting
Topic: BACKUP INTERFACE [SOLVED]
Replies: 6
Views: 2553

Re: BACKUP INTERFACE [SOLVED]

You don't need a complex script to switch from ISP1 to ISP2 and vice versa, with a simple Failover with recursive routes you have it solved, I have it (Fiber + LTE) and it works very well. Luck.
by diamuxin
Thu Aug 10, 2023 7:00 pm
Forum: Scripting
Topic: BACKUP INTERFACE [SOLVED]
Replies: 6
Views: 2553

Re: BACKUP INTERFACE [SOLVED]

by diamuxin
Thu Aug 10, 2023 4:57 pm
Forum: Scripting
Topic: Send SMS messages via Huawei LTE modem API (tested with E3372)
Replies: 84
Views: 21693

Re: Send SMS messages via Huawei LTE modem API (tested with E3372)

According to error code 100005 it corresponds to "ERROR_FORMAT_ERROR". Also, the date format you have is the one before v7.10 (aug/09/2023). I would try a version >=v7.10 where the date comes with the international ISO 8601 format (2023-08-09) which matches the date format of the Huawei mo...
by diamuxin
Thu Aug 10, 2023 12:36 pm
Forum: Scripting
Topic: Send SMS messages via Huawei LTE modem API (tested with E3372)
Replies: 84
Views: 21693

Re: Send SMS messages via Huawei LTE modem API (tested with E3372)

Hi, I have RouterOS v7.10 and it works correctly both ways: @diamuxin :global sendSMS do={ # Example: # :put [$sendSMS lteIP="192.168.8.1" phone="+34XXXXXXXXX" sms="test sms via lte api"] :local lteIP "192.168.8.1" :global tokenParser # get SessionID and Token...
by diamuxin
Wed Aug 02, 2023 3:34 pm
Forum: Scripting
Topic: find addresses with same octets
Replies: 39
Views: 4794

Re: find addresses with same octets

I solved the speed problem...

Fake24 aggregator, now is really fast...
This script, what does it really do?
can you give an example to understand it? thanks.
by diamuxin
Mon Jul 31, 2023 12:44 pm
Forum: Scripting
Topic: Script to find the day of the week eg sun,mon,tue etc
Replies: 17
Views: 6249

Re: Script to find the day of the week eg sun,mon,tue etc

Full version of the @rextended script:

viewtopic.php?t=191520#p1010947

BR.
by diamuxin
Wed Jul 26, 2023 10:32 am
Forum: Scripting
Topic: Send SMS messages via Huawei LTE modem API (tested with E3372)
Replies: 84
Views: 21693

Re: Send SMS messages via Huawei LTE modem API (tested with E3372)

New TIP: Change DHCP server IP address range (modem) to be able to configure a single IP for the Mikrotik DHCP client. 1. Run the following script to create the global variable dhcpSMS . 2. From the Terminal type: :put [$dhcpSMS lteIP="192.168.8.1" startIP="192.168.8.100" endIP=...
by diamuxin
Tue Jul 25, 2023 3:33 pm
Forum: Scripting
Topic: send MikroTik Notification via WhatsApp
Replies: 55
Views: 36159

Re: send MikroTik Notification via WhatsApp

Using third-party applications or scripts linked into the MikroTik RouterOS, it is possible to send MikroTik alerts through WhatsApp. This increases the effectiveness of network administration and monitoring by allowing administrators to simply receive important information on their cellphones. ano...
by diamuxin
Fri Jul 07, 2023 10:40 pm
Forum: Scripting
Topic: block IP by login failure
Replies: 11
Views: 3866

Re: block IP by login failure

I think that's right, isn't it?
On the moment I can not test it, but apparently it is correct...
Works OK.

The local variables $userinside and $intinside I have eliminated them because I have not seen any use in the script.

Thanks.
by diamuxin
Fri Jul 07, 2023 3:03 am
Forum: Scripting
Topic: block IP by login failure
Replies: 11
Views: 3866

Re: block IP by login failure

This script save the last checked log for start from that point instead to elaborate all list everytime: https://forum.mikrotik.com/viewtopic.php?p=1004552#p1004546 I think that's right, isn't it? # Check if exist drop firewall rule and add /ip firewall raw :if ([:len [find where src-address-list=&...
by diamuxin
Thu Jul 06, 2023 6:34 pm
Forum: Scripting
Topic: block IP by login failure
Replies: 11
Views: 3866

Re: block IP by login failure


And once the ip of the variable "$ipinside" is blocked in the address list, how can I delete all the lines in the log that contain that IP?
by diamuxin
Thu Jul 06, 2023 5:12 pm
Forum: Scripting
Topic: block IP by login failure
Replies: 11
Views: 3866

Re: block IP by login failure

Is this?

viewtopic.php?p=929454&hilit=login+failure#p929454

EDIT:
Can you add it to your post "✂ Rextended Fragments of Snippets"?
so it doesn't get lost!!! hehe
by diamuxin
Thu Jul 06, 2023 3:56 pm
Forum: Scripting
Topic: block IP by login failure
Replies: 11
Views: 3866

Re: block IP by login failure

I read somewhere on the forum a similar script already working.
OK, I will look for it
by diamuxin
Thu Jul 06, 2023 3:47 pm
Forum: Scripting
Topic: block IP by login failure
Replies: 11
Views: 3866

block IP by login failure

Hi, I have had several attempts to access from the same IP in the Local Network 192.168.1.134 and to all the services of the router (ssh, telnet and ftp), luckily it has not been able to access since I changed user and password at the time. 07-05 13:10:54 system,error,critical login failure for user...
by diamuxin
Sun Jul 02, 2023 2:02 pm
Forum: Scripting
Topic: Date Parts --> Weekday? [SOLVED]
Replies: 11
Views: 3895

Re: Date Parts --> Weekday? [SOLVED]

Oh, very complete. Thanks Rex!!
Happy summer!
by diamuxin
Sun Jul 02, 2023 2:35 am
Forum: Scripting
Topic: Date Parts --> Weekday? [SOLVED]
Replies: 11
Views: 3895

Re: Date Parts --> Weekday? [SOLVED]

Hi @rextended, Since the release of ROS v7.10 the date changed to 2023-07-02 format. So this function should change the months array, right? Would it be something like this? /system clock :local strDate [get date] :local intYear [:pick $strDate 0 4] :local strMonth [:pick $strDate 5 7] :local intDay...
by diamuxin
Fri Jun 30, 2023 1:14 am
Forum: Scripting
Topic: check if file exists?
Replies: 13
Views: 12991

Re: check if file exists?

Similarly, is it possible to check whether a folder exists? I want to check if /flash/ exists or not before doing my stuff (some cards have it, other don't). The solution is in the previous post (thanks to @rextended), try to adapt it to your needs. :global subdir "flash" :global findresu...
by diamuxin
Thu Jun 29, 2023 4:19 pm
Forum: Scripting
Topic: Send SMS messages via Huawei LTE modem API (tested with E3372)
Replies: 84
Views: 21693

Re: Send SMS messages via Huawei LTE modem API (tested with E3372)

I am working (in my very limited spare time) in a more powerful library for HiLink access in RouterOS scripts that will try to solve these problems, call a function when new sms arrives, and even implements automatic execution of RoS scripts when receiving sms with :cmd, as Mikrotik's own SMS suppo...
by diamuxin
Tue Jun 27, 2023 11:03 am
Forum: Scripting
Topic: Script is executed twice from Scheduler
Replies: 6
Views: 1942

Re: Script is executed twice from Scheduler

Strange, in the end it was solved by deleting and recreating the Scheduler tasks. The events have not recurred. :shock:

Thank you.
by diamuxin
Mon Jun 26, 2023 2:58 pm
Forum: Scripting
Topic: Script is executed twice from Scheduler
Replies: 6
Views: 1942

Re: Script is executed twice from Scheduler

Uhm... again timezone? Try to schedule the event at 03:00...
Okay, I'll try it tonight. Thank you.

BR.
by diamuxin
Mon Jun 26, 2023 2:45 pm
Forum: Scripting
Topic: Script is executed twice from Scheduler
Replies: 6
Views: 1942

Re: Script is executed twice from Scheduler

(export of both scheduler and script?) Of course: (For example for the "backups" script) /system scheduler add interval=1d name=backups on-event="/system/script/run backups" policy=\ ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon \ start-date=2022-05-01 start-t...
by diamuxin
Sun Jun 25, 2023 9:01 pm
Forum: Scripting
Topic: Script is executed twice from Scheduler
Replies: 6
Views: 1942

Script is executed twice from Scheduler

Hello,

I have a problem that I don't understand, my RB750Gr3 router executes twice in a row each script scheduled from scheduler (it should only do it once).

The rest of the Mikrotik routers everything goes fine.

Has anyone had the same problem?

Thanks.
by diamuxin
Thu Jun 22, 2023 1:21 pm
Forum: Scripting
Topic: Log Filter
Replies: 66
Views: 8846

Re: Log Filter

@rextended already makes us happy with impressive contributions, he doesn't need to work any more :lol:
by diamuxin
Mon Jun 12, 2023 6:26 pm
Forum: Scripting
Topic: Log Filter
Replies: 66
Views: 8846

Re: Log Filter

Adding "..." as suggested by @diamuxin will add "..." also to shorter messages (don't know if this was clear...) I don't understand you, messages of < 30 characters will always be visible, they are not cut (tested) they are only cut > 30 characters. The lines 2, 3 or 4 that you ...
by diamuxin
Mon Jun 12, 2023 12:28 pm
Forum: Scripting
Topic: Log Filter
Replies: 66
Views: 8846

Re: Log Filter

Excellent @rextended, shockingly easy and works! Now, in a perfect world text with more that 30 characters should have "..." at the end and shorter not. I'll try to scratch my head but if you have an hint to point in the right direction... :) I don't really understand the point of cutting...
by diamuxin
Tue May 30, 2023 9:04 pm
Forum: Scripting
Topic: Log Filter
Replies: 66
Views: 8846

Re: Log Filter

Both scripts are updated for:
EDIT x: Exclude on default ipsec error messages phase1 negotiation failed, added the possibility to exclude topics regardless are critical or error or warning
(thanks to @S8T8 for the idea)
Updated! thx

..
by diamuxin
Mon May 29, 2023 2:15 pm
Forum: Scripting
Topic: Script to disable interface when there is no traffic
Replies: 3
Views: 1680

Re: Script to disable interface when there is no traffic

Friends, I need a script to disable an interface of my RB when it has no traffic. and after a few seconds that interface is re-enabled. Thank you for your cooperation.
Maybe this can help:
viewtopic.php?t=104841#p521331
by diamuxin
Sun May 28, 2023 2:28 am
Forum: Scripting
Topic: Log Filter
Replies: 66
Views: 8846

Re: Log Filter

Impressive work Rex, thank you very much, really. Thanks, I hope is error free . I do not have Telegram, but the URL "text" is correctly generated. If you ignore the date conversion and the correct urlencode, are less lines of code for do the same thing... ;) I confirm that your script wo...
by diamuxin
Sat May 27, 2023 2:39 pm
Forum: Scripting
Topic: Log Filter
Replies: 66
Views: 8846

Re: Log Filter

Impressive work Rex, thank you very much, really.

I'm away with the family right now, I'll try it as soon as I can.

BR.
by diamuxin
Sat May 27, 2023 11:16 am
Forum: Scripting
Topic: Log Filter
Replies: 66
Views: 8846

Re: Log Filter

try to set the device to GMT +00:00...... (and disable auto-detect) Good morning, I have already performed the tests with the following conditions: a) Configured System > Clock - Time: Local time - Date: Current date - Time Zone Autodetected: Unchecked - Time Zone Name: GMT+0 b) System > NTP Server...
by diamuxin
Fri May 26, 2023 8:43 pm
Forum: Scripting
Topic: Log Filter
Replies: 66
Views: 8846

Re: Log Filter

try to set the device to GMT +00:00...... (and disable auto-detect)
Ok, I'll do the test tonight.

..
by diamuxin
Fri May 26, 2023 1:02 am
Forum: Scripting
Topic: Log Filter
Replies: 66
Views: 8846

Re: Log Filter

Nothing, the same problem persists.
:(
by diamuxin
Thu May 25, 2023 6:06 pm
Forum: Scripting
Topic: Log Filter
Replies: 66
Views: 8846

Re: Log Filter

yes, I uncommented it and save to a global variable, but the result is the same. In your opinion, changing the rules of the date and updated to 7.10 with the new ISO format of the date, could it be solved? On a Miktotik with v7.9.1 I tried tonight to leave the date format of the original script: ma...
by diamuxin
Thu May 25, 2023 10:22 am
Forum: Scripting
Topic: Log Filter
Replies: 66
Views: 8846

Re: Log Filter

Well, the test performed tonight with the original script has been failed, some events of the previous day have been repeated tonight at 00:00 and 02:00.

I think the problem then cannot be the date. I don't know where it fails.
by diamuxin
Wed May 24, 2023 5:27 pm
Forum: Scripting
Topic: Log Filter
Replies: 66
Views: 8846

Re: Log Filter

Hello again, I have tested this code (original script) without any modification (only Telegram token and chat_id) and made a simulation by setting the router time to 23:58:00. When reaching 00:00:00:00 no event from the previous day has been repeated, it has worked as expected. @abbio90, try with th...
by diamuxin
Wed May 24, 2023 5:24 pm
Forum: Scripting
Topic: Log Filter
Replies: 66
Views: 8846

Re: Log Filter

ipsec script was copied from this one i found on github. so by copying I also copied the errors. I'll try to change this. more than anything I don't understand how to solve the continuous sending of messages at 00:00 and 02:00 My time zone is the same as Italy (from Spain) and the times previously ...
by diamuxin
Wed May 24, 2023 2:37 pm
Forum: Scripting
Topic: Log Filter
Replies: 66
Views: 8846

Re: Log Filter

It works perfectly, but every day at 00:00 and 02:00, I get the latest notification of the day. My script is the same base as yours, but adapted to my needs, https://forum.mikrotik.com/viewtopic.php?t=151953#p1003030 I have the same problem you mentioned: It repeats events of the previous day, same...
by diamuxin
Wed May 24, 2023 1:08 pm
Forum: Scripting
Topic: Persistent Environment Variables [SOLVED]
Replies: 50
Views: 36955

Re: Persistent Environment Variables [SOLVED]

Yes, but the function work? Is easy copy & paste the "eval / evl" code, but is restored just as string... on the code is present: :if ($vvalue~"\\(eval|evl) ") do={:set vvalue "(function)"} is missing one (another) ( before eval, now the script is fixed You are rig...
by diamuxin
Wed May 24, 2023 12:20 pm
Forum: Scripting
Topic: Persistent Environment Variables [SOLVED]
Replies: 50
Views: 36955

Re: Persistent Environment Variables [SOLVED]

Check twice.... after reboot....

If the function is
:global f do={ /interface print }

It's normal this:
:put [$f]
(function)

Is just a text "(function)" or another script set again the function correctly...
look at the screenshots

..
by diamuxin
Wed May 24, 2023 12:08 pm
Forum: Scripting
Topic: Persistent Environment Variables [SOLVED]
Replies: 50
Views: 36955

Re: Persistent Environment Variables [SOLVED]

[…] it is now possible to save/restore the content of a function. Congratulations! EEEEEEEHHHHHHHHHHHHH??????????? I am going to capture screenshots, just a second -------- Ready: a) Backup to Layer7 https://www.dropbox.com/s/qog0dyp1cz4f87s/BH1Bkh6LhS.png?dl=1 b) Restore to Environment https://www...
by diamuxin
Wed May 24, 2023 11:57 am
Forum: Scripting
Topic: Persistent Environment Variables [SOLVED]
Replies: 50
Views: 36955

Re: Persistent Environment Variables [SOLVED]

You try the "new version" if do same error?
Hi Rex,

Sorry for the delay, I just tested both scripts and they are now working correctly, both in v7.9.1 and v10beta5.

I am also happy because I see that it is now possible to save/restore the content of a function. Congratulations!

BR.
by diamuxin
Tue May 23, 2023 5:55 pm
Forum: Scripting
Topic: Persistent Environment Variables [SOLVED]
Replies: 50
Views: 36955

Re: Persistent Environment Variables [SOLVED]

Hi rextended, when I run your first script to save the global variables I get an error: ROS Version 7.9.1 [admin@MikroTik] > sys scr run save-global-variables failure: bad regexp: unmatched () ROS Version 7.10beta5 [admin@MikroTik] > sys scr run save-global-variables failure: bad regexp: too many ()...
by diamuxin
Fri May 19, 2023 7:18 pm
Forum: Scripting
Topic: Monitor Mikrotik log by Telegram
Replies: 62
Views: 34890

Re: Monitor Mikrotik log by Telegram

You have thested the last script?
wow! now it's working!
now works on both systems, v7.9 and v7.10

thanks for everything!!!
by diamuxin
Fri May 19, 2023 3:28 pm
Forum: Scripting
Topic: Monitor Mikrotik log by Telegram
Replies: 62
Views: 34890

Re: Monitor Mikrotik log by Telegram

ok, no problem.

BR.
by diamuxin
Fri May 19, 2023 2:56 pm
Forum: Scripting
Topic: Monitor Mikrotik log by Telegram
Replies: 62
Views: 34890

Re: Monitor Mikrotik log by Telegram

Can be a bug, I check.

Failed tests in these cases:
(v7.10beta5)
:put [$anydate2isodate "apr/22 16:33:41"]; # -19 -04-22 6:33:41
:put [$anydate2isodate "Apr/22 16:33:41"]; # -19 -04-22 6:33:41
:put [$anydate2isodate "04-22 16:33:41"]; # -19--4--2 6:33:41

thanks.
by diamuxin
Fri May 19, 2023 2:37 pm
Forum: Scripting
Topic: Monitor Mikrotik log by Telegram
Replies: 62
Views: 34890

Re: Monitor Mikrotik log by Telegram

Hi Rex, I think I have detected a bug? in the script:

:put [$anydate2isodate "04-22 16:33:41"]

In v.7.9 output
2023-04-22 16:33:41

In v7.10beta5 output:
-19--4--2 6:33:41

Is it normal?

EDIT post: changing the order of the date. Sorry.
..
by diamuxin
Fri May 19, 2023 1:12 pm
Forum: Scripting
Topic: Monitor Mikrotik log by Telegram
Replies: 62
Views: 34890

Re: Monitor Mikrotik log by Telegram

Brillante!. Grazie.
Works great.

I'm sorry the comment confused you.

BR.
by diamuxin
Fri May 19, 2023 12:44 pm
Forum: Scripting
Topic: Monitor Mikrotik log by Telegram
Replies: 62
Views: 34890

Re: Monitor Mikrotik log by Telegram

Rex, the approach of the script is fine because the Log lines of less than 24h do not have the date, only the time: :if ([:len $currentTime] = 8 ) Log e.g. 02:07:19 script,info Automated Cloud Backup Completed The script completes that line by incorporating the "current" date of the actual...
by diamuxin
Fri May 19, 2023 12:28 pm
Forum: Scripting
Topic: Monitor Mikrotik log by Telegram
Replies: 62
Views: 34890

Re: Monitor Mikrotik log by Telegram

I'm preparing the script for you to see, it takes a while because I'm at work now.
Oh thanks, no problem.
by diamuxin
Fri May 19, 2023 12:21 pm
Forum: Scripting
Topic: Monitor Mikrotik log by Telegram
Replies: 62
Views: 34890

Re: Monitor Mikrotik log by Telegram

add $currentTime to log that repost only the date is wrong, must be 00:00:00 add the scheduler using old format value probably is unsupported, if not on 10beta5, on new versions. The tests are done on a hAP ac^2 with v7.10beta5. But now I want it to be valid for versions <7.10 I assume you are refe...
by diamuxin
Fri May 19, 2023 10:30 am
Forum: Scripting
Topic: Monitor Mikrotik log by Telegram
Replies: 62
Views: 34890

Re: Monitor Mikrotik log by Telegram

Hi, I am trying to adapt this script to be compatible with the new ISO date format of v7.10+. Could the "LOG DATE" part of the code be made shorter? # LOG DATE # format daily 00:00:00 :if ([:len $currentTime] = 8 ) do={ # format $date 2023-05-17 (10) :if ([:len $date] = 10) do={ :set curre...
by diamuxin
Mon Apr 24, 2023 11:50 am
Forum: Scripting
Topic: Check Wireguard tunnel
Replies: 6
Views: 2836

Re: Check Wireguard tunnel

The newer /tool/netwatch might allow that logic with "On Test" script, you'd just check the last down time >10m in the script before restart.
I don't quite understand how I could do it with Netwatch, could you give an example?
by diamuxin
Sun Apr 23, 2023 11:28 pm
Forum: Scripting
Topic: Check Wireguard tunnel
Replies: 6
Views: 2836

Re: Check Wireguard tunnel

Curious as to why you ping an internal WG address to see if connection is up?? Assuming this is a client router and the subnet is on the other router?? Because that subnet is only accessed through the wireguard tunnel. You could also put the IP of the other end of the tunnel, for example 172.17.50....
by diamuxin
Sun Apr 23, 2023 9:11 pm
Forum: Scripting
Topic: Check Wireguard tunnel
Replies: 6
Views: 2836

Check Wireguard tunnel

Hi, I have this script that checks the connection of a wireguard tunnel between two sites. :if ([/ping 192.168.88.1 interval=500ms count=10]<8) do={ :local deviceName [/system/identity/get name] :local iFaceName "wg-sts" :log error "Wireguard: Tunnel with SiteB is down! Reconnecting.....
by diamuxin
Sun Apr 16, 2023 5:08 pm
Forum: Scripting
Topic: send MikroTik Notification via WhatsApp
Replies: 55
Views: 36159

Re: send MikroTik Notification via WhatsApp

hi all good time how to send MikriTik Message ( Notifications ) via WhatsApp ? example : https://wiki.mikrotik.com/wiki/Manual:The_Dude_v6/Dude_Telegram_Example best regards Hi there! To send MikroTik notifications via WhatsApp, you'll need to follow these steps: 1. Set up a WhatsApp Business Accou...
by diamuxin
Sat Apr 08, 2023 3:24 pm
Forum: Scripting
Topic: I did it! Script to compute UNIX time!
Replies: 33
Views: 23905

Re: I did it! Script to compute UNIX time!

Awesome, as always rextended to the rescue!
:wink:
by diamuxin
Wed Mar 15, 2023 2:20 pm
Forum: Scripting
Topic: I did it! Script to compute UNIX time!
Replies: 33
Views: 23905

Re: I did it! Script to compute UNIX time!

Interesting, thank you!

I've tried it and something is wrong here:
[] > :put [$str2case "this iS a teSt ,a teSt is it"]
This is a test ,a test is it
U and L works fine.

BR.
by diamuxin
Thu Mar 02, 2023 6:51 pm
Forum: Scripting
Topic: Fully Working Mikrotik Router OS Backup Script on local storage and FTP Upload [SOLVED]
Replies: 21
Views: 22075

Re: Fully Working Mikrotik Router OS Backup Script on local storage and FTP Upload [SOLVED]

Only one small thing missing in RouterOS. After backup is done, save the file and upload it. Also make a hash of the backup file. Next day, after a new backup file are made, compare it to yesterdays backup file using hash, if no change, do not send file to FTP. That's a very interesting idea, how d...
by diamuxin
Tue Feb 28, 2023 11:44 am
Forum: Scripting
Topic: Convert uptime to date and time [SOLVED]
Replies: 46
Views: 9042

Re: Convert uptime to date and time [SOLVED]

Ok, I found two bug, fixed.
Update previous script.
The script works fine now, thanks!

BR.
by diamuxin
Tue Feb 28, 2023 2:52 am
Forum: Scripting
Topic: Convert uptime to date and time [SOLVED]
Replies: 46
Views: 9042

Re: Convert uptime to date and time [SOLVED]

search tags # rextended online uptime start date time Work correctly only if RouterBOARD time is syncronized. Hi @rextended! With this "approximate" data, I think there is a small mismatch in your script, because there is something strange in the result: Uptime: 00:25:39 Local Date: 28/02...
by diamuxin
Sat Feb 18, 2023 1:23 am
Forum: Scripting
Topic: Convert any text to UNICODE
Replies: 40
Views: 7736

Re: Convert any text to UNICODE

Amazing!
thank you for your great work.

BR.
by diamuxin
Sun Feb 12, 2023 3:46 pm
Forum: Scripting
Topic: Convert any text to UNICODE
Replies: 40
Views: 7736

Re: Convert any text to UNICODE

Considering that the SMS message is extracted from my modem in UTF-8 format (I have already commented it on https://forum.mikrotik.com/viewtopic.php?t=193491#p983556) <?xml version="1.0" encoding="UTF-8"?> <response> <Count>1</Count> <Messages> <Message> <Smstat>0</Smstat> <Index...
by diamuxin
Sat Feb 11, 2023 8:20 pm
Forum: Scripting
Topic: Convert any text to UNICODE
Replies: 40
Views: 7736

Re: Convert any text to UNICODE

In that case, I tried with the $fURLEncode function but it doesn't work either. # ------------------- fURLEncode ---------------------- # :global fURLEncode do={ :local Chars {" "="%20";"!"="%21";"#"="%23";"%"="%25";&quo...
by diamuxin
Sat Feb 11, 2023 7:18 pm
Forum: Scripting
Topic: Convert any text to UNICODE
Replies: 40
Views: 7736

Re: Convert any text to UNICODE

How are you getting that XML? The message is extracted directly in XML from a Huawei USB modem using an API built into the device by that manufacturer. Starting from this function (token parser library) # TOKEN PARSER LIBRARY # v1.0.0 pkt # :put [($tokenParser->"getTag") source=$xml tag=&...
by diamuxin
Sat Feb 11, 2023 6:13 pm
Forum: Scripting
Topic: Convert any text to UNICODE
Replies: 40
Views: 7736

Re: Convert any text to UNICODE

Hello, what a nice surprise to read this progress on the recoding of characters valid for Telegram, thanks to both of you for your interest. No, Amm0 don't worry, I'm working with the spanish language, I mainly wanted to make it compatible with "ñ" and acute accents like "á, é, í, ó, ...
by diamuxin
Sat Feb 11, 2023 1:33 am
Forum: Scripting
Topic: Convert any text to UNICODE
Replies: 40
Views: 7736

Re: Convert any text to UNICODE

To write a defined text is fine, but the study is to be able to extract any text from a received SMS and forward it by Telegram with Unicode characters, so it could be read in Telegram. I have tried to see how this converter works [ https://r-1.ch/mikrotik-unicode-ssid-generator.php ], but my progra...
by diamuxin
Fri Feb 10, 2023 8:18 pm
Forum: General
Topic: Add emoji to the ssid name
Replies: 38
Views: 17233

Re: Add emoji to the ssid name

Great job!
Thanks.


BR.
by diamuxin
Fri Feb 10, 2023 8:14 pm
Forum: Scripting
Topic: Convert any text to UNICODE
Replies: 40
Views: 7736

Convert any text to UNICODE

Hello, Is it possible to create in RouterOS a converter similar to this one? https://r-1.ch/mikrotik-unicode-ssid-generator.php I have found that by converting any text to UNICODE, it can be displayed on the terminal screen and also recognizes it correctly in Telegram (would be a great solution). Fo...
by diamuxin
Fri Feb 10, 2023 2:33 pm
Forum: Scripting
Topic: Convert uptime to date and time [SOLVED]
Replies: 46
Views: 9042

Re: Convert uptime to date and time [SOLVED]

Even better, taking the functions you created for the Mikrotik Uptime, it can work for me as well and is quite accurate. https://forum.mikrotik.com/viewtopic.php?p=977167#p930465 Now it would look better: { :global tokenParser :global unixtodatetime :global currdatetimestr :local xmlData ([toarray [...
by diamuxin
Fri Feb 10, 2023 1:42 pm
Forum: Scripting
Topic: Convert uptime to date and time [SOLVED]
Replies: 46
Views: 9042

Re: Convert uptime to date and time [SOLVED]

Yes, I want as I said in the previous post is, starting from an uptime in seconds by value XXXXXXXXX sg, convert it to an easily understandable value, it does not matter if it is with Mo+Days+Hours+Minutes+Seconds format or YYYY-MM-DD hh.mm.ss. I don't know if I have explained myself well. I underst...
by diamuxin
Thu Feb 09, 2023 10:06 pm
Forum: Scripting
Topic: Send SMS messages via Huawei LTE modem API (tested with E3372)
Replies: 84
Views: 21693

Re: Send SMS messages via Huawei LTE modem API (tested with E3372)

By the way, the smsSend function sends SMS, putting them in the list of sent messages with a wrong date (I have all the messages sent via the API dated December 31, 1969. If the messages from the WEB interface are sent correctly). It works fine for me. [admin@MikroTik] > $sendSMS lteIP="192.16...
by diamuxin
Thu Feb 09, 2023 8:03 pm
Forum: Scripting
Topic: Convert uptime to date and time [SOLVED]
Replies: 46
Views: 9042

Re: Convert uptime to date and time [SOLVED]

Ciao rextended, Today I come with a new challenge, I want to convert an Uptime figure of a remote device that I want to control, the detail that the value is in seconds (I think): <uptime>546837</uptime> (That numeric value I already have it extracted and assigned to a local variable) I have designe...
by diamuxin
Thu Feb 09, 2023 4:05 pm
Forum: Scripting
Topic: find behaves in wierd ways if you pass it something like `domain="$domain"`
Replies: 12
Views: 1687

Re: find behaves in wierd ways if you pass it something like `domain="$domain"`

All the signature, for abuse, are removed.
I understand, thank you.

..
by diamuxin
Thu Feb 09, 2023 3:18 pm
Forum: Scripting
Topic: find behaves in wierd ways if you pass it something like `domain="$domain"`
Replies: 12
Views: 1687

Re: find behaves in wierd ways if you pass it something like `domain="$domain"`

Sorry for the off-topic Rex, what about your link to your scripts?
I don't see it in the signature.
by diamuxin
Thu Feb 09, 2023 1:29 pm
Forum: Scripting
Topic: Send SMS messages via Huawei LTE modem API (tested with E3372)
Replies: 84
Views: 21693

Re: Send SMS messages via Huawei LTE modem API (tested with E3372)

I didn't mean to offend you or "offend your modem". And my contribution to the scripts is here: https://forummikrotik.ru/viewtopic.php?f=14&t=13947 Now I am busy writing my own Telegram Notifier and Runner system, which differs from the existing works. I am also writing a universal fu...
by diamuxin
Thu Feb 09, 2023 10:59 am
Forum: Scripting
Topic: Send SMS messages via Huawei LTE modem API (tested with E3372)
Replies: 84
Views: 21693

Re: Send SMS messages via Huawei LTE modem API (tested with E3372)

I think this will work even if Count tag is empty or non-existent: :global tokenParser :global recvSMS :local xmlSmsList ([$recvSMS]->"data") :local smsCount [:tonum [($tokenParser->"getTag") source=$xmlSmsList tag="Count"]] :if ($smsCount > 0) do={ ... } Thank you ver...
by diamuxin
Thu Feb 09, 2023 10:46 am
Forum: Scripting
Topic: Send SMS messages via Huawei LTE modem API (tested with E3372)
Replies: 84
Views: 21693

Re: Send SMS messages via Huawei LTE modem API (tested with E3372)

By the way, Huawei E3372h-320 modem is much worse than the earlier model E3372h-153. Modification 320 does not have an SD slot, does not have the ability to connect external antennas and does not have the ability to change the firmware to alternative ones. You are totally wrong (and more if you hav...
by diamuxin
Wed Feb 08, 2023 9:37 pm
Forum: Scripting
Topic: Send SMS messages via Huawei LTE modem API (tested with E3372)
Replies: 84
Views: 21693

Re: Send SMS messages via Huawei LTE modem API (tested with E3372)

Collection of Huawei API scripts for use with MikroTik (Tested on a Huawei E3372h-320 modem) Token Parser Library (Main Script base) # TOKEN PARSER LIBRARY # v1.0.0 pkt # :put [($tokenParser->"getTag") source=$xml tag="SessionInfo"] # ($tokenParser->"getBetween") # get...
by diamuxin
Wed Feb 08, 2023 9:07 pm
Forum: Scripting
Topic: Send SMS messages via Huawei LTE modem API (tested with E3372)
Replies: 84
Views: 21693

Re: Send SMS messages via Huawei LTE modem API (tested with E3372)

There are many scripts written here, but there is no system, you can get confused ... Is it possible to ask the authors to put this chaos in order? As far as I understand, there are ready-made functions You can not demand that the information in the thread is ordered to your liking, especially when...
by diamuxin
Wed Feb 08, 2023 8:50 pm
Forum: Scripting
Topic: Send SMS messages via Huawei LTE modem API (tested with E3372)
Replies: 84
Views: 21693

Re: Send SMS messages via Huawei LTE modem API (tested with E3372)

Hi @pkt, Starting from this: <Count>1</Count> for example. How can I do to execute an action if <Count> is >0. I have started like this: [admin@MikroTik] > :put ([$recvSMS]->"data") <?xml version="1.0" encoding="UTF-8"?> <response> <Count>1</Count> <Messages> <Message> ...
by diamuxin
Wed Feb 08, 2023 2:49 pm
Forum: Scripting
Topic: Send SMS messages via Huawei LTE modem API (tested with E3372)
Replies: 84
Views: 21693

Re: Send SMS messages via Huawei LTE modem API (tested with E3372)

Hi @pkt, One last question please, is it possible to delete also the sent SMS? when I enter the web-ui 192.168.8.1, I see that the received SMS are deleted correctly, however the sent SMS are visible. It is not important, just curious. Edit: I reply to myself: The key is in the following: <BoxType>2...
by diamuxin
Tue Feb 07, 2023 8:04 pm
Forum: Scripting
Topic: Send SMS messages via Huawei LTE modem API (tested with E3372)
Replies: 84
Views: 21693

Re: Send SMS messages via Huawei LTE modem API (tested with E3372)

How ñ and Ó on terminal???????? What you use SSL? Telenet? Other? On 7.7 I haven't find any way to print other characters. Is a script results??? Hmmm.... I use MobaXterm as an external terminal SSH, it is wonderful and very visual. https://i.postimg.cc/D0P9N6BT/image.png I can read SMS, but I can'...
by diamuxin
Tue Feb 07, 2023 7:47 pm
Forum: Scripting
Topic: Send SMS messages via Huawei LTE modem API (tested with E3372)
Replies: 84
Views: 21693

Re: Send SMS messages via Huawei LTE modem API (tested with E3372)

Probably using the API of the Huawei, is possible to send one message with "ñ" or "€" simply converting first the message with ASCIItoCP1252toUTF8. If your codepage is not CP1252 / Windows 1252, must be done one appropriate function using the ASCIItoCP1252toUTF8 as base. When an...
by diamuxin
Tue Feb 07, 2023 4:51 pm
Forum: Scripting
Topic: Send SMS messages via Huawei LTE modem API (tested with E3372)
Replies: 84
Views: 21693

Re: Send SMS messages via Huawei LTE modem API (tested with E3372)

I use Telegram in most of my scripts, I tried it at the time here and I had errors with the encoding of some SMS characters, so I discarded it. The 2nd function on my post can be used before sent the string (ASCII-7 and/or CP125x) to telegram (UTF-8): https://forum.mikrotik.com/viewtopic.php?t=1775...
by diamuxin
Tue Feb 07, 2023 9:59 am
Forum: Scripting
Topic: Send SMS messages via Huawei LTE modem API (tested with E3372)
Replies: 84
Views: 21693

Re: Send SMS messages via Huawei LTE modem API (tested with E3372)

I use Telegram in most of my scripts, I tried it at the time here and I had errors with the encoding of some SMS characters, so I discarded it.
by diamuxin
Tue Feb 07, 2023 12:29 am
Forum: Scripting
Topic: Send SMS messages via Huawei LTE modem API (tested with E3372)
Replies: 84
Views: 21693

Re: Send SMS messages via Huawei LTE modem API (tested with E3372)

Maybe you have not delSMS in scope. If it is not defined in the same script or function in which is used, it's necessary to "import" the symbol declaring it. You can try to put :global delSMS in a line before the foreach one. You are right, declaring the global variable "delSMS"...
by diamuxin
Mon Feb 06, 2023 10:29 pm
Forum: Scripting
Topic: Send SMS messages via Huawei LTE modem API (tested with E3372)
Replies: 84
Views: 21693

Re: Send SMS messages via Huawei LTE modem API (tested with E3372)

Thank you very much for your help @pkt, we are very close to solve it. I just tried it like this and I notice something curious, if I insert this code inside a script, it doesn't work. { :global tokenParser :local xmlSmsList ([$recvSMS]->"data") :local smsList [($tokenParser->"getTagL...
by diamuxin
Mon Feb 06, 2023 2:42 pm
Forum: Scripting
Topic: Send SMS messages via Huawei LTE modem API (tested with E3372)
Replies: 84
Views: 21693

Re: Send SMS messages via Huawei LTE modem API (tested with E3372)

Sorry, I can't help here, except this,
viewtopic.php?p=982500#p982173
I do not have that poduct...
Your help is always welcome. That script is very useful.
by diamuxin
Mon Feb 06, 2023 2:41 pm
Forum: Scripting
Topic: Send SMS messages via Huawei LTE modem API (tested with E3372)
Replies: 84
Views: 21693

Re: Send SMS messages via Huawei LTE modem API (tested with E3372)

Apparently they need to be flashed to E3372-320
No, my firmware is the original factory firmware. I bought it that way and it updated itself.
by diamuxin
Mon Feb 06, 2023 2:24 pm
Forum: Scripting
Topic: Send SMS messages via Huawei LTE modem API (tested with E3372)
Replies: 84
Views: 21693

Re: Send SMS messages via Huawei LTE modem API (tested with E3372)

Well , then they started tweeting without me ... In order not to disassemble all the posts, can someone clearly write how to receive SMS and how to send it and on which firmware it will work? None of the above scripts for sending/receiving SMS are working for me ... You will need to look for a Huaw...
by diamuxin
Mon Feb 06, 2023 2:09 pm
Forum: Scripting
Topic: Send SMS messages via Huawei LTE modem API (tested with E3372)
Replies: 84
Views: 21693

Re: Send SMS messages via Huawei LTE modem API (tested with E3372)

Well , then they started tweeting without me ... In order not to disassemble all the posts, can someone clearly write how to receive SMS and how to send it and on which firmware it will work? https://forum.mikrotik.com/viewtopic.php?t=166859#p981850 https://forum.mikrotik.com/viewtopic.php?p=982481...
by diamuxin
Mon Feb 06, 2023 11:37 am
Forum: Scripting
Topic: Send SMS messages via Huawei LTE modem API (tested with E3372)
Replies: 84
Views: 21693

Re: Send SMS messages via Huawei LTE modem API (tested with E3372)

The second foreach does not work, tested as follows: { :global tokenParser :local xmlSmsList ([$recvSMS]->"data") :local smsList [($tokenParser->"getTagList") source=$xmlSmsList tag="Message"] :foreach tagContent in=$smsList do={ :local index [($tokenParser->"getTa...
by diamuxin
Sun Feb 05, 2023 11:35 pm
Forum: Scripting
Topic: Send SMS messages via Huawei LTE modem API (tested with E3372)
Replies: 84
Views: 21693

Re: Send SMS messages via Huawei LTE modem API (tested with E3372)

Afaik, you can't delete the entire inbox with one command. But can do it one message at a time using its index. In the delete request, instead of <Index>10</Index> use <Index>$index</Index> . And then (not tested): ... :local index ([($tokenParser->"getTag") source=$tagContent tag="I...
by diamuxin
Sun Feb 05, 2023 11:04 pm
Forum: Scripting
Topic: Group content in email
Replies: 2
Views: 921

Re: Group content in email

It works correctly, thanks Rex.

BR.
by diamuxin
Fri Feb 03, 2023 7:00 pm
Forum: Scripting
Topic: Group content in email
Replies: 2
Views: 921

Group content in email

Hi, one question, please: On this loop :foreach tagContent in=$smsList do={ :local index [($tokenParser->"getTag") source=$tagContent tag="Index"] :local phone [($tokenParser->"getTag") source=$tagContent tag="Phone"] :local content [($tokenParser->"getTa...
by diamuxin
Fri Feb 03, 2023 12:35 pm
Forum: Scripting
Topic: Send SMS messages via Huawei LTE modem API (tested with E3372)
Replies: 84
Views: 21693

Re: Send SMS messages via Huawei LTE modem API (tested with E3372)

Hi @pkt You have made a very important breakthrough in research, thank you for your work. Your script works very fine. Unread messages: [admin@MikroTik] > sys scr run test-sms 40002 false +34XXXXXXXXX Received message test 2 40001 false +34XXXXXXXXX Received message test 1 Already read messages: (Ch...
by diamuxin
Fri Feb 03, 2023 10:08 am
Forum: Scripting
Topic: Send SMS messages via Huawei LTE modem API (tested with E3372)
Replies: 84
Views: 21693

Re: Send SMS messages via Huawei LTE modem API (tested with E3372)

I except to have a test version the next week or maybe the next one.
Fantastic @pkt!

Thank you very, very much for helping us with the Huawei API.
We'll keep an eye out for your review.

Best regards.
by diamuxin
Thu Feb 02, 2023 8:57 am
Forum: Scripting
Topic: Send SMS messages via Huawei LTE modem API (tested with E3372)
Replies: 84
Views: 21693

Re: Send SMS messages via Huawei LTE modem API (tested with E3372)

So does this script only work with this version of the modem ? I have tested it on two models: - E8372h-320 -> Does not work. - E3372h-320 -> Yes it works (only to send SMS). I have tested (read back) to receive SMS and process the content, without success. I am waiting to see if the author of the ...
by diamuxin
Fri Jan 27, 2023 8:12 pm
Forum: Scripting
Topic: Pinging google with different interfaces
Replies: 2
Views: 1150

Re: Pinging google with different interfaces

Hi,

What you need is called recursive routing, which allows multiple routes to ping check even if the route distance is 2, 3, etc.

Here is some information:
https://help.mikrotik.com/docs/pages/vi ... d=26476608

BR.
by diamuxin
Tue Jan 24, 2023 8:56 pm
Forum: Scripting
Topic: Change word in comment
Replies: 9
Views: 2259

Re: Change word in comment

Check if these three conditions are met:
in=[find where !dynamic and type="ether" and comment~$searchthis]
BR.
by diamuxin
Mon Jan 23, 2023 4:43 pm
Forum: Scripting
Topic: Changing an IP-Address
Replies: 5
Views: 1065

Re: Changing an IP-Address

Something like that?
{
:local ipAdd 192.168.1.100/24
:set ipAdd [:toip [:pick $ipAdd 0 [:find $ipAdd "/"]]]
:put $ipAdd
}
Output ==> 192.168.1.100
BR.
by diamuxin
Sat Jan 21, 2023 1:57 am
Forum: Scripting
Topic: Backup config to Gmail v1.6 [SOLVED]
Replies: 68
Views: 15952

Re: Backup config to Gmail v1.5 [SOLVED]

OK, thanks for the clarification.

BR.
by diamuxin
Sat Jan 21, 2023 1:02 am
Forum: Scripting
Topic: Backup config to Gmail v1.6 [SOLVED]
Replies: 68
Views: 15952

Re: Backup config to Gmail v1.5 [SOLVED]

Since you did not write what system this is on, its hard to find the error.
It handles al routerBoard and CHR, but seems to fail on x86 OVA setup.
Will try to fix that.
It is tested on a RB4011, hAP ​​ac2 and hAP ac3.

BR
by diamuxin
Fri Jan 20, 2023 8:47 pm
Forum: Scripting
Topic: Backup config to Gmail v1.6 [SOLVED]
Replies: 68
Views: 15952

Re: Backup config to Gmail v1.5 [SOLVED]

I'm sorry, but I don't understand Jotne's answer.

I mean this: (non system-id)
[admin@MikroTik] /system/license> pr
  software-id: XXXX-XXXX
       nlevel: 5
     features:
That's all.


BR.
by diamuxin
Fri Jan 20, 2023 12:52 pm
Forum: Scripting
Topic: Backup config to Gmail v1.6 [SOLVED]
Replies: 68
Views: 15952

Re: Backup config to Gmail v1.5 [SOLVED]

Hi Jotne,

I have tested your script with RouterOS version 7.7 and this part does not work:

/system license
	:set serial [get system-id]

Now it is:

/system license
	:set serial [get software-id]

Greetings.
by diamuxin
Mon Jan 16, 2023 10:48 am
Forum: Scripting
Topic: Send SMS messages via Huawei LTE modem API (tested with E3372)
Replies: 84
Views: 21693

Re: Send SMS messages via Huawei LTE modem API (tested with E3372)

Yes, also the content, thank you.

The idea is that the content of the SMS received (phone number and message) can be forwarded by email or sms, for example.

BR.
by diamuxin
Sun Jan 15, 2023 9:16 pm
Forum: Scripting
Topic: Send SMS from different router
Replies: 90
Views: 9001

Re: Send SMS from different router

He has already made it clear to you, please do not waste more time or make others lose it.
by diamuxin
Fri Jan 13, 2023 9:33 pm
Forum: Announcements
Topic: v7.7 [stable] is released!
Replies: 357
Views: 113953

Re: v7.7 [stable] is released!

In RB4011 with 7.7 the CPU Frequency has disappeared and it is not possible to see it in Winbox and neither by CLI (in 7.7beta3 it worked fine). *) rb4011 - fixed reporting of current CPU frequency and changed default frequency to "auto"; ==> NOT working In the other routers (ac2, ac3, mAP...
by diamuxin
Fri Jan 13, 2023 12:52 pm
Forum: Scripting
Topic: Convert uptime to date and time [SOLVED]
Replies: 46
Views: 9042

Re: Convert uptime to date and time [SOLVED]

The logic is correct, I fix the script, now work (if the time on routerboard is syncronized) without using external sites.

viewtopic.php?p=977167#p930465
Now perfect Rex!

Thanks for your work!

Greetings.
by diamuxin
Fri Jan 13, 2023 2:24 am
Forum: Scripting
Topic: Convert uptime to date and time [SOLVED]
Replies: 46
Views: 9042

Re: Convert uptime to date and time [SOLVED]

Try it with your uptime, it's the best test.

Italy and Spain have the same time zone.

BR.
by diamuxin
Fri Jan 13, 2023 1:39 am
Forum: Scripting
Topic: Convert uptime to date and time [SOLVED]
Replies: 46
Views: 9042

Re: Convert uptime to date and time [SOLVED]

I repeat: I do not make till now a function to convert back unix epoch to date and time, but on future I write a reverse function. Till I finish the function or I find another URL, the function provide the correct unix epoch start time of the routerboard, but not the correct time on the date & ...
by diamuxin
Fri Jan 13, 2023 1:36 am
Forum: Scripting
Topic: Convert uptime to date and time [SOLVED]
Replies: 46
Views: 9042

Re: Convert uptime to date and time [SOLVED]

Ops! it does not work... :(

My Uptime is 02:08:00
My time is approx 00:34 - 01/13/2023

Script output:

RouterBOARD is started 1673558651 (2023-01-13 04:24:11) -> quite early hour

BR.
by diamuxin
Fri Jan 13, 2023 1:17 am
Forum: Scripting
Topic: Convert uptime to date and time [SOLVED]
Replies: 46
Views: 9042

Re: Convert uptime to date and time [SOLVED]

OK, thanks.

BR.
by diamuxin
Thu Jan 12, 2023 11:34 pm
Forum: Scripting
Topic: Convert uptime to date and time [SOLVED]
Replies: 46
Views: 9042

Re: Convert uptime to date and time [SOLVED]

Hello,

it seems that the external access of the "uptime" script has failed again, it has been a few days since I got the time correctly (my time zone is Spain).

I have restarted it to install the new 7.7 and it shows me that I have restarted on 01/13/2023 at 05:24 am.
¿?

BR.
by diamuxin
Wed Jan 11, 2023 7:13 pm
Forum: Scripting
Topic: Send SMS messages via Huawei LTE modem API (tested with E3372)
Replies: 84
Views: 21693

Re: Send SMS messages via Huawei LTE modem API (tested with E3372)

Well, I have already received my Huawei E3372h-320 modem that incorporates an API that allows to manage some functions of the modem. I have tested the following script and it works correctly: :global sendSMS do={ # Send SMS messages via Huawei LTE modem API (tested with E3372) # global vars: # lteIP...
by diamuxin
Tue Jan 10, 2023 8:55 am
Forum: Scripting
Topic: Send SMS from different router
Replies: 90
Views: 9001

Re: Send SMS from different router

I don't know, you'll have to try it out.
by diamuxin
Mon Jan 09, 2023 6:15 pm
Forum: Announcements
Topic: IP Cloud
Replies: 79
Views: 160199

Re: IP Cloud

Still not working

BR.
by diamuxin
Mon Jan 09, 2023 5:03 pm
Forum: Scripting
Topic: Send SMS from different router
Replies: 90
Views: 9001

Re: Send SMS from different router

We all have learned... Rex is a great programmer. By the way the command of the topic discussed today, can work like this too, easier, shorter. [/system ssh-exec address=192.168.1.2 user=admin command=":global x [/system routerboard get model]"] # for: [/system ssh-exec 192.168.1.2 ":...
  • 1
  • 2