netwatch-syslog 511 Bytes
Newer Older
1
#!rsc
Christian Hesse's avatar
Christian Hesse committed
2
# RouterOS script: netwatch-syslog
Christian Hesse's avatar
Christian Hesse committed
3
# Copyright (c) 2013-2019 Christian Hesse <mail@eworm.de>
Christian Hesse's avatar
Christian Hesse committed
4
#
5 6
# requires: dont-require-permissions=yes
#
Christian Hesse's avatar
Christian Hesse committed
7 8
# manage remote logging facilities

9
:local Remote [ /system logging action get ([ find where target=remote ]->0) remote ];
Christian Hesse's avatar
Christian Hesse committed
10

11
if ([ / tool netwatch get [ find where host=$Remote ] status ] = "up") do={
Christian Hesse's avatar
Christian Hesse committed
12 13 14 15
  / system logging set disabled=no [ find where action=remote disabled=yes ];
} else={
  / system logging set disabled=yes [ find where action=remote disabled=no ];
}