routeros-scripts/netwatch-syslog

18 lines
717 B
Text
Raw Normal View History

#!rsc by RouterOS
2018-07-05 13:29:26 +00:00
# RouterOS script: netwatch-syslog
2021-01-01 20:33:52 +00:00
# Copyright (c) 2013-2021 Christian Hesse <mail@eworm.de>
# https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md
2018-07-05 13:29:26 +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
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 ];
}