Hello. I have this script, which runs fine when I copy/paste it into a terminal window, but doesn't seem to run when I click on the Run Script button in Winbox (the variables referenced are manually created global variables for testing).
:if ($RadIncReq>$RadIncReqLast) do={
/tool fetch mode=https url="https://hooks.slack.com/services/real-token-removed" http-method=post http-data="payload={\"attachments\":[{\"color\":\"#f54242\",\"pretext\":\"ALARM\",\"callback_id\":\"dude_alarm\",\"text\": \"ROUTER-BNG - Incoming RADIUS Requests are Incrementing\"}]}";
/log info "**** Incoming RADIUS Requests are Incrementing****";
}
When I copy/past the above in this exact form, I get the log entry and the message in Slack. When I click Run Script button, I get neither.
Here's the actual export:
/system script
add dont-require-permissions=no name=CheckRadIncRequests owner=admin policy=\
ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon source=":if (\$RadIncReq>\$RadIncReqLast) do={\r\
\n/tool fetch mode=https url=\"https://hooks.slack.com/services/real-token-removed\" http-method\
=post http-data=\"payload={\\\"attachments\\\":[{\\\"color\\\":\\\"#f54242\\\",\\\"pretext\\\":\\\"ALARM\\\",\\\"callback_\
id\\\":\\\"dude_alarm\\\",\\\"text\\\": \\\"ROUTER-BNG - Incoming RADIUS Requests are Incrementing\\\"}]}\";\r\
\n/log info \"**** Incoming RADIUS Requests are Incrementing****\";\r\
\n}"
Here's the actual environment:
/system script environment> print
# NAME VALUE
0 RadIncReq 9
1 RadIncReqLast 8
I'm sure I'm missing something simple, thanks in advanced!