Check disk space

Hi,
     I have to check disk space on remote servers..and alert us (send email) if free space goes below threshold value..Any ideas Please how to implement this using power shell...any help would be appreciated.
Thanks

ALL,
    I was able to run this script with no problem
$percentWarning = 10;
# Get server list
$servers = Get-Content "$Env:USERPROFILE\serverlist.txt";
$datetime = Get-Date -Format "yyyyMMddHHmmss";
# Add headers to log file
Add-Content "$Env:USERPROFILE\server disks $datetime.txt" "server,deviceID,size,freespace,percentFree";
foreach($server in $servers)
                # Get fixed drive info
                $disks = Get-WmiObject -ComputerName $server -Class Win32_LogicalDisk -Filter "DriveType = 3";
                foreach($disk in $disks)
                                $deviceID = $disk.DeviceID;
                                [float]$size = $disk.Size;
                                [float]$freespace = $disk.FreeSpace;
                                $percentFree = [Math]::Round(($freespace / $size)
* 100, 2);
                                $sizeGB = [Math]::Round($size / 1073741824, 2);
                                $freeSpaceGB = [Math]::Round($freespace / 1073741824,
2);
                                $colour = "Green";
                                if($percentFree -lt $percentWarning)
$colour = "Red";
                                Write-Host -ForegroundColor $colour "$server $deviceID
percentage free space = $percentFree";
                                Add-Content "$Env:USERPROFILE\server disks $datetime.txt"
"$server,$deviceID,$sizeGB,$freeSpaceGB,$percentFree";
Can you guys help me how to configure alerts here...like to sent email if $percentWarning goes below 10..
Thanks

