<%
Set FileSystemObject = Server.CreateObject("Scripting.FileSystemObject")
Set Drives = FileSystemObject.Drives
For Each DiskDrive in Drives
If DiskDrive.IsReady Then
totalspace = DiskDrive.TotalSize
freespace = DiskDrive.FreeSpace
usedspace = totalspace - freespace
freepercent = Int((freespace/totalspace)*100)
freemb = Int((freespace/1024)/1024)
usedmb = Int((usedspace/1024)/1024)
usedpercent = Int((usedspace/totalspace)*100)
If freespace =< 1048576 Then
freelabel = FormatNumber(freespace/1024, 1) & " Kb"
Elseif freespace =< 1073741824 then
freelabel = FormatNumber((freespace/1024)/1024, 1) & " Mb"
Else
freelabel = FormatNumber(((freespace/1024)/1024)/1024, 2) & " Gb"
End If
If usedspace =< 1048576 Then
usedlabel = FormatNumber(usedspace/1024, 1) & " Kb"
Elseif usedspace =< 1073741824 Then
usedlabel = FormatNumber((usedspace/1024)/1024, 1) & " Mb"
Else
usedlabel = FormatNumber(((usedspace/1024)/1024)/1024, 2) & " Gb"
End If
If Left(freelabel,3) = "0.0" Then freelabel = "0 bytes"
If Left(usedlabel,3) = "0.0" Then usedlabel = "0 bytes"
used_alt_tag = "Drive " & DiskDrive.DriveLetter & ": " & usedlabel & " in use"
free_alt_tag = "Drive " & DiskDrive.DriveLetter & ": " & freelabel & " free"
Response.Write "Drive " & DiskDrive.DriveLetter & ": "
If DiskDrive.VolumeName <> "" then
Response.Write "[" & DiskDrive.VolumeName & "] : "
End If
Response.Write "<br>"
End If
Next
Set Drives = nothing
Set FileSystemObject = nothing
%>
위와 같은 디스크정보는 WMI를 통해서도 가능하다.
http://www.serverinfo.pe.kr/TipnTech.aspx?Content=Windows&Search=&vMode=View&page=&Seq=141
출처 : http://www.brettb.com/ASPDiskMonitoringScript.asp
2005/12/18
Asp. 디스크 용량 모니터링
가장 많이 본 글
-
Windows 2000 Resource Kit Active Directory Domain Controller 점검 점검 도구: http://download.microsoft.com/download/win2000platform/update/ 5.0.21...
-
Microsoft 오픈소스 프로젝트인 CodePlex 프로젝트중에 하나인 NetPing 입니다. 다운로드: http://www.codeplex.com/NetPing 지정된 서브넷의 네트워크에 대해서 Ping 모니터링을 할수 있는 도구이며, 기본값은 실...
-
다음 오류 때문에 네트워크 로드 균형 조정 서비스를 시작하지 못했습니다: 서비스를 사용할 수 없거나 서비스와 연관되어 사용 가능한 장치가 없기 때문에 서비스를 시작할 수 없습니다. 네트워크 로드 균형 조정을 시스템에 설치하지 않았습니다.