Ошибка на mikrotik: Couldn’t start task: cannot open file: permission denied

У меня на Mikrotik всегда стоит netwatch, который проверяет, что сервера и шлюзы работают. Если что-то отваливается, то мне приходит сообщение. Это реализовано через fetch:

/tool fetch url=»http://_____.ru/____.php\?action=s&host=A&message=K-3_UP» mode=http

И все замечательно работало много лет. Но тут в логах я обратил внимание на ошибку:

Погуглив, обнаружилось, что теперь надо добавлять для скрипта netwatch в конец следующее: output=none и тогда netwatch начинает работать, как раньше.

Оригинальное описание проблемы тут. Я же приведу кусок с этой страницы:

I have the same issue with Netwatch — it stopped sending messages to telegram using fetch.
Asked the MikroTik help desk for advice and below is an answer from them:
_»Starting from RouterOS 7.13, to execute fetch requires ftp policy when you want to access (read, write files) and Netwach does not have such.
To fix this issue:
modify Netwatch, add additonal paramter “output=” with value that is not file;
create new script that dont-require-permissions and call this script from Netwatch.
https://help.mikrotik.com/docs/display/ROS/Netwatch
https://help.mikrotik.com/docs/display/ROS/Scripting#Scripting-Scriptrepository
Best regards»_
In my case adding at the end of the script “output=none” resolved the issue:
/tool fetch url=“https://api.telegram.org/botToken/sendMessage?chat_id=-ChatID&text=Device is DOWN” output=none

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *