- . HTTP/HTTPS - HTML , FTP , GET/POST , - .
MikroTik Fetch, .
Fetch HTTP FTP , , (web-, ). HTTPS , , , . check-certificate.
Fetch, :
/tool fetch
, , , .
:
- address - IP , ;
- ascii - ASCII ( - no);
- check-certificate - ;
- dst-path - , ;
- host - , . - shareit.merionet.ru;
- http-method - HTTP . : get, post, put, delete. get;
- http-data - , , put post;
- http-content-type - , MIME. - application/x-www-form-urlencoded;
- keep-result - , ;
- mode - , . http, https, ftp tftp;
- password - . ( );
- port - , ;
- src-path - , ;
- upload - , fetch . , src-path dst-path ;
- url - URL . address src-path;
- user - , ( );
use , fetch.
:
/tool fetch address=www.squidblacklist.org host=www.squidblacklist.org mode=http src-path=/downloads/drop.malicious.rsc
, www.squidblacklist.org http /downloads/drop.malicious.rsc
, FTP , , :
/tool fetch address=192.168.11.48 src-path=conf.rsc \ user=admin mode=ftp password=samplepass dst-path=sample.rsc port=21 \ host="" keep-result=yes
URL, :
/tool fetch url="https://wiki.merionet.ru/rukovodstvo-administratora-freepbx-na-russkom-yazyke/Rukovodstvo_Administratora_FreePBX_na_russkom_yazyke.pdf" mode=http
FTP, 192.168.11.56, :
/tool> fetch address=192.168.11.56 src-path=cnfig.rsc \ user=admin mode=ftp password=samplepass dst-path=backup.rsc upload=yes
fetch , HTTP . , , POST json :
/tool fetch http-method=post http-content-type="application/json" http-data="{ "as": "AS16509 Amazon.com, Inc.", "city": "Boardman", "country": "United States", "countryCode": "US", "isp": "Amazon", "lat": 45.8696, "lon": -119.688, "org": "Amazon", "query": "54.148.84.95", "region": "OR", "regionName": "Oregon", "status": "success", "timezone": "America\/Los_Angeles", "zip": "97818" }" url="http://locator.loc/index.php"
RouterOS v6.43, fetch . , , , - , HTTP .
, , SERVICE FAILED, PHP (check.php) 0 SERVICE RUNNING, .
{ :local result [/tool fetch url=http://192.168.11.56/check.php as-value output=user]; :if ($result->"status" = "finished") do={ :if ($result->"data" = "0") do={ /tool e-mail send to="mnadmin@mndomain.ru" subject="$[/system identity get name] export" \ body="$[/system clock get date] SERVICE FAILED; } else={ /tool e-mail send to="mnadmin@mndomain.ru" subject="$[/system identity get name] export" \ body="$[/system clock get date] SERVICE RUNNING; } } }
, - tool e-mail> set server=192.168.1.34 set port=25 from=mnmikrotik@mndomain.ru
, WinBox fetch. , , Scripts. , , :