Page 1 of 1 1
Topic Options
#208619 - 2014-02-25 04:46 PM @ipaddress macros are cached, not a real information source
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
if I start a script and unplug the network cord or leave my script running for days, ipaddress-macros become useless.

 Code:
do
 ? @ipaddress0 '|' @ipaddress1 '|' @ipaddress2 '|' @ipaddress3 ' ' 
 sleep 10
until 1>2


in my mind this information should not be cached as once the information is queried, it is already old and might have changed.
_________________________
!

download KiXnet

Top
#208620 - 2014-02-25 05:06 PM Re: @ipaddress macros are cached, not a real information source [Re: Lonkero]
Ruud van Velsen Moderator Offline
Developer
*****

Registered: 1999-05-06
Posts: 391
Loc: Amsterdam, The Netherlands
Indeed, IP information is retrieved only once during the lifetime of the KIX32 process.

I'll have a look at providing an option to have these macros be determined dynamically.

Good find/suggestion, thanks!

Ruud

Top
#208621 - 2014-02-25 05:48 PM Re: @ipaddress macros are cached, not a real information source [Re: Ruud van Velsen]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
Thanks Ruud.
_________________________
!

download KiXnet

Top
#209509 - 2014-10-12 09:21 PM Re: @ipaddress macros are cached, not a real information source [Re: Lonkero]
Patrick20 Offline
Fresh Scripter

Registered: 2009-08-27
Posts: 22
Loc: Belgium
Hello Ruud,

Any update concerning the IP information that is only retrieved once during the lifetime of the kix32 proces, I use this very often and should realy help me when we can do this more then once.

Many thanks/Patrick

Top
#209510 - 2014-10-12 09:30 PM Re: @ipaddress macros are cached, not a real information source [Re: Patrick20]
Allen Administrator Offline
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4562
Loc: USA
If you care to use a UDF, this will get the info for you.

GetIPOptions() -
http://www.kixtart.org/forums/ubbthreads.php?ubb=showflat&Number=159170#Post159170

How to use UDFs -
http://www.kixtart.org/forums/ubbthreads.php?ubb=showflat&Number=81943#Post81943

The rest of the UDFs are here -
http://www.kixtart.org/forums/ubbthreads.php?ubb=postlist&Board=7&page=1

Top
#209513 - 2014-10-13 08:12 PM Re: @ipaddress macros are cached, not a real information source [Re: Allen]
Patrick20 Offline
Fresh Scripter

Registered: 2009-08-27
Posts: 22
Loc: Belgium
Allen,
I tested this but couldn't manage it to read 3 NIC cards from my testcomputer , all are connected on different networks. I used your scripts , only the last network card is just showning up.

Top
#209514 - 2014-10-13 09:31 PM Re: @ipaddress macros are cached, not a real information source [Re: Patrick20]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4401
Loc: New Jersey
Are you specifying the MAC addresses?

As an alternative, NICInfo() will return an array of arrays of all adapters in the system. See the Kix Lib section of my web site for the latest version of the UDF.

Glenn
_________________________
Actually I am a Rocket Scientist! \:D

Top
#209515 - 2014-10-14 02:21 AM Re: @ipaddress macros are cached, not a real information source [Re: Glenn Barnas]
Allen Administrator Offline
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4562
Loc: USA
Yes as Glenn mentions... you have to provide the MAC address. The second example in the header does this very thing, although you will have to download the EnumNetworkConnections UDF as well.
Top
#209516 - 2014-10-14 07:43 AM Re: @ipaddress macros are cached, not a real information source [Re: Allen]
Patrick20 Offline
Fresh Scripter

Registered: 2009-08-27
Posts: 22
Loc: Belgium
Glenn , when I try to reach your website :[Win32Exception (0x80004005): The network path was not found]
Top
#209517 - 2014-10-14 01:25 PM Re: @ipaddress macros are cached, not a real information source [Re: Patrick20]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
Whoops.

What's with that debugging information being exposed like that?


