Forum Tiny Control Solution
Lan Controller and Mikrotik Router Board ! - Wersja do druku

+- Forum Tiny Control Solution (https://forum.tinycontrol.pl)
+-- Dział: LanKontroler - sprzęt i wersje wsadów, problemy, zastosowanie (https://forum.tinycontrol.pl/forumdisplay.php?fid=3)
+--- Dział: LanKontroler - wersje oprogramowania (https://forum.tinycontrol.pl/forumdisplay.php?fid=4)
+---- Dział: Przykłady zastosowań przez użytkowników. (https://forum.tinycontrol.pl/forumdisplay.php?fid=6)
+---- Wątek: Lan Controller and Mikrotik Router Board ! (/showthread.php?tid=72)



Lan Controller and Mikrotik Router Board ! - bulentkusva - 08-25-2012

http://192.168.1.100/outs.cgi?out0=0
Or
MikroTik SNMP commands can I use with the script?

MikroTik script can not run this command
run possible?
Lan contoller , using MikroTik script will be very flexible programming power !
This issue can you help?


Re: Lan Controller and Mikrotik Router Board ! - wilkxt - 08-28-2012

Look at this http://wiki.mikrotik.com/wiki/Manual:SNMP#Run_Script


Re: Lan Controller and Mikrotik Router Board ! - bulentkusva - 08-28-2012

Thanks
I found a script in this way

/tool fetch url="http://192.168.1.100/outs.cgi?out0=0" mode=http
or
/tool fetch url="http://192.168.1.100/outs.cgi?out0=1" mode=http
-------------------------

:local date [/system clock get date]
:local sonuc ""
:local months [:toarray "jan,feb,mar,apr,may,jun,jul,aug,sep,oct,nov,dec"]
:local monthtbl [:toarray "0,3,3,6,1,4,6,2,5,0,3,5"]
:local daytbl [:toarray "sun,mon,tue,wed,thu,fri,sat"]

:local month [:pick $date 0 3]
:local day [:pick $date 4 6]
:local dayc [:pick $date 5 6]
:local century [:pick $date 7 9]
:local year [:pick $date 9 11]
:local yearc [:pick $date 10 11]

:if ([:pick $date 4 5] = 0) do={ Confusedet day ($dayc)}
:if ([:pick $date 9 10] = 0) do=[Confusedet year ($yearc)]

:local sum 0
Confusedet sum ($sum + (2 * (3 - ($century - (($century / 4) * 4)))))
Confusedet sum ($sum + ($year / 4))
Confusedet sum ($sum + $year + $day)
:for mindex from=0 to=[:len $months] do={
:if ([:pick $months $mindex] = $month) do={Confusedet sum ($sum + [:pick $monthtbl $mindex]) }
}
Confusedet sum ($sum - (($sum / 7) * 7))
Confusedet sonuc [:pick $daytbl $sum]

# gun hesaplama tamam

#:put ([:pick $date 0 3] . "/" . [:pick $date 4 6] . "/" . [:pick $date 7 9] . [:pick $date 9 11] . " is on a " . $sonuc)
:put $sonuc

{
:if ($sonuc = "sat") do={
# gun dogruysa
put "deger dogru"

} else={
# gun yanlis sa
/tool fetch url="http://192.168.1.100/outs.cgi?out0=1" mode=http
put "deger yanlis"

}
}