Page 1 of 1 1
Topic Options
#153476 - 2005-12-15 02:15 PM Different locations.
JoosTy Offline
Fresh Scripter

Registered: 2005-11-21
Posts: 11
Hi All..

I have a question. Our company has different locations. Each have differents network drivers. How can I Locate a location?

Exemple:

If @IPADDRESS0 > "192.199. 1. "

Other location:


If @IPADDRESS0 > "192.199. 2. "

But its not working

Greets JoosTy

Top
#153477 - 2005-12-15 02:19 PM Re: Different locations.
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL

Code:

$nic=0
:nicloop
$mygw=enumipinfo($nic,3) $ip=enumipinfo($nic,0)
select ; determine physical location of computer
Case $mygw="192.168.101.1" $Location="01" $city="Pensacola"
Case $mygw="192.168.102.1" $Location="02" $city="Panama City"
Case $mygw="192.168.103.1" $Location="03" $city="Alachua"
Case $mygw="192.168.113.1" $Location="03" $city="Ocala"
Case $mygw="192.168.104.1" $Location="04" $city="Jacksonville"
...
Case $mygw=$ip $Location="VPN" $city="TLH"
Case @ras $Location="RAS" $city="TLH"
Case 1 $Location="00" $city=""
endselect
if $Location = "00" and val($nic) < 10
$nic=val($nic)+1
goto nicloop
endif

_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#153478 - 2005-12-15 02:24 PM Re: Different locations.
JoosTy Offline
Fresh Scripter

Registered: 2005-11-21
Posts: 11
Thanx for the fast reply!

But can you explane how it works.. Im just a starter. on each location are just like 50 computer. so 50 ipadresses.. Is that not a problem?

Top
#153479 - 2005-12-15 02:44 PM Re: Different locations.
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
use the gateway not the IP
_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#153480 - 2005-12-15 03:06 PM Re: Different locations.
JoosTy Offline
Fresh Scripter

Registered: 2005-11-21
Posts: 11
oo oke, But, How can I give a city a function.

Just like this ?:

Code:
If $Location = "01"



Or?

Top
#153481 - 2005-12-15 03:14 PM Re: Different locations.
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
yes, or call the function from in the select case
Case $mygw="192.168.101.1" MyFunct01()
Case $mygw="192.168.102.1" MyFunct02()
_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#153482 - 2005-12-15 04:12 PM Re: Different locations.
JoosTy Offline
Fresh Scripter

Registered: 2005-11-21
Posts: 11
Thanx!. it works..
Top
Page 1 of 1 1


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

Who's Online
0 registered and 519 anonymous users online.
Newest Members
batdk82, StuTheCoder, M_Moore, BeeEm, min_seow
17885 Registered Users

Generated in 0.058 seconds in which 0.027 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org