Page 1 of 1 1
Topic Options
#52407 - 2000-11-29 10:23 AM Oh my god!
Anonymous
Unregistered


Hi guys I have been given this new contract at work..to perform an audit on 160 servers...in the next 2 days!!!

With no sms or tivolli ...things are looking bleak...

has anyone very had this same problem.
I need wins dns (scopes) disk space !
All the normally asked question by managment.

Anyone got any ideas?
thanks

Top
#52408 - 2000-11-29 11:38 AM Re: Oh my god!
Anonymous
Unregistered


You are in trouble my friend. If the servers login to the same domain you can have a login script that every machine should create a report and append it to a network shared master file.

If not or if you need the information on demand and not only due to the servers login then you should triger it from rconsole, telnet or do not know what. You could even schedule the report.kix on every machine.

the report.kix is enough to produce a tab delimited line with the host info.

Top
#52409 - 2000-11-30 12:13 AM Re: Oh my god!
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
Hi pepafuqi,

man, that hurts , what ?
Ok, at least for the Diskspace :
You might want to use a variation of the snippet here : http://kixtart.org/board/Forum1/HTML/001417.html

Luck Jochen

_________________________



Top
#52410 - 2000-11-30 12:20 AM Re: Oh my god!
Anonymous
Unregistered


Welcome pepafuqi..,

Maybe this will help:

code:
 CLS BREAK ON
SHELL 'CMD /X/C "net view > @CURDIR\NeTvIeW.dat"'
SHELL 'CMD /X/C "sort < @CURDIR\NeTvIeW.dat > @CURDIR\AcTiVeWoRkStAtIoNs.dat"'
MD "@CURDIR\Dat"
DEL "@CURDIR\NeTvIeW.dat"
DEL "@CURDIR\Dat\*.dat"
$NULL=OPEN(1,"@CURDIR\AcTiVeWoRkStAtIoNs.dat")
$Check1=CHR(34)+"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters"+CHR(34)
$Check2=CHR(34)+"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\NetBT\Parameters"+CHR(34)
WHILE INSTR("$LINE1","\\")=0
$LINE1=READLINE(1)
LOOP
CLS
WHILE @ERROR=0 AND INSTR("$LINE1","\\")<>0
$WKSTA1=RTRIM(SUBSTR($LINE1,3,16))
? "Checking Workstation : "+$WKSTA1+" ProcesCode : "
SHELL 'CMD /X/C "reg query $Check1 \\$WKSTA1 > @CURDIR\dat\$WKSTA1.dat"'
SHELL 'CMD /X/C "reg query $Check2 \\$WKSTA1 >> @CURDIR\dat\$WKSTA1.dat"'
$LINE1=READLINE(1) " Done !!"
LOOP
GOTO End

:End
DEL "@CURDIR\AcTiVeWoRkStAtIoNs.dat"
$NULL=CLOSE(1)
$NULL=CLOSE(2)


The reg.exe is part of the NTResKit.
This the content os a <hostname>.dat file
code:
Connecting to remote machine \\<hostname>

Listing of [SYSTEM\CurrentControlSet\Services\Tcpip\Parameters]

EXPAND_SZ DataBasePath %SystemRoot%\System32\drivers\etc
REG_SZ Domain <somewher>.<inthe>.<world>.com
REG_SZ Hostname <hostname>
REG_SZ NameServer <IP Primary DNS> <IP Secondary DNS>
REG_DWORD ForwardBroadcasts 0
REG_DWORD IPEnableRouter 0
REG_SZ SearchList
REG_DWORD EnableSecurityFilters 0
[PersistentRoutes]
[Winsock]
Connecting to remote machine \\<hostname>

Listing of [SYSTEM\CurrentControlSet\Services\NetBT\Parameters]

REG_SZ NbProvider _tcp
REG_DWORD NameServerPort 137
REG_DWORD EnableLMHOSTS 1
REG_DWORD EnableProxy 0
REG_DWORD EnableDNS 0
REG_DWORD CacheTimeout 600000
REG_DWORD BcastNameQueryCount 3
REG_DWORD BcastQueryTimeout 750
REG_DWORD NameSrvQueryCount 3
REG_DWORD NameSrvQueryTimeout 1500
REG_DWORD Size/Small/Medium/Large 1
REG_DWORD SessionKeepAlive 3600000
REG_SZ ScopeID
REG_SZ TransportBindName \Device\



If you subsequencally open these files to search for certain keys you could get a lot of info.

Could you specify what you exactly need to audit.. maybe we could be more helpfull

------------------
To Be Of Service..,
Fabian.
-----------------Paranoia is reality on a finer scale-----------------

