Community discussions

MikroTik App
 
emailkerja
just joined
Topic Author
Posts: 1
Joined: Wed Oct 04, 2023 7:41 am

Netwatch Script fails to create the file

Wed Oct 04, 2023 7:50 am

I want to create a script in MikroTik to log downtime and then read it when the system is back up, followed by sending it to Telegram. However, the script fails to create the file properly when applied in Netwatch. Interestingly, when I try it in the terminal, everything works perfectly, and there are no issues.

Even the following command:
/file print file="test.txt"
Cannot be executed by MikroTik. I have tested it on v6.49 and plan to apply it to hAP Lite 941 with v6.48.6 and v6.47.10.

Is there anyone who can assist me?
 
nediis
Frequent Visitor
Frequent Visitor
Posts: 63
Joined: Wed Jul 11, 2018 10:32 am

Re: Netwatch Script fails to create the file

Wed Oct 04, 2023 2:32 pm

Warning: Since RouterOS v6.42 Netwatch is limited to read,write,test,reboot script policies. If the owner of the script does not have enough permissions to execute a certain command in the script, then the script will not be executed. If the script has greater policies than read,write,test,reboot, then the script will not be executed as well, make sure your scripts do not exceed the mentioned policies.

https://wiki.mikrotik.com/wiki/Manual:Tools/Netwatch

to write a file you need ftp policy

Who is online

Users browsing this forum: No registered users and 9 guests