mirror of
https://github.com/wifinigel/MikrotikScripting.git
synced 2025-06-26 11:38:37 +02:00
update for v6/v7 support
This commit is contained in:
parent
4871e9432b
commit
b10b99bd87
120 changed files with 1479 additions and 22 deletions
|
@ -1,29 +0,0 @@
|
|||
# filename: ch10-03-bad-script.rsc
|
||||
#
|
||||
# A simple script to perform a series of tests on a
|
||||
# list of web sites.
|
||||
|
||||
# define list of websites to test
|
||||
:local WebSites {"mikrotik.com"; "www.google.com"; "twitter.com"};
|
||||
|
||||
# step through each website and perform various tests
|
||||
:foreach SiteName in=$WebSites do={
|
||||
|
||||
# try a DNS resolution of this site
|
||||
:local IpAddress [/resolve $SiteName];
|
||||
|
||||
# try pinging the IP address of this site
|
||||
:local PingResult [/ping $IpAddress count=3 ];
|
||||
|
||||
# try getting the web page of this site
|
||||
:local UrlFetch [/tool fetch url=("https://$SiteName") mode=https \
|
||||
http-method=get as-value keep-result=no];
|
||||
|
||||
# print out a summary report for this site
|
||||
:put "==========================================";
|
||||
:put ("Site: $SiteName");
|
||||
:put ("IP Address = $IpAddress");
|
||||
:put ("Ping success = $PingResult/3");
|
||||
:put ("Page d/load duration: " . $UrlFetch->"duration");
|
||||
:put "===========================================";
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue