2020-09-18 09:00:27 +00:00
|
|
|
#!rsc by RouterOS
|
2018-07-05 13:29:26 +00:00
|
|
|
# RouterOS script: netwatch-syslog
|
2022-01-01 20:38:15 +00:00
|
|
|
# Copyright (c) 2013-2022 Christian Hesse <mail@eworm.de>
|
2020-06-19 20:17:42 +00:00
|
|
|
# https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md
|
2018-07-05 13:29:26 +00:00
|
|
|
#
|
2018-10-12 09:17:39 +00:00
|
|
|
# requires: dont-require-permissions=yes
|
|
|
|
#
|
2018-07-05 13:29:26 +00:00
|
|
|
# manage remote logging facilities
|
2020-03-27 20:49:03 +00:00
|
|
|
# https://git.eworm.de/cgit/routeros-scripts/about/doc/netwatch-syslog.md
|
2018-07-05 13:29:26 +00:00
|
|
|
|
2019-01-15 09:40:40 +00:00
|
|
|
:local Remote [ /system logging action get ([ find where target=remote ]->0) remote ];
|
2018-07-05 13:29:26 +00:00
|
|
|
|
2020-09-21 19:25:17 +00:00
|
|
|
if ([ / tool netwatch get [ find where host=$Remote up-script="netwatch-syslog" down-script="netwatch-syslog" ] status ] = "up") do={
|
2018-07-05 13:29:26 +00:00
|
|
|
/ system logging set disabled=no [ find where action=remote disabled=yes ];
|
|
|
|
} else={
|
|
|
|
/ system logging set disabled=yes [ find where action=remote disabled=no ];
|
|
|
|
}
|