Hallo ich habe ein kleines Script geschrieben, welches mir im Netzwerk die AccessPoints (Wlan) anpingen soll.
Damit will ich herausfinden welcher AP nicht mehr Online ist. Das Script soll dann den Standort des APs ausgeben, welcher nicht zu erreichen ist.
Bislang habe ich jeden AP einzelnd eingetragen. Dieses würde ich jetzt ganz gerne durch ein Array machen.
Im Array müsste also die IP stehen die Angepingt werden soll und der Standort müsste ausgegeben werden wenn der Ping nicht durchgeht.
[autoit]#include <GUIConstants.au3>
#include <Date.au3>
#include <GUIConstants.au3>
GUICreate("AP Messung",220,100, 100,200)
$progressbar1 = GUICtrlCreateProgress (10,10,200,20)
GUICtrlSetColor(-1,32250)
$button = GUICtrlCreateButton ("Start",75,70,70,20)
GUISetState ()
$Datum = (_DateTimeFormat( _NowCalc(),2))
$s = 0; progressbar-saveposition
$f = 0;
Ping("192.168.26.10", 100)
Ping("192.168.26.11", 100)
Ping("192.168.26.12", 100)
Ping("192.168.26.13", 100)
Ping("192.168.26.14", 100)
Ping("192.168.26.15", 100)
Ping("192.168.26.16", 100)
Ping("192.168.26.17", 100)
do
$msg = GUIGetMsg()
If $msg = $button Then
GUICtrlSetData ($button,"Stop")
For $i = $s To 0
$m = GUIGetMsg ()
If $m = $button Then
$s = $i;save the current bar-position to $s
ExitLoop
Else
$s=0
GUICtrlSetData ($progressbar1,$i)
FileRecycle ( "AP-Messung.txt" )
FileWrite("AP-Messung.txt", "Messung wurde gemacht am: " & $Datum & @CRLF)
$var = Ping("192.168.26.11", 999)
$s=0
GUICtrlSetData ($progressbar1,2.33)
$m = GUIGetMsg ()
GUISetState ()
If $var Then
FileWrite("AP-Messung.txt", "192.168.26.11 ist OK der Ping liegt bei:" & $VAR & @CRLF)
Else
FileWrite("AP-Messung.txt", "192.168.26.11 ist nicht erreichbar H9G1/2" & @CRLF)
$f = "192.168.26.11 ist nicht erreichbar Halle 9 Gang 1/2" & @CRLF
EndIf
$
EndIf
EndIf
Next
Exit
EndIf
until $msg = $GUI_EVENT_CLOSE