From 260dc3f1b2d0c2634c56c33f7402be9b8faeb8e5 Mon Sep 17 00:00:00 2001 From: Grzegorz Budny Date: Thu, 11 Jul 2019 11:37:30 +0200 Subject: [PATCH] Initial Commit. Script draft created --- RouterOS_Log_To_Alert.rsc | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/RouterOS_Log_To_Alert.rsc b/RouterOS_Log_To_Alert.rsc index 06ca031..b362237 100644 --- a/RouterOS_Log_To_Alert.rsc +++ b/RouterOS_Log_To_Alert.rsc @@ -15,6 +15,23 @@ tool e-mail send server=$smtpServer port=$smtpPort from=$from to=$to cc=$cc subj #Here script starts +:local message "telnet" +:local systemName [/system identity get value-name=name] +:local recipient +:local logCount [/log print count-only where message~$message] +:local logArray [/log find where message~$message] + +:toarray value=$logArray + +:if (logCount > 0) do={ + + :log warning "..::Alert detected:.."; + $SendEmail smtpServer="10.27.23.62" smtpPort=25 from=($systemName."@paccor.com") to=$recipient subject=($systemName." Triggered and Alert!") body=($logArray->1) + :log info ("..::Alert has been sent to ".$recipient) + +} + +