Edited by Lonkero (2014-10-14 01:26 PM)
_________________________
!

download KiXnet

Top
#209518 - 2014-10-14 01:46 PM Re: @ipaddress macros are cached, not a real information source [Re: Lonkero]
Allen Administrator Offline
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4562
Loc: USA
 Code:
; Requires EnumNetworkConnections() - http://www.kixtart.org/ubbthreads/showflat.php?Cat=0&Number=138769&an=0&page=0#138769 
;  
break on  
$remotepc=""  
for each $nc in Enumnetworkconnections(3,$remotepc)  
    $ConnectionName=split($nc,",")[0]  
    $MACAddress=split($nc,",")[1]  
    $AdapterName=split($nc,",")[2]  
    ? "    Connection Name:  " + $connectionname  
    ? "         MACAddress:  " + $MACAddress  
    ? "       Adapter Name:  " + $AdapterName  
    ? "        Mac Address:  " + getipoptions("Macaddress",$remotepc,$macaddress)  
    ? "     Static Address:  " + getipoptions("StaticIP",$remotepc,$macaddress)  
    ? "       DHCP Enabled:  " + getipoptions("DHCPEnabled",$remotepc,$macaddress)  
    ? "       IPaddress/SM:  " + getipoptions("IPAddress",$remotepc,$macaddress)  
    ? "      IPaddress0/SM:  " + getipoptions("IPAddress0",$remotepc,$macaddress)  
    ? "      IPaddress1/SM:  " + getipoptions("IPAddress1",$remotepc,$macaddress)  
    ? "      IPaddress2/SM:  " + getipoptions("IPAddress2",$remotepc,$macaddress)  
    ? "      IPaddress3/SM:  " + getipoptions("IPAddress3",$remotepc,$macaddress)  
    ? "          DefaultGW:  " + getipoptions("DefaultGW",$remotepc,$macaddress)  
    ? "        DNS Servers:  " + getipoptions("DNSServers",$remotepc,$macaddress)  
    ? "       WINS Servers:  " + getipoptions("WINSServers",$remotepc,$macaddress)  
    ? "          DNSSuffix:  " + getipoptions("DNSDomain",$remotepc,$macaddress)  
    ? "   DNS Search Order:  " + setipoptions("DNSDomainSuffixSearchOrder",$remotepc,$macaddress)  
    ? "        DHCP Server:  " + getipoptions("DHCPServer",$remotepc,$macaddress)  
    ? "DHCP Lease Obtained:  " + getipoptions("DHCPLeaseObtained",$remotepc,$macaddress)  
    ? " DHCP Lease Expires:  " + getipoptions("DHCPLeaseExpires",$remotepc,$macaddress)  
    ? "---------------"  
next  

Top
#209519 - 2014-10-14 05:23 PM Re: @ipaddress macros are cached, not a real information source [Re: Patrick20]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4401
Loc: New Jersey
OUTCH! The SQL Server service didn't restart after patching. We're back online.

Glenn
_________________________
Actually I am a Rocket Scientist! \:D

Top
#209595 - 2014-10-29 07:03 PM Re: @ipaddress macros are cached, not a real information source [Re: Glenn Barnas]
Witto Offline
MM club member
*****

Registered: 2004-09-29
Posts: 1828
Loc: Belgium
As a workaround, I think the native KiXtart function EnumIPInfo() can also do the trick:
 Code:
Dim $n
$n = 0
While Not @ERROR
	? EnumIPInfo($n, 0, 1)
	$n = $n + 1
Loop

If the third parameter, mode, is set to 1, the current IP information is retrieved from the system.

Top
Page 1 of 1 1


Moderator:  ShaneEP, Arend_, Jochen, Radimus, Glenn Barnas, Allen, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 360 anonymous users online.
Newest Members
M_Moore, BeeEm, min_seow, Audio, Hoschi
17883 Registered Users

Generated in 0.067 seconds in which 0.026 seconds were spent on a total of 13 queries. Zlib compression enabled.