From e1f134ead584c7b2e9ed406f5520d7f1a23294aa Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Thu, 5 Jul 2018 15:29:26 +0200 Subject: add scripts --- netwatch-syslog | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 netwatch-syslog (limited to 'netwatch-syslog') diff --git a/netwatch-syslog b/netwatch-syslog new file mode 100644 index 0000000..56e59ea --- /dev/null +++ b/netwatch-syslog @@ -0,0 +1,14 @@ +# RouterOS script: netwatch-syslog +# Copyright (c) 2013-2018 Christian Hesse +# +# manage remote logging facilities + +:local remote [ /system logging action get [ :pick [ find where target=remote ] 0 ] remote ]; + +if ([ / tool netwatch get [ find where host=$remote ] status ] = "up") do={ + / system logging set disabled=no [ find where action=remote disabled=yes ]; +} else={ + / system logging set disabled=yes [ find where action=remote disabled=no ]; +} + +/ system scheduler set disabled=yes [ find where name=netwatch-syslog disabled=no ]; -- cgit v1.2.3-70-g09d2