Similar Messages

  • OraRRP Error with "Unable to copy data file;Error code 2, check disk space"

    Hi,
    Some users get this message -"Unable to copy data file;Error code 2, check disk space" when run report with orarrp, but most users do not get it.
    I check free space at both server and client side, they are very sufficient.
    I also checked directory exists for REPORTXX_TMP variable.
    My user call reports via URL (rwservlet) and it occur for all reports.
    How I can solve this problem?
    Thanks in advance.
    Tawatchai R.

    Hi,
    have the same problem now. One user has temporarily problems to download .rrpa files via URL (rwservlet) request. Error code: -"Unable to copy data file;Error code 2, check disk space". Did you get a solution??
    Thanks in advance. Axel

  • Checking disk spaces on hdd of oracle database

    Hi ,
    I am using Oracle 9i is there any pre-written procedures/functions that can be used for checking the hdd space ?
    I believe in Oracle EM , it's able to set a job to detect low hdd space ?
    appreciate ur advise
    tks & rdgs

    What harddisk space?
    Oracle does not need to keep track of actual harddisk space available - it after all uses the space inside the data files assigned to its tablespaces. It does not care about how much space is left on the harddisk.
    You can make an operating system call to determine the amount of free space on a file system (harddisk) - but you have no idea what your/Oracle's space allocation is on that file system. Other Oracle tablespaces can have data files on the same file system. Archive logs and redo logs could also perhaps exist on that file system. Free space that may no longer exist in 30 seconds time.
    So even if you make this "what is the percentage free space" call, the result itself is totally meaningless as you cannot determine how much of that file system (harddisk) space is usable for your Oracle data file or tablespace.
    Also, such an Oracle data file can be a raw device - in which case the operating system itself is clueless as to how much space has been used and not used on that raw device. So you cannot even make an o/s call to determine used vs free space utilisation.
    The correct method is to look inside Oracle only. The data files allocated to Oracle is the actual space that has been allocated for Oracle. Period.
    You can only deal space wise with the amount of space assigned via these data files to Oracle. You can determine how much space is left. Some of these files may be auto extending - but you have no idea whether or not that auto increase of the file size can be serviced and fulfilled by the operating system.
    Thus checking harddisk space from inside Oracle for any type of Oracle db space management is pretty much a useless exercise IMO.

  • Check disk space thru database

    Friends,
    Is there a way to run the command say "df -g" through the database and get the output so that to display
    it finally in the database?

    You can use
    1>host df -h
    2>host df -m
    If you need total database size then use this querry.
    select DataFiles.data_size+TempFiles.temp_size+RedoLogs.redo_size+ControlFile.controlfile_size "total_size in MB"
    from
    ( select sum(bytes)/1024/1024 data_size from dba_data_files ) DataFiles,
    ( select nvl(sum(bytes),0)/1024/1024 temp_size from dba_temp_files ) TempFiles,
    ( select sum(bytes)/1024/1024 redo_size from sys.v_$log ) RedoLogs,
    ( select sum(BLOCK_SIZE*FILE_SIZE_BLKS)/1024/1024 controlfile_size from v$controlfile) ControlFile;
    If you have asm diskgroup, then
    select name,total_mb/1024 TOTAL_GB ,free_mb/1024 FREE_GB, ((free_mb/total_mb)*100) " %FREE ", 100-((free_mb/total_mb)*100) "%USED" from v$asm_diskgroup;
    Regards,
    Venki

  • How to get available disk space for a disk in the system ?

    hi all,
    I need to figure out the available disk space for a particular disk before I can write my file to a directory in the disk. I do this to avoid unsufficient disk space problem in my program. May I know how can I do this in Java ? I look at the API function for java.io.File class but there isn't any function to check disk space. I would appreciate any help from fellow Java developers. Thanks a million.
    regards,
    tuck meng

    You cannot do this in purely platform independent way.
    You can use System.exec to run native OS utilities like df and parse the output, but then you have to knwo which platform your program is running on, or build in some automatic detection of OS and have corresponding native calls for each likely one.
    BTW. even if you get a number of free bytes on disk that's larger than the size of the file you want to write this is no guarantee that there will be enough diskspace for your file, because another process might write to the disk in the meantime. So you will have to do proper error handling and recover gracefully from the disk full sitution no matter what.

  • Step 6 error insufficient disk space in oracle linux

    hi am in step 6 installing my oracle oracle in oracle Linux am getting insufficient disk space on this volume for the selected oracle
    i have this dir oracle_base = /u01/app/oracle/product
    sofware location /u01/app/oracle/product/11.2.0/db_1
    database file location /u01/app/oracle/product/oradata
    how can i check space becuase is have enough space
    Edited by: Tshifhiwa on 2012/01/27 2:40 PM
    i type free -m
    total used free shared buffers cached
    Mem: 1988 1844 143 0 36 1365
    -/+ buffers/cache: 443 1545
    Swap: 3999 0 3999
    Edited by: Tshifhiwa on 2012/01/27 2:40 PM
    Edited by: Tshifhiwa on 2012/01/27 3:44 PM
    Edited by: Tshifhiwa on 2012/01/27 4:05 PM

    Tshifhiwa wrote:
    hi am in step 6 installing my oracle oracle in oracle Linux am getting insufficient disk space on this volume for the selected oracle
    i have this dir oracle_base = /u01/app/oracle/product
    sofware location /u01/app/oracle/product/11.2.0/db_1
    database file location /u01/app/oracle/product/oradata
    how can i check space becuase is have enough space
    Edited by: Tshifhiwa on 2012/01/27 2:40 PM
    i type free -m
    total used free shared buffers cached
    Mem: 1988 1844 143 0 36 1365
    -/+ buffers/cache: 443 1545
    Swap: 3999 0 3999
    Edited by: Tshifhiwa on 2012/01/27 2:40 PM
    Edited by: Tshifhiwa on 2012/01/27 3:44 PM
    Edited by: Tshifhiwa on 2012/01/27 4:05 PM<Sigh!>
    http://lmgtfy.com/?q=check+disk+space+in+linux

  • Insufficient disk space for SunStudio 12

    Hello,
    I am fairly new to Solaris (was on Linux before) but anyway I tried to install SunStudio 12. Prepare went well but when I ran install script:
    *./batch_installer -p all --accept-sla*
    or even GUI installation:
    *./installer &*
    there was following report displayed:
    Installation failed: insufficient disk space.
    Then i did df -kh to check disk space and got output as follows:
    Filesystem size used avail capacity Mounted on
    /dev/dsk/c0d1s0 4,6G 4,4G 98M 98% /
    /devices 0K 0K 0K 0% /devices
    ctfs 0K 0K 0K 0% /system/contract
    proc 0K 0K 0K 0% /proc
    mnttab 0K 0K 0K 0% /etc/mnttab
    swap 2,2G 692K 2,2G 1% /etc/svc/volatile
    objfs 0K 0K 0K 0% /system/object
    /usr/lib/libc/libc_hwcap2.so.1 4,6G 4,4G 98M 98% /lib/libc.so.1
    fd 0K 0K 0K 0% /dev/fd
    swap 2,2G 48K 2,2G 1% /tmp
    swap 2,2G 24K 2,2G 1% /var/run
    /dev/dsk/c0d1s7 33G 1,2G 31G 4% /export/home
    Then I tried to redirect installation to /export/home just to test what report will
    be now. There was same report again regardless of *31GB* of available space.
    So, am I missing something here ?
    Any idea would be welcome. Thank you.
    Josip

    I think the problem is that there is not enough space in / filesystem:
    /dev/dsk/c0d1s0 4,6G 4,4G 98M 98% /
    It has only 98 Mb free. By default Sun Studio is installed at /opt, which is a directory in / filesystem.
    I'd suggest you to extract Sun Studio Express from the tar.gz file. You can download it from this page:
    http://developers.sun.com/sunstudio/downloads/express/index.jsp
    Extract it somewhere (say /export/home/ss12), set PATH and run compilers and tools.
    Thanks,
    Nik

  • I am not able to update iTunes keeps popping up message saying no free disk space I checked and there is enough to support the upgrade but I cant figure out why it wont let me. Help anyone!

    So heres the deal, I updated my iphone and in order to put any music on it or even ringtones I have to have the most updated version of iTunes, unfortunately my macbook wont allow the update, I do have a lot of pictures and song stored on here but I have no documents I have deleted everything the only thing left on here is what the macbook came with. I checked and it says that I have enough memory so is there another reason I cant update. When I try and check for the update option in iTunes it says its up to date but I have version 10 something so I know its old, I haven't been able to update anything on here. Do I have to take it to the store or is there something that I can fix on my own because my warranty is up and I have nothing but problems when I go into an actual apple store.

    If you want to try to clear even more disk space see https://discussions.apple.com/thread/5872318?tstart=0

  • Can't open iPhoto.. message says check that the volume has sufficient free disk space

    message reads
    Unable to write to write to libary "iphoto" check that the volume has sufficient free disk space is free ? help

    How much free space do you have? You should always have a minimum of 10 GB or more - 10% of your hard drive is a good goal
    LN

  • Workshop 6u1 installation freezes when checking for disk space

    Hi!
    I've trying to install Workshop 6 update 1 but while installing and the application is checking for disk space it just freezes on me. One important thing, this system had Workshop 4, 6u1 and 6u2 installed. I removed the package for ws4 and untinstalled ws6u1 and ws6u2 from /var/sadm/prod/com.forte....... for each one of the versions.
    Do you have any idea what is going on, why it freezes when checking for disk space???
    thanks,
    Jorge

    Hi,
    command: cmd.exe /c D:\oracle e-business suite R12\oracle ebusiness suite\startCD\Disk1\rapidwiz\bin\adchkutl.cmd C:\cygwin C:\msvc
    'D:\oracle' is not recognized as an internal or external command,
    operable program or batch file.
    RW-50011: Error: - System Utilities Availability test has returned an error: 1Please do not use spaces in directory names, spaces are not allowed and it is expected to get such errors because of the spaces.
    Host/Domain
    command: ping -n 1 windows7-pc
    Pinging WINDOWS7-PC [fe80::4c7b:9a58:f4b2:e7c5%12] with 32 bytes of data:Please note that Windows 7 is not certified as a database/application tier node.
    Thanks,
    Hussein

  • Checking OS disk space

    Hi, everybody !
    I would like to know, using a Oracle procedure, the Windows Disk Space.
    For example, if my Oracle database have datafile in two drives (D: and E:) and I'd like to know the disk size and free disk space, is it possible using a procedure ?
    I tried with a java program, compiled as java source but i am facing some errors.
    Thanks in advance,
    Joao Lanaro

    Hi, everybody "
    To me there is not wrong, but let me explain, I have an instance used to monitoring another Oracle instances, so one of these checks is how much free OS disk space is available in each server.
    I am using the Oracle scheduler to execute it sometimes per day. Because this I thougth that a procedure is the better option, I found a java program but I do not know so much Java and I could not fix the errors.
    If I use a batch file, as you said, How can I use it into a procedure, How can I get the return of dir and use it to subtract or sum with my datafiles size ?
    Thanks in advance,

  • Scripts for checking Windows Production Servers Disk Space

    Hi Friends,
    I am looking for some simple scripts (DOS Based or which can be run in restrictive env)by which I can get the Servers Disk Space statistics when I run it from my local machine. My L1 team members are responsible for verifying Disk Space primarily C and D:
    everyday and they send status of the same by logging onto each and every servers. If I can get some simple scripts which can be run easily, that would be really helpful. 
    Thanx in Advance. 
    Keep Rocking :)
    Saurabh

    Hi,
    You may want to check this script out from the TechNet Gallery. 
    http://gallery.technet.microsoft.com/PowerShell-Script-to-fa8305ea
    Cheers.
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Milton Goh
    MCSE, MCSA, MCITP, MOF, ITIL, AIIM SharePoint Specialist
    Blog |
    Twitter

  • How do I check my disk space

    I can't convert a newer microsoft word file from a thumb drive onto my imac because I don't have enough "disk space."  Any idea on how to get around this.

    Select the icon representing your startup volume on the Desktop or in the sidebar of a Finder window. Open the Info window. What is shown for "Available"?

  • Checking free disk space after setting up Boot Camp?

    Hi team,
    I've just gone thru the install process for putting Windows 8 on my MB Air.  Can anyone point me to info on keeping an eye on free disk space? 
    I have a 128Mb SSD drive, and prior to installing Win 8 I cleared a lot of media files off the SSD (which took ages to secure delete), but when I used the 'Get Info' option to see how much space had been freed up, the free space did not appear to increase by the amount I had deleted (we're talking about 22Gb of material deleted!).
    Anyway I created a Windows partition of 30Gb.  When I boot into Win8 it reports only a few Gb free of the 30Gb partition... When I boot into MacOS it reports 36Gb free of the 90Gb partition.
    Any help or links greatfully received!
    Cheers,
    Chris

    Which internal drive option did you pick? The 3TB Fusion, 1TB Fusion or the standard drive option. It Matters.
    If the 3TB Fusion model you can't install windows even with Boot Camp unless you jump through some Hoops and first brake apart the Fusion drive.
    If 1TB Fusion or standard drive then you will need a Windows PC to make  USB thumb drive containing the Win 7 install files. you do that with a tool MS has, Windows 7 USB DVD Download Tool, or Yumi Multiboot or ISO to USB. And you first may have to make an ISO from the DVD or go to My Digital Life and download the ISO file of the version of Win 7 you buy and have a License key for, Home Premium, Pro or Ultimate.
    Other then that you start Boot Camp Assistant, Found in the Utilities folder in Applications, and download the Win Support files and then partition the drive for Windows. It is all laid out in the Boot Camp help files and or online documentation.

  • Checking the schema-wise disk space usage

    hi
    can we get the disk space usage for every individual schema separately ?

    What about this:
    select OWNER, sum(BYTES) from DBA_SEGMENTS group by OWNER

Maybe you are looking for

  • My Husbands truck is in my name

    Do to his credit not being good, it was puchased in January so the loan is "new" well he has decided to leave and I am trying to figure out if there is a way to get him on the loan and me off? What would we need to do would it be considered a purchas

  • Firefox saving double version of the same webpage in a single file

    About one year back, I saved a webpage as webpage complete, that is, as a HTML file and a folder containing associated files. Recently I added mozilla archive format add-on. I revisited the webpage and it has changed a little bit, for example the pic

  • Data Migration from Peoplesoft to EBS?

    Hi Anyone can help me obtain the necessary documents, tools, etc to migrate from PeopleSoft Data to EBS? Thanks in advance JIL

  • Datasource TO MS Access on Windows Vista

    I have windows vista and MS Access 2007. I have successfuly created datasources to SQL server but get this error when submitting a datasource to an Access database. "Unable to update the NT registry. Variable DRIVERPATH is undefined." Any idea how to

  • Problem with ColorSpace

    [Sorry for the last post with incomplete title] Hello everyone I am writing a program in Java that analyzes color patches from a colorimeter. Unfortunately, I am not quite sure how to use the related Java routines. That is, to read in the measuered d