Shell script for Server Mount Point space check


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Shell script for Server Mount Point space check
# 1  
Old 07-13-2010
Shell script for Server Mount Point space check

Does anybody have anything I can use to help me out with this one?
# 2  
Old 07-13-2010
How about:
Code:
df

# 3  
Old 07-14-2010
I'd use df + awk to grap what you need and throw some if x > y then mailx me@domain.com


I have a script at work I wrote.. if I remember I'll post it tomorrow.
# 4  
Old 07-14-2010
Infinity,

Did you by any chance find the script at work? Anything will help me
# 5  
Old 07-19-2010
Here's a quick and dirty.. change /dev/sda3 to whatever device you want to check.. and change the if statement and partition to match what you want.

This is by no means elegant... but does the job in a pinch.
Code:
#!/usr/local/bin/bash
#This defines the disk usage for said partition (i.e. it's checking /'s useage, and stripping out everything but the integer
root=`df -F ext3 -k | grep -vE '^Filesystem|tmpfs|cdrom' | grep /dev/sda3 | awk '{ print $5}' | cut -d'%' -f1`
partition=/
#sets threshold
  if [ $root -ge 90 ]; then
#emails alert
     echo "Running out of space \"$partition ($root%)\" on $(hostname) as on $(date)" |
     mail -s "Alert: Almost out of disk space on $(hostname).  $partition is at $root%" someone@domain.com
  fi


Last edited by Franklin52; 07-19-2010 at 05:03 PM.. Reason: Please use code tags, thanks
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

How to create a new mount point with 600GB and add 350 GBexisting mount point? IN AIX

How to create a new mount point with 600GB and add 350 GBexisting mount point Best if there step that i can follow or execute before i mount or add diskspace IN AIX Thanks (2 Replies)
Discussion started by: Thilagarajan
2 Replies

2. Shell Programming and Scripting

Script to find a mount point on multiple server

Hi, I have to find a mount point called... /opt/recall on multiple servers.. .Could someone give me a suggestion on how I could do this? (2 Replies)
Discussion started by: gartie
2 Replies

3. Solaris

Mount point in a server

Hi , How to find out mount point in a server ? OS -- SunOS 5.6 Generic sun4u sparc SUNW Thanks (4 Replies)
Discussion started by: Maddy123
4 Replies

4. UNIX for Advanced & Expert Users

Checking the space for /archlog mount point script

I have the below shell script which is checking /archlog mount point space on cappire(solaris 10) server. When the space usage is above 80% it should e-mail. When i tested this script it is working as expected. #!/usr/bin/ksh export MAIL_LIST="tlr.voora@zamn.com" export ARCH_STATUS=`df -k... (1 Reply)
Discussion started by: dreams5617
1 Replies

5. Shell Programming and Scripting

Checking the space for /archlog mount point script

I have the below shell script which is checking /archlog mount point space on cappire(solaris 10) server. When the space usage is above 80% it should e-mail. When i tested this script it is working as expected. -------------------------------------------------------------------------... (0 Replies)
Discussion started by: dreams5617
0 Replies

6. Solaris

archive logs mount point space check script

I have the below shell script which is checking /archlog mount point space on cappire(solaris 10) server. When the space usage is above 80% it should e-mail. When i tested this script it is working as expected. -------------------------------------------------------------------------... (0 Replies)
Discussion started by: dreams5617
0 Replies

7. Solaris

How to know used disk space at a mount point?

how to check how much space is occupied when u softmount or hard mount a file? ---------- Post updated at 03:24 AM ---------- Previous update was at 03:24 AM ---------- can anyone send me the answer (2 Replies)
Discussion started by: revathireddy
2 Replies

8. Solaris

Increasing disk space of a mount point.

Hi I have a mount point that is in production environment, and is currently filled up. more space has been presented from same original source (EVA). Problem; 1. Can't see presented space 2. After I discover the presented space, how do I go about adding this new space to existing mount point.... (9 Replies)
Discussion started by: Targ
9 Replies

9. UNIX for Advanced & Expert Users

How to check mount point connectivity in Unix?

I am working on an unix server which has a mount point of windows server in it. I just need to check about the connectivity of this mount point with the windows server. Please let me know what should be done for that. (1 Reply)
Discussion started by: venkidhadha
1 Replies

10. AIX

Increase in space in mount point.

I am working in AIX 4.3.3 , here when we are doing one activity we ran out of space in one mount point, we need to increase the space in that mout point by reducing it in another mount point, can anybody help me out in carrying this activity. Vipin (3 Replies)
Discussion started by: vipin77
3 Replies
Login or Register to Ask a Question