Page 1 of 1 1
Topic Options
#61688 - 2001-12-27 07:59 PM Obtaining subnet info with little impact
evanwiley Offline
Fresh Scripter

Registered: 2001-12-12
Posts: 7
Loc: Vancouver, BC
Our logon script is growing and I wish to limit the impact and time it takes to process the script.

Could someone help me with a script that subroutine that would cause very little impact to the user. OS Levels involved are WIN9x and Win NT 4 soon to be XP.

I need the script to determine the third IP Segment and in some cases the third and fourth 192.168.XXX.XXX. I need the script to determine the segment and based on that segment (or PC Location Run and Associcated task). 90% of them only need to look at the third segment.

My Idea is to determine that segment and the script would GOSUB to that segement and run that task. There will be 219 segement for the scipt to process, Note on segement 58 I need to process the third and fourth. If the fourth is greater and segment listes but less that the next on....etc.

I had a tought that on the 58 segement to have to goto's one for the third then send them to a second.....

Any Ideas


Thanks


Sample of segements GOTO code:
:1
$site = BC Gas Center TOKEN RING 1 ..10th floor
:2
$site = BC Gas Center TOKEN RING 2
:3
$site = BC Gas Center TOKEN RING 3.. 9th floor
:4
$site = Gas Centre. SUPERSCOPE All Floors
:5
$site = BC Gas Center TOKEN RING 5.. 2nd floor
:6
$site = BC Gas Center TOKEN RING 6.. 3rd floor
:7
$site = BC Gas Center TOKEN RING 7.. 8th Floor BCGASPDC
:9
$site = BC Gas Center TOKEN RING 9.. 8th Floor Fridge EMS
:10
$site = Gas Centre. SUPERSCOPE All Floors
:11
$site = BC Gas Center E3
:12
$site = BC Gas Clearbrook TOKEN RING 0
:58
$site = BC Gas Roebuck (Surrey field centre
:58.32
$site = BC Gas .Sunnyside (Surrey field centre
:58.64
$site = BC Gas .Langley field centre
:58.96
$site = BC Gas .Albion field centre
:58.128
$site = BC Gas .Abbotsford field centre
:58.160
$site = BC Gas .Chilliwack field centre
58.192
$site = BC Gas .Richmond field centre
:58.224
$site = BC Gas .Coquitlam field centre
:59
$site = BC Gas .North Vancouver field centre
:61
$site = BC Gas .11 thl24th floor Gas center TOKEN RING
:63
$site = BC Gas Centre TOKEN RING 212

_________________________
--- Evan R. Wiley evan.wiley@telus.com

Top
#61689 - 2001-12-27 08:47 PM Re: Obtaining subnet info with little impact
Bryce Offline
KiX Supporter
*****

Registered: 2000-02-29
Posts: 3167
Loc: Houston TX
if all fo these are seperate subnets, there a couple of UDF's to id if a computer is a member of a subnet ot not.

the UDF's are

SubNET()
you will also need BinaryIP()


an example of using these udf's

code:

select
case subnet("@ipaddress0","192.168.1.0","255.255.255.0") = 1
$site = "BC Gas Center TOKEN RING 1 ..10th floor"

case subnet("@ipaddress0","192.168.2.0","255.255.255.0") = 1
$site = "BC Gas Center TOKEN RING 2"

case subnet("@ipaddress0","192.168.3.0","255.255.255.0") = 1
$site = "BC Gas Center TOKEN RING 3.. 9th floor"

;and so on......
endselect


if you need more help just ask

Top
Page 1 of 1 1


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

Who's Online
1 registered (Allen) and 271 anonymous users online.
Newest Members
Sir_Barrington, batdk82, StuTheCoder, M_Moore, BeeEm
17886 Registered Users

Generated in 0.184 seconds in which 0.1 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