Cek Squid Service di Mikrotik

/system clock manual
set dst-delta=+07:00 dst-end=”jan/01/1970 00:00:00″ dst-start=
“jan/01/1970 00:00:00″ time-zone=+07:00

/system ntp client
set enabled=yes mode=unicast primary-ntp=202.134.1.10 secondary-ntp=
152.118.24.8

/system scheduler
add comment=”” disabled=no interval=10s name=Check_Proxy on-event=PROXY
policy=reboot,read,write,policy,test,password,sniff,sensitive start-date=
jan/01/1970 start-time=00:00:00

[social_lock]

/system script
add name=Check-proxy policy=
ftp,reboot,read,write,policy,test,winbox,password,sniff,sensitive source=”
{r
n:local checkpage “test.txt”;r
n:local found “0” ;r
n:foreach i in=[/file find] do={r
n:local filename [/file get $i name];r
n:if ( $filename = $checkpage) do={ r
n:set found “1” ; r
n:log info “found”; r
n}r
n}r
n:log warning “$found”;r
n:if ( $found = “0” ) do={ r
n:log warning “Disable rule, service down”; r
n/ip fire nat dis 3 ; r
n/ip fire mang dis 14; r
n} else={ r
n:log info “Enable rule, service up”; r
n/ip fire nat en 3; r
n/ip fire mang en 14; r
n}r
n/file remove $checkpage;r
n}r
n”
add name=Download policy=
ftp,reboot,read,write,policy,test,winbox,password,sniff,sensitive source=”
{r
n/tool fetch url=”http://192.168.20.234/test.txt” mode=http port=3128r
n}”
add name=PROXY policy=
ftp,reboot,read,write,policy,test,winbox,password,sniff,sensitive source=”
{r
n/system script run Check-proxy;r
n:delay delay-time=2r
n/system script run Download r
n}r
n”

[/social_lock]

Semoga Bermanfaat.

You may also like...

Popular Posts

Leave a Reply

Your email address will not be published. Required fields are marked *