February 22, 2006 at 8:11 am
Due to changes in my current work environment I have had a new task dump No I was told I have a new opportunity. Anyway I have been asked to monitor disk space on all 200+ servers at our company. I need to keep a history of space used, space available and then make predictions on space used for the next few months and year. My question is what would be the best way to handle the forecasting.
I have already created a rough table structure. Server table and Drive table that would have a date field in it. I think the only way for me to get the data from the servers is WMI and I will have to hit up our developer for that.
Any suggestions or recommendations would be great.
Thanks
Stacey
Stacey W. A. Gregerson
February 23, 2006 at 1:59 am
Hi,
You need to monitor only SQL servers, or any kind of server?
JP
February 23, 2006 at 4:23 am
Use Insight Manager - comes with all HP servers.
February 23, 2006 at 5:03 am
I have to monitor space on all windows servers, most are Dell servers with a few HP servers.
Stacey W. A. Gregerson
February 23, 2006 at 6:41 am
Do you need to produce a report on space usage for all servers periodically or a notification when a server reaches a configured threshold (i.e. drive E at 80 % of capiciity)?
MG
"There are two ways of constructing a software design. One way is to make it so simple that there are obviously no deficiencies. And the other way is to make it so complicated that there are no obvious deficiencies."
Tony Hoare
"If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." Red Adair.
February 23, 2006 at 6:57 am
I need to create a report every Monday morning. I was thinking I would populate the database nightly at midnight. Then show a report for the week and post updates to the forcast.
Stacey W. A. Gregerson
February 23, 2006 at 8:08 am
I have a stored procedure that executes a cmdshell and pulls in the data from srvinfo (from W2K Resource Kit). It parses it for just the drive info and stores that in a table for history but will send out a notification if a drive(s) reaches or passes a configured threshold.
Here is the code for pulling out drive info. It's not the most elegant but it works. The last 3 lines are just used in testing. You might add an OpenRowSet to a central server and insert the data there for your report.
create table ##filesystem
(
Drive char(1),
TotalSize float,
FreeSize float,
UsedSize float
)
-- srvinfo is in the W2K Resource Kit
create table ##results
([Value] varchar(256))
insert into ##results exec master..xp_cmdshell 'srvinfo'
delete from ##results where [Value] not like '%$%' or [Value] is null
declare @i int
select @i = 0
while @i < 10
begin
update ##results
set [Value] = REPLACE([Value],CAST(@i as CHAR(1)) + ' ',CAST(@i as CHAR(1))+'.0,')
select @i = @i + 1
end
update ##results
set [Value] = REPLACE([Value],'NTFS',' ')
update ##results
set [Value] = REPLACE([Value],'$',''',')
update ##results
set [Value] = REPLACE([Value],' ','')
update ##results
set [Value] = '''' + [Value]
declare filesystem cursor for
select [Value] from ##results
declare @cmd varchar(256)
open filesystem
fetch filesystem into @cmd
declare @fieldcount int
while @@fetch_status = 0
begin
SELECT @fieldcount = CHARINDEX(',',@cmd,(SELECT CHARINDEX(',',@cmd,(SELECT CHARINDEX(',',@cmd)+1))+1))
if (@fieldcount = 0)
begin
select @cmd = @cmd + ',0'
end
select @cmd = 'INSERT INTO ##filesystem VALUES (' + @cmd + ')'
exec (@cmd)
fetch filesystem into @cmd
end
deallocate filesystem
select * from ##filesystem
drop table ##filesystem
drop table ##results
MG
"There are two ways of constructing a software design. One way is to make it so simple that there are obviously no deficiencies. And the other way is to make it so complicated that there are no obvious deficiencies."
Tony Hoare
"If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." Red Adair.
February 23, 2006 at 8:25 am
Thanks allot, I will take a closer look at it.
Stacey W. A. Gregerson
February 24, 2006 at 10:27 am
I was playing with this since I could use it also and I get
'srvinfo' is not recognized as an internal or external command,
I installed the win2k resoure tools in the default directory
C:\Program Files\Windows Resource Kits\Tools
if I double click on the exe it works but not from TSQL. What am I doing wrong?
February 24, 2006 at 10:31 am
The RK folder isn't in the path. The easy way around it is to copy srvinfo.exe to the Windows folder.
MG
"There are two ways of constructing a software design. One way is to make it so simple that there are obviously no deficiencies. And the other way is to make it so complicated that there are no obvious deficiencies."
Tony Hoare
"If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." Red Adair.
February 24, 2006 at 10:50 am
Thanks that was the problem
Viewing 11 posts - 1 through 10 (of 10 total)
You must be logged in to reply to this topic. Login to reply