mirror of
https://github.com/eworm-de/routeros-scripts.git
synced 2026-04-16 18:19:36 +00:00
check-health: early exit with :exit
This commit is contained in:
parent
7e8d8ef108
commit
2d362f7a52
5 changed files with 8 additions and 11 deletions
|
|
@ -3,7 +3,7 @@
|
|||
# Copyright (c) 2019-2026 Christian Hesse <mail@eworm.de>
|
||||
# https://rsc.eworm.de/COPYING.md
|
||||
#
|
||||
# requires RouterOS, version=7.19
|
||||
# requires RouterOS, version=7.22
|
||||
#
|
||||
# check for RouterOS health state - state plugin
|
||||
# https://rsc.eworm.de/doc/check-health.md
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
# Copyright (c) 2019-2026 Christian Hesse <mail@eworm.de>
|
||||
# https://rsc.eworm.de/COPYING.md
|
||||
#
|
||||
# requires RouterOS, version=7.19
|
||||
# requires RouterOS, version=7.22
|
||||
#
|
||||
# check for RouterOS health state - temperature plugin
|
||||
# https://rsc.eworm.de/doc/check-health.md
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
# Copyright (c) 2019-2026 Christian Hesse <mail@eworm.de>
|
||||
# https://rsc.eworm.de/COPYING.md
|
||||
#
|
||||
# requires RouterOS, version=7.19
|
||||
# requires RouterOS, version=7.22
|
||||
#
|
||||
# check for RouterOS health state - voltage plugin
|
||||
# https://rsc.eworm.de/doc/check-health.md
|
||||
|
|
|
|||
|
|
@ -3,12 +3,11 @@
|
|||
# Copyright (c) 2019-2026 Christian Hesse <mail@eworm.de>
|
||||
# https://rsc.eworm.de/COPYING.md
|
||||
#
|
||||
# requires RouterOS, version=7.19
|
||||
# requires RouterOS, version=7.22
|
||||
#
|
||||
# check for RouterOS health state
|
||||
# https://rsc.eworm.de/doc/check-health.md
|
||||
|
||||
:local ExitOK false;
|
||||
:onerror Err {
|
||||
:global GlobalConfigReady; :global GlobalFunctionsReady;
|
||||
:retry { :if ($GlobalConfigReady != true || $GlobalFunctionsReady != true) \
|
||||
|
|
@ -37,8 +36,7 @@
|
|||
}
|
||||
|
||||
:if ([ $ScriptLock $ScriptName ] = false) do={
|
||||
:set ExitOK true;
|
||||
:error false;
|
||||
:exit;
|
||||
}
|
||||
|
||||
:local Resource [ /system/resource/get ];
|
||||
|
|
@ -77,8 +75,7 @@
|
|||
:local Plugins [ /system/script/find where name~"^check-health\\.d/." ];
|
||||
:if ([ :len $Plugins ] = 0) do={
|
||||
$LogPrint debug $ScriptName ("No plugins installed.");
|
||||
:set ExitOK true;
|
||||
:error true;
|
||||
:exit;
|
||||
}
|
||||
|
||||
:global CheckHealthPlugins ({});
|
||||
|
|
@ -106,5 +103,5 @@
|
|||
|
||||
:set CheckHealthPlugins;
|
||||
} do={
|
||||
:global ExitError; $ExitError $ExitOK [ :jobname ] $Err;
|
||||
:global ExitOnError; $ExitOnError [ :jobname ] $Err;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ Notify about health state
|
|||
[](https://github.com/eworm-de/routeros-scripts/stargazers)
|
||||
[](https://github.com/eworm-de/routeros-scripts/network)
|
||||
[](https://github.com/eworm-de/routeros-scripts/watchers)
|
||||
[](https://mikrotik.com/download/changelogs/)
|
||||
[](https://mikrotik.com/download/changelogs/)
|
||||
[](https://t.me/routeros_scripts)
|
||||
[](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=A4ZXBD6YS2W8J)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue