routeros-scripts/netwatch-syslog

18 lines
714 B
Text
Raw Normal View History

#!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>
# 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
: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={
/system/logging/set disabled=no [ find where action=remote disabled=yes ];
2018-07-05 13:29:26 +00:00
} else={
/system/logging/set disabled=yes [ find where action=remote disabled=no ];
2018-07-05 13:29:26 +00:00
}