#36757 - 2003-02-22 12:45 AM
Re: Monitor Connectivity on My Own Network ?
|
Richard H.
Administrator
   
Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
|
Final changes (hopefully)
code:
Break ON ; Set address list to all the hosts you want to monitor. $asAddressList="130.11.21.1","10.0.0.2","steed.sgb.co.uk" Dim $aiStatus[UBound($asAddressList)+1] $iInterval=60 ; Number of seconds between checks $sSound="c:\windows\media\chimes.wav" ; Path to sound to play While "true" $sMessage="" For $iIndex=0 To Ubound($asAddressList) $sAddress=$asAddressList[$iIndex] $iStatus=$aiStatus[$iIndex] If fnMonitorIP($sAddress) If $iStatus $sMessage=$sMessage+@TIME+" Address " + $sAddress + " is now unavailable." +@CRLF EndIf $aiStatus[$iIndex]=0 Else If $iStatus=0 $sMessage=$sMessage+@TIME+" Address " + $sAddress + " is responding." +@CRLF EndIf $aiStatus[$iIndex]=1 EndIf Next If $sMessage <> "" Play $sSound $sMessage $Null=MessageBox("$sMessage","Change in monitored station status",0,5) EndIf Sleep($iInterval) Loop Function fnMonitorIP($sAddress) Shell '%COMSPEC% /C ping -n 1 ' + $sAddress + ' >/dev/null' $fnMonitorIP=@ERROR Return EndFunction
This version works as before with the following changes:
- The message and sound are only displayed once for each workstation as it comes onto the network.
- An alert is displayed when a monitored workstation is removed from the network, and an alert will be subsequently displayed if it re-appears.
A history of the workstation connecting/disconnecting will be present on the console.
|
|
Top
|
|
|
|
#36761 - 2003-02-21 02:54 PM
Re: Monitor Connectivity on My Own Network ?
|
Austin
Seasoned Scripter
Registered: 2002-01-24
Posts: 439
|
Look into the UDF Ping()
May help you a bit. Still need to know a little more about how the computer is connecting to your network.
Thanks
_________________________
Austin Henderson
|
|
Top
|
|
|
|
#36763 - 2003-02-21 03:50 PM
Re: Monitor Connectivity on My Own Network ?
|
Richard H.
Administrator
   
Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
|
I was looking for a little more specific information than that
If you are using a modern BIND implementation with a modern DHCP server you should configure the DHCP server to update your DNS records by using DDNS (nsupdate) updates whenever an IP address is leased or released. If your clients are Win2K they can also be configured to register their names when they get a lease.
If the laptop PC is going to participate in WINS/NetBios and your DNS service is provided by NT you can configure it to use a sort of WINS passthrough, where the DNS service will use WINS for name resolution. Clunky and a bit crap but it works.
If the laptop is not going to register it's name in WINS or respond to NETBios broadcasts you are a bit stuffed.
If your DHCP servers are NT4.0 you can switch on logging. This will create log files in \winnt\system32\dhcp which record lease renewals ans assignments. You will need to parse this file looking for the relevant entries - here is a sample of the file:
code:
10,02/21/03,12:55:07,Assign,10.17.16.46,SGB-5938,0080640C96BC 11,02/21/03,12:56:53,Renew,10.17.20.21,SGB-07772,0000397100B9
As you can see, two machines (SGB-07772 and SGB-5938) have leased IP addresses, one a renewal and the other an assign.
There is also a DHCP query tool available in the NT resource kit which will dump the database.
If your DHCP servers are Cisco routers or Access serves or similar, you're on your own
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 664 anonymous users online.
|
|
|