aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2019-04-03 21:30:43 +0200
committerGravatar Christian Hesse <mail@eworm.de>2019-04-03 21:30:43 +0200
commitb35c0b8a6f6373201cc9e252a8647935ad54ee19 (patch)
tree3a0f435d99f4f6772871ae00077a5554e8170839
parent27b2fffaaf2529759795b031acea9c8e6980a4ac (diff)
always write warnings and errors to log
-rw-r--r--check-certificates1
-rw-r--r--check-routeros-update6
-rw-r--r--collect-wireless-mac.capsman3
-rw-r--r--collect-wireless-mac.local3
-rw-r--r--collect-wireless-mac.template3
-rw-r--r--daily-psk-schedule6
-rw-r--r--email-backup3
-rw-r--r--packages-update6
-rw-r--r--sms-forward3
-rw-r--r--update-tunnelbroker3
10 files changed, 25 insertions, 12 deletions
diff --git a/check-certificates b/check-certificates
index 4c10a52..8315d15 100644
--- a/check-certificates
+++ b/check-certificates
@@ -30,6 +30,7 @@
:do {
:if ([ :len $CertRenewUrl ] = 0) do={
+ :log info "No CertRenewUrl given.";
:error "No CertRenewUrl given.";
}
diff --git a/check-routeros-update b/check-routeros-update
index ba420da..4d1cf8f 100644
--- a/check-routeros-update
+++ b/check-routeros-update
@@ -22,7 +22,8 @@
:if ([ / system package print count-only where name="wireless" disabled=no ] > 0) do={
:if ([ / interface wireless cap get enabled ] = true && \
[ / caps-man manager get enabled ] = false) do={
- :error "System is managed by CAPsMAN, not checking.";
+ :log warning "System is managed by CAPsMAN, not checking.";
+ :error "Warning: See log for details.";
}
}
@@ -64,8 +65,9 @@
}
:if ($SentRouterosUpdateNotification = $LatestVersion) do={
- :error ("Already sent the RouterOS update notification for version " . \
+ :log info ("Already sent the RouterOS update notification for version " . \
$LatestVersion . ".");
+ :error "Already sent notification.";
}
$SendNotification ("RouterOS update notification") \
diff --git a/collect-wireless-mac.capsman b/collect-wireless-mac.capsman
index 4e5a7b0..dd27ba6 100644
--- a/collect-wireless-mac.capsman
+++ b/collect-wireless-mac.capsman
@@ -16,7 +16,8 @@ $ScriptLock "collect-wireless-mac.capsman";
:local PlaceBefore [ / caps-man access-list find where comment="--- collected above ---" disabled ];
:if ([ :len $PlaceBefore ] = 0) do={
- :error "Missing disabled access-list entry with comment '--- collected above ---'";
+ :log error "Missing disabled access-list entry with comment '--- collected above ---'";
+ :error "Error: See log for details.";
}
:foreach RegTbl in=[ / caps-man registration-table find ] do={
diff --git a/collect-wireless-mac.local b/collect-wireless-mac.local
index 4a4d6e1..a28e2ee 100644
--- a/collect-wireless-mac.local
+++ b/collect-wireless-mac.local
@@ -16,7 +16,8 @@ $ScriptLock "collect-wireless-mac.local";
:local PlaceBefore [ / interface wireless access-list find where comment="--- collected above ---" disabled ];
:if ([ :len $PlaceBefore ] = 0) do={
- :error "Missing disabled access-list entry with comment '--- collected above ---'";
+ :log error "Missing disabled access-list entry with comment '--- collected above ---'";
+ :error "Error: See log for details.";
}
:foreach RegTbl in=[ / interface wireless registration-table find ] do={
diff --git a/collect-wireless-mac.template b/collect-wireless-mac.template
index 2449316..9e06a88 100644
--- a/collect-wireless-mac.template
+++ b/collect-wireless-mac.template
@@ -17,7 +17,8 @@ $ScriptLock "collect-wireless-mac%TEMPL%";
:local PlaceBefore [ / %PATH% access-list find where comment="--- collected above ---" disabled ];
:if ([ :len $PlaceBefore ] = 0) do={
- :error "Missing disabled access-list entry with comment '--- collected above ---'";
+ :log error "Missing disabled access-list entry with comment '--- collected above ---'";
+ :error "Error: See log for details.";
}
:foreach RegTbl in=[ / %PATH% registration-table find ] do={
diff --git a/daily-psk-schedule b/daily-psk-schedule
index 2a01bae..bad21a5 100644
--- a/daily-psk-schedule
+++ b/daily-psk-schedule
@@ -10,11 +10,13 @@
/ system scheduler set interval=15s $Scheduler;
} else={
:if ([ / tool netwatch get [ find where comment=[ / tool e-mail get address ] ] status ] != "up") do={
- :error "Mail server is not up.";
+ :log warning "Mail server is not up.";
+ :error "Warning: See log for details.";
}
:if ([ / system ntp client get status ] != "synchronized") do={
- :error "Time is not yet synchronized from ntp.";
+ :log warning "Time is not yet synchronized from ntp.";
+ :error "Warning: See log for details.";
}
/ system script run [ find where name~"daily-psk\\.(capsman|local)" ];
diff --git a/email-backup b/email-backup
index 63e2fbe..e8f8f2b 100644
--- a/email-backup
+++ b/email-backup
@@ -16,7 +16,8 @@
:if ($BackupSendBinary != true && \
$BackupSendExport != true && \
$BackupCloud != true) do={
- :error ("Configured to send neither backup nor config export.");
+ :log error ("Configured to send neither backup nor config export.");
+ :error "Error: See log for details.";
}
# filename based on identity
diff --git a/packages-update b/packages-update
index 683e9f8..10b4a45 100644
--- a/packages-update
+++ b/packages-update
@@ -10,13 +10,15 @@
:local LatestVersion [ / system package update get latest-version ];
:if ($InstalledVersion = $LatestVersion) do={
- :error ("Version " . $LatestVersion . " is already installed.");
+ :log info ("Version " . $LatestVersion . " is already installed.");
+ :error "No updates available.";
}
:foreach Package in=[ / system package find where !bundle ] do={
:local PkgName [ / system package get $Package name ];
if ([ $DownloadPackage $PkgName $LatestVersion ] = false) do={
- :error ("Download for package " . $PkgName . " failed.");
+ :log error ("Download for package " . $PkgName . " failed.");
+ :error "Error: See log for details.";
}
}
diff --git a/sms-forward b/sms-forward
index f22949f..9850d87 100644
--- a/sms-forward
+++ b/sms-forward
@@ -10,7 +10,8 @@
# check mail server
:if ([ / tool netwatch get [ find where comment=[ / tool e-mail get address ] ] status ] != "up") do={
- :error "Mail server is not up.";
+ :log warning "Mail server is not up.";
+ :error "Warning: See log for details.";
}
:local Allowed [ / tool sms get allowed-number ];
diff --git a/update-tunnelbroker b/update-tunnelbroker
index 0460028..4eff911 100644
--- a/update-tunnelbroker
+++ b/update-tunnelbroker
@@ -6,7 +6,8 @@
:global CertificateAvailable;
:if ([ / ip cloud get ddns-enabled ] != true) do={
- :error "IP cloud DDNS is not enabled.";
+ :log error "IP cloud DDNS is not enabled.";
+ :error "Error: See log for details.";
}
# Get the current ip address from cloud