Commit graph

1706 commits

Author SHA1 Message Date
Christian Hesse 16bfe4de7e global-functions: $MkDir: create a tmpfs (RAM disk)...
... if the path starts with "tmpfs/". This helps to mitigate flash wear.
2022-12-13 21:50:32 +01:00
Christian Hesse 1579330864 global-functions: $MkDir: create directories recursively 2022-12-13 21:25:07 +01:00
Christian Hesse 58f769ac00 global-functions: $MkDir: rename internal variable 2022-12-13 10:37:56 +01:00
Christian Hesse 446d5c89fc global-functions: $MkDir: fail if non-directory path exists 2022-12-13 10:31:41 +01:00
Christian Hesse 9c42263988 global-functions: check RouterOS version before loading modules 2022-12-12 15:16:36 +01:00
Christian Hesse 7f7c3a7a70 global-functions: $SymbolByUnicodeName: append variation selector-16...
... to specify that the preceding character should be displayed with emoji
presentation.

https://unicode-table.com/en/FE0F/
2022-12-06 16:41:14 +01:00
Christian Hesse 8854d03ea2 global-functions: introduce $IsMacLocallyAdministered...
... and use it in $GetMacVendor.
2022-11-29 17:07:40 +01:00
Christian Hesse 0ad94b042d netwatch-notify: support type https-get
... which was introduced in RouterOS 7.7beta8.
2022-11-25 08:39:07 +01:00
Christian Hesse ad85f22540 global-functions: $IsTimeSync: no cloud on x86 2022-11-22 22:24:59 +01:00
Christian Hesse ef7360453f global-functions: $IsTimeSync: no cloud with CHR free license 2022-11-22 22:23:51 +01:00
Christian Hesse a7bdebbfb0 doc/mod/notification-email: mention correct time 2022-11-22 21:49:34 +01:00
Christian Hesse 89c0fde465 mod/notification-email: put status in scheduler comment 2022-11-22 21:28:45 +01:00
Christian Hesse 03d1927067 mod/notification-email: set scheduler interval earlier
... to make sure the checks are not re-run every second.
2022-11-22 21:28:26 +01:00
Christian Hesse ab3047ee82 mod/notification-email: reference scheduler from variable 2022-11-22 21:27:51 +01:00
Christian Hesse c2a29da9f2 global-functions: $ScriptLock: use shorter random string
... but with all characters from alphabet with $GetRandom20CharAlNum.
2022-11-22 19:05:29 +01:00
Christian Hesse 3c4595e82b global-functions: $MkDir: use shorter random string
... but with all characters from alphabet with $GetRandom20CharAlNum.
2022-11-22 19:05:02 +01:00
Christian Hesse 514d241969 README: link to Github pull requests 2022-11-17 23:02:02 +01:00
Christian Hesse 6f79eb996a mod/notification-email: make sure the scheduler interval is never zero 2022-11-17 22:34:08 +01:00
Christian Hesse b517b26517 mod/notification-email: check that attachment exists 2022-11-17 22:18:16 +01:00
Christian Hesse 71d1f2a781 mod/notification-email: convert to array earlier 2022-11-17 22:13:02 +01:00
Christian Hesse 9f02f04334 mod/notification-email: fix typo 2022-11-17 22:10:52 +01:00
Christian Hesse 7594345da8 README: copy *relevant* configuration only 2022-10-31 21:45:36 +01:00
Christian Hesse 6822e71564 netwatch-notify: cache the result
If this script runs from terminal this will not change... 😜
So cache the result.

Co-authored-by: Michael Gisbers <michael@gisbers.de>
2022-10-21 15:00:42 +02:00
Michael Gisbers a0163aa487 netwatch-notify: always show messages when run from terminal
Co-authored-by: Christian Hesse <mail@eworm.de>
2022-10-21 15:00:41 +02:00
Christian Hesse c3da4ed696 netwatch-notify: stop flooding the log after down notification
This will now log all messages before notification, and every two hours
(or scheduler interval * 120) after.
2022-10-21 15:00:39 +02:00
Christian Hesse a1ef912ec7 Merge branch 'notifications' into next
These are generated with my 'RouterOS-Scripts Notification Generator':
https://eworm.de/ros/notification/
2022-10-20 11:37:35 +02:00
Christian Hesse aef88e313b doc/sms-forward: update notification
---- ✂️ ----
📨 SMS Forwarding from 7277

Received this message by MikroTik from 7277:

On oct/17/2022 13:44:10 GMT -0 type class-0:
Welcome to our network!
---- ✂️ ----
2022-10-20 11:37:09 +02:00
Christian Hesse ee7836263f doc/netwatch-notify: update notifications
---- ✂️ ----
 Netwatch Notify: example.com down

The host 'example.com' (93.184.216.34) is down since oct/19/2022 16:27:03.
---- ✂️ ----
 Netwatch Notify: example.com up

The host 'example.com' (93.184.216.34) is up since oct/19/2022 17:03:00.
It was down for 6 checks since oct/19/2022 16:27:03.
---- ✂️ ----
2022-10-20 11:37:05 +02:00
Christian Hesse 4f8a2bd8e2 doc/log-forward: update notification
---- ✂️ ----
⚠️ Log Forwarding

The log on MikroTik contains these 3 messages after 6d23:55:18 uptime.

 ● 13:24:02 script;error backup-cloud: Failed uploading backup for MikroTik to cloud!
 ● 13:24:17 system;info;account user admin logged in from 192.168.88.177 via ssh
 ● 13:24:57 system;info;account user admin logged out from 192.168.88.177 via ssh
---- ✂️ ----
2022-10-20 11:28:09 +02:00
Christian Hesse 694f4e2894 doc/daily-psk: update notification
---- ✂️ ----
📅 daily PSK Guest-Wifi

This is the daily PSK on MikroTik:

SSID: Guest-Wifi
PSK:  S3cr3tStr1ng
Date: oct/18/2022

A client device specific rule must not exist!

🔗 https://www.eworm.de/cgi-bin/cqrlogo-wifi.cgi?scale=8&level=1&ssid=Guest-Wifi&pass=S3cr3tStr1ng
---- ✂️ ----
2022-10-20 11:28:09 +02:00
Christian Hesse dddbd3da27 doc/collect-wireless-mac: update notification
---- ✂️ ----
📱 48:F1:7F:D0:E5:4E connected to Wifi

A device with unknown MAC address connected to Wifi on MikroTik.

Controller: MikroTik
Interface:  wl5-wifi
SSID:       Wifi
MAC:        48:F1:7F:D0:E5:4E
Vendor:     Intel Corporate
Hostname:   host-523c8e0e
Address:    192.168.20.254
DNS name:   host-523c8e0e.dhcp.MikroTik.example.com
Date:       oct/20/2022 09:21:56
---- ✂️ ----
2022-10-20 11:28:09 +02:00
Christian Hesse 6940f851b0 doc/check-routeros-update: update notification
---- ✂️ ----
 RouterOS update

A new RouterOS version 7.6 is available for MikroTik.

Hostname:       MikroTik
Board name:     CHR
Architecture:   x86_64
RouterOS:
    Channel:    stable
    Installed:  7.5
    Available:  7.6
RouterOS-Scripts:
    Version:    85

🔗 https://mikrotik.com/download/changelogs/stable-release-tree
---- ✂️ ----
2022-10-20 11:28:09 +02:00
Christian Hesse 863cf9cae0 doc/check-lte-firmware-upgrade: update notification
---- ✂️ ----
 LTE firmware upgrade

A new firmware version R11e-LTE6_V033 is available for LTE interface lte on MikroTik.

Interface: MikroTik R11e-LTE6
Installed: R11e-LTE6_V027
Available: R11e-LTE6_V033
---- ✂️ ----
2022-10-20 11:28:09 +02:00
Christian Hesse 692ed21262 doc/check-health: update notifications
---- ✂️ ----
📉 Health warning: voltage

The voltage on MikroTik jumped more than 10%.

old value: 16.2V
new value: 12.4V
---- ✂️ ----
🔥 Health warning: temperature

The temperature on MikroTik is above threshold: 51°C
---- ✂️ ----
 Health recovery: temperature

The temperature on MikroTik dropped below threshold: 47°C
---- ✂️ ----
 Health warning: psu1-state

The power supply unit 'psu1-state' on MikroTik failed!
---- ✂️ ----
 Health recovery: psu1-state

The power supply unit 'psu1-state' on MikroTik recovered!
---- ✂️ ----
2022-10-20 11:28:09 +02:00
Christian Hesse fadf4d5008 doc/check-certificates: update notification
---- ✂️ ----
🔏 Certificate renewed

A certificate on MikroTik has been renewed.

Name:        example.com
CommonName:  example.com
Private key: available
Fingerprint: cc54cdd01fcd7698ecb71213874be776906eb33d26cd57754d168632f14c4c8b
Issuer:      R3
Validity:    sep/08/2022 03:50:56 to dec/07/2022 03:50:55
Expires in:  8w 3d 12:03:30
---- ✂️ ----
2022-10-20 11:28:09 +02:00
Christian Hesse 98844d85d5 doc/backup-upload: update notification
---- ✂️ ----
💾⬆️ Backup & Config upload

Backup and config export upload for MikroTik.

Hostname:       MikroTik
Board name:     CHR
Architecture:   x86_64
RouterOS:
    Channel:    stable
    Installed:  7.6
RouterOS-Scripts:
    Version:    85

Backup file:    MikroTik_example_com.backup
Config file:    MikroTik_example_com.rsc
---- ✂️ ----
2022-10-20 11:28:09 +02:00
Christian Hesse 3733e0a919 doc/backup-cloud: update notification
---- ✂️ ----
💾☁️ Cloud backup

Uploaded backup for MikroTik to cloud.

Hostname:       MikroTik
Board name:     CHR
Architecture:   x86_64
RouterOS:
    Channel:    stable
    Installed:  7.6
RouterOS-Scripts:
    Version:    85

Name:           cloud-20221020-092419
Size:           370767 B (362 KiB)
Download key:   LLDBfPcWXxmSetWilqeJX5V
---- ✂️ ----
2022-10-20 11:28:09 +02:00
Christian Hesse 8c89fb0a4e README: update notification
---- ✂️ ----
📌 News and configuration changes

The configuration version on MikroTik increased to 85, current configuration may need modification. Please review and update global-config-overlay, then re-run global-config.

Changes:
 ● Support for e-mail notifications moved to a module. It is installed automatically if required.
 ● Dropped 'netwatch-syslog', filtering in firewall is advised.
---- ✂️ ----
2022-10-20 10:01:04 +02:00
Christian Hesse 4106b199bf mod/notification-telegram: drop 'Telegram' from wording 2022-10-19 22:46:23 +02:00
Christian Hesse fe87e9551d firmware-upgrade-reboot: update wording, give version 2022-10-19 11:57:52 +02:00
Christian Hesse bff6689b10 ipsec-to-dns: strip "CN=" from peer's id 2022-10-19 08:54:11 +02:00
Christian Hesse 621154ab83 ipsec-to-dns: remove debug output
Oops... 😳

This sneaked in with initial commit 862417b8d3
("add 'ipsec-to-dns'").
2022-10-19 08:45:40 +02:00
Christian Hesse 2f8e8b7448 update-gre-address: strip "CN=" from peer's id
The prefix "CN=" is now added in RouterOS 7.6... Let's match with and
without the prefix in comment.
2022-10-18 22:43:42 +02:00
Christian Hesse 640cb81119 netwatch-notify: fix the count...
This broke in commit 6f772e92a6
("netwatch-notify: rename array element") where not only the array
element but also the option was renamed.
2022-10-14 22:39:21 +02:00
Christian Hesse 493d534706 update-tunnelbroker: drop extra detection, use response from update
Why hammer on another service? The tunnelbroker response contains the
address we need. So send the update every time, and use that
information.
2022-10-09 23:56:53 +02:00
Christian Hesse e7995fa06b update-tunnelbroker: get public address from website
This is a good condidate:

https://showipv6.de/

We can drop the cloud code, which seems to be unreliable in somd
situations.
2022-10-09 23:56:53 +02:00
Christian Hesse c95cbdbc1e doc/update-tunnelbroker: give more hints on expected config 2022-10-09 00:00:50 +02:00
Christian Hesse 16e93018ef update-tunnelbroker: work around timing issue
Looks like fetch command has a timing issue with the tunnelbroker
endpoint... We have to try several times to work around this.
Consider the update failed on third error.
2022-10-08 23:06:22 +02:00
Christian Hesse ebaa9b617d update-tunnelbroker: add error handling for fetch command 2022-10-08 22:38:31 +02:00
Christian Hesse dd22dfd26d backup-email: check if dependency for sending e-mail is installed 2022-09-29 10:31:54 +02:00