Top
#52411 - 2000-11-29 05:10 PM Re: Oh my god!
Anonymous
Unregistered


There are some other great utilities for this in the NT Resource kit.

REGREAD.EXE lets you look up regestry entries on remote computers.

Example:
REGREAD.EXE \\ltn3 SYSTEM\CurrentControlSet\Services
\Tcpip\Parameters hostname
Will return the just the information you are looking for in quotes.

"LTN3"

You should be able to find much of the information you are looking for in the registry, you just need to know where to look.


Also..

SRVINFO.EXE is great for getting HDD free space.

Example
SRVINFO.EXE -od \\ltn3

C$,NTFS,12971,2263,10708
D$,NTFS,17516,2799,14717
E$,NTFS,17516,65,17451


Tells you total, used and free space for drives.

You could run one script from your workstation against a list of servers and have it collect all the information and dump it into a .CSV file for use with Excel or something.

Later,
Mark Pearce

Top
#52412 - 2000-11-29 07:17 PM Re: Oh my god!
Anonymous
Unregistered


Hya Guys..,

Mark : Thanks for remindingme of the REGREAD and SRVINFO tools.. I didn't think of it..

Pepafuqi : I will try to code up something tomorrow morning..!!

------------------
To Be Of Service..,
Fabian.
-----------------Paranoia is reality on a finer scale-----------------

Top
#52413 - 2000-11-29 08:03 PM Re: Oh my god!
Anonymous
Unregistered


Question about my last post..

Why can't we just use the remote registry features built into Kixtart instead of the REGREAD?

READVALUE will read a remote registry if you give it a path name.

(E.G.)
$x=ReadValue("\\ltn4\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion","CSDVersion")

Will tell me the current Service pack on my server LTN4.

Just a thought.
Mark P.

Top
#52414 - 2000-11-29 08:15 PM Re: Oh my god!
Anonymous
Unregistered


Thanks guys for the amazing response ..I have been off coding throught the night..getting ready for this monster..

I the posts have been amazing.Fabian YOU the King!

Top
#52415 - 2000-11-29 09:54 PM Re: Oh my god!
Anonymous
Unregistered


Well back in the office today.
I would like to thank all for there help><

I need some how a way to generate a full invintorty. like dhcp scopes and wins server settings..
network card model...the list just gets better..

mybe we could write crazy full blown kix util that could end up as the administrators tool of tools (when working for a cheap as comapny like mine!!)

Top
#52416 - 2000-11-29 11:52 PM Re: Oh my god!
Anonymous
Unregistered


Here is a simple example of what could be done.

Needs lots more registry entries. If anyone that knows a useful registry location, please post it. I'm sure the IP address and NIC information is in the registry somewhere.


NOTE: I put the files in c:\kixtart because I couldn't get the SHELL 'CMD /X /C $UtilDir\srvinfo.exe -od \\$ServerName > $TempFile' line to work with a directory that had spaces. Maybe someone can fix it.


Test.kix

code:

CLS BREAK ON

$UtilDir = "C:\Kixtart"
$ServerList = "$UtilDir\ServerList.txt"
$TempFile = "$UtilDir\Temp.txt"
$OutputFile = "$UtilDir\ServerInfo.csv"

IF OPEN(1,"$ServerList")=0
$null = Open( 3 , "$OutputFile" , 5 )
$ServerName = READLINE(1)
WHILE $ServerName
? "Processing: $ServerName"
;Most of the informatio is in the same place in NT4.0 and Win2k, but not all.
$os_version = ReadValue("\\$ServerName\HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion","CurrentVersion")
IF $os_version = "5.0"
;Any Win2k Specific Reg entries (Still trying to figure this out)
ELSE
;Any NT4.0 Specific Reg Entries (Still trying to figure this
ENDIF
;Reg entries common to NT 4.0 and Win2k
$os_service_pack = ReadValue("\\$ServerName\HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion","CSDVersion")
$os_product = ReadValue("\\$ServerName\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\ProductOptions","ProductType")
$Computer_Name = ReadValue("\\$ServerName\HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\ComputerName\ComputerName","ComputerName")
$Host_Name = ReadValue("\\$ServerName\HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Tcpip\Parameters","HostName")
$Name_Servers = ReadValue("\\$ServerName\HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Tcpip\Parameters","NameServer")

SHELL 'CMD /X /C $UtilDir\srvinfo.exe -od \\$ServerName > $TempFile'
$DriveInfo = ""
$null = OPEN(2, "$TempFile")
$Drive = READLINE(2)
WHILE $Drive
$DriveInfo = $DriveInfo + "," + $Drive
$Drive = READLINE(2)
LOOP
$null = CLOSE(2)
$y = $Computer_Name + "," + $Host_Name + "," + $os_version + "," + $os_service_pack + "," + $os_product + "," + $Name_Servers + $DriveInfo + Chr(13) + Chr(10)
$x = WriteLine( 3 , "$y")

$ServerName = READLINE(1)
LOOP
$null = CLOSE(1)
$null = CLOSE(3)
ELSE
beep
? "Error, Server list not found!"
get $x
ENDIF


Input list.
ServerList.txt

code:

LTN1
LTN2
LTN3
LTN4
LTN5

Comma separtated output file.
Output.csv

code:

LTN1,ltn1,4.0,Service Pack 6,ServerNT,123.123.176.254 123.123.130.201,C$,NTFS,997,550,447,D$,NTFS,3342,1127,2215,E$,NTFS,4338,1340,2998
LTN2,ltn2,4.0,Service Pack 5,ServerNT,123.123.176.254 123.123.130.201,C$,NTFS,2001,1420,581,D$,NTFS,14332,12025,2307,E$,NTFS,8755,4572,4183
LTN3,LTN3,5.0,Service Pack 1,ServerNT,123.123.176.254 123.123.130.201,C$,NTFS,12971,2263,10708,D$,NTFS,17516,2854,14662,E$,NTFS,17516,65,17451
LTN4,LTN4,4.0,Service Pack 6,ServerNT,123.123.176.254 123.123.130.201,C$,NTFS,1091,912,179,D$,NTFS,1067,10,1057,E$,NTFS,20325,19862,463
LTN5,ltn5,4.0,Service Pack 6,ServerNT,123.123.176.254 123.123.130.201,C$,NTFS,2071,426,1645,D$,NTFS,4095,220,3875,E$,NTFS,1875,1782,93,F$,NTFS,8676,7958,718,Z$,NTFS,197,191,6

Later,
Mark P.

Top
#52417 - 2000-11-30 09:13 AM Re: Oh my god!
Anonymous
Unregistered


I guess I am trying to go a bit further like...dhcp scopes.. primary + secoundary dns wins etc into a nice report format ..


I realize you can use tools like Hyena ..to do this. But a kix script would be far cooler...mybe some ole stuff going on as well.

thanks guys + girls

------------------
there can be only one!

Top
#52418 - 2000-11-30 02:34 PM Re: Oh my god!
Anonymous
Unregistered


I understand..
Just trying to show you some basic ideas for using Kixtart to get lots of information from remote computers. If you find the right utilities to get the DNS scope information, you can use the methods shown in the example scripts(mine and Fabian's) to make any kind of report, formatted whichever way you want.

I looked at the DHCP stuff in the registry, but it's mostly in binary and not very usable. I have not found a good text based utility to decode it yet.


Hope you find what you are looking for.
Mark P.

Top
#52419 - 2000-11-30 02:49 PM Re: Oh my god!
DrillSergeant Offline
MM club member
*****

Registered: 2004-07-09
Posts: 1164
Loc: Eijsden, the Netherlands
What kind of servers are you talking about?
HP, Compaq,... ?

I know Compaq has his own (very impressive) survey tools for servers, and i'm pretty sure HP has got one too.

I hope this helped instead of confusing you any further.

Greetings,

Roger the Young (roughly translated)

_________________________
The Code is out there

Top
#52420 - 2000-11-30 04:49 PM Re: Oh my god!
Anonymous
Unregistered


OK, not to confuse the situation further, but I'm still a little confused about the information you are trying to find.

What kind of DNS Scope information are you looking for? Is the server you are getting the information from running a DNS server? Or are you just trying to figure out which DNS servers it is using? If it is running a server, you need utilities to query the server.. DNSCMD.exe in the (new)NT resource kit will give you some server info and zone info.

There is also the DHCPCMD.exe in the NT Resource kit to query a DHCP server for information on how many addresses are in use and who is using them.


Oh well,
I will stop bugging you.

MP

Top
#52421 - 2000-11-30 07:57 PM Re: Oh my god!
Anonymous
Unregistered


Thats it Mark, looking for info on dns settings (for individual machines and if machine is acting as DNS server.. what scope..and if dhcp server what scope)

I have found your script and fabians very usefull so far.
thnaks for the great help!!
I have used so far to help get a quick report together.

When I finall get some thing really good going I will post it.

thanks

------------------
there can be only one!

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
0 registered and 1283 anonymous users online.
Newest Members
fgarcia, Viginette, ManuvdWielNL, Sir_Barrington, batdk82
17889 Registered Users

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

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