The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Help: root partition crashed, fsck failed. Disk problem? steeles SUN Solaris 2 02-11-2008 07:09 PM
Reinstall root partition jbestor SUN Solaris 4 04-25-2007 05:18 PM
Ran out of space on /dev/root partition Martyn Filesystems, Disks and Memory 2 07-07-2006 09:58 AM
moving space from one partition to another jason6792 UNIX for Advanced & Expert Users 4 10-08-2001 06:54 PM
Swap Partition Space I[X]ION UNIX for Dummies Questions & Answers 1 08-24-2001 10:00 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 07-24-2007
chiru_h chiru_h is offline
Registered User
  
 

Join Date: Jul 2006
Posts: 72
Disk space for root partition

Hello,
I am trying to monitor disk space for each node on the machine. I am able to get all individual nodes but for the '/' node. For example:
df -k:
bash-2.05b# df -k
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/xxx 4127108 2415340 1502120 62% /
/dev/yyy 77750 20614 53122 28% /boot
/dev/zzz 410898760 73467776 316558536 19% /opt
/dev/aaa 4127108 619428 3298032 16% /var

if I say df -k | grep /opt: I can get disk space for /opt. As I get all the nodes if I grep for just '/', can you please let me know how I can get disk space for /

Thanks
Chiru
  #2 (permalink)  
Old 07-24-2007
ermur ermur is offline
Registered User
  
 

Join Date: Jul 2007
Location: La Paz, Bolivia
Posts: 15
Hi chiru_h

You can try running command:

df -k /

I hope it helps

Erwin
  #3 (permalink)  
Old 07-24-2007
chiru_h chiru_h is offline
Registered User
  
 

Join Date: Jul 2006
Posts: 72
Thanks Erwin, that indeed is giving only the root disk space. But actually I am using it in a script for monitoring:
df -k | egrep '/opt|/var|/' | awk '{print $6"\t"$5}' | while read LINE; do DISK=`echo $LINE | cut -d"%" -f1 |awk '{ print $2 }'`; if [ $DISK -gt 80 ]; then echo "${LINE}"; fi; done

How can I incorporate it in the script?
  #4 (permalink)  
Old 07-24-2007
ermur ermur is offline
Registered User
  
 

Join Date: Jul 2007
Location: La Paz, Bolivia
Posts: 15
You can use the '$' symbol to indicate the end of the line.

In your script, the first line should look like this:

df -k | egrep '/opt|/var|/$' | awk '{print $6"\t"$5}'| while read LINE

Regards,

Erwin
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 08:08 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0