script to monitor mount points on linux box


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting script to monitor mount points on linux box
# 1  
Old 09-25-2009
script to monitor mount points on linux box

Hi,

the following shell script is not working on linux box
sugeestions appreciated.
Code:
FILE1=/tmp/check1.txt
FILE2=/tmp/check2.txt
df -k | awk '{if (NR != 1)
print $5 $6}' > ${FILE1}
awk -F"%" '{if ($1 > 90) print "Warning: Filesystem " $2 " over 90% threshold (" $1 "%)"}' ${FILE1} > ${FILE2}
if [ -s ${FILE2} ]; then
mail -s "Filesystem threshold reached" prakash.gr@youtelecom.com < ${FILE2}
fi
rm ${FILE1}
rm ${FILE2}

Thanks

Prakash GR
# 2  
Old 09-25-2009
What is not working ie. what is the error output?
Is this written for a df -k on your Linux box?
Some Unix'es/Linux'es have different positions for their Used%.
# 3  
Old 09-25-2009
Hi,

mail service is enabled in that linux box but i am not getting mail.

is this script is fine .

Thanks

Prakash GR
# 4  
Old 09-25-2009
Please tell exactly what the problem is - do you get garbled output? Maybe comment out the line where it is sent as mail and redirect to a file or check your output on the screen.
# 5  
Old 09-25-2009
sorry zaxxon,

could you give me hint how to redirect the things

Thanks

Prakash GR
# 6  
Old 09-25-2009
What you can do is remove few lines from code. and type on shell set -x on.
when you run it ... you will see what is the script in action ...

Code:
if [ -s ${FILE2} ]; then
mail -s "Filesystem threshold reached" prakash.gr@youtelecom.com < ${FILE2}
fi
rm ${FILE1}
rm ${FILE2}

# 7  
Old 09-25-2009
Hi pani,

Code:
[ideasdb@voipdb2 ~]$ set -x
[ideasdb@voipdb2 ~]$ sh  mountpoint1.sh
+ sh mountpoint1.sh
/tmp/check1.txt
++ echo -ne '\033]0;ideasdb@voipdb2:~\007'

Thanks

Prakash GR
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Linux Mount Points usage check with shell script

Hi Everyone, Just in need of your help again, I have managed to get a script to check the linux disk usage stuff. But wanted to tweak it little more to get the desired output. Requirement: Now its querying only one mount point, As its not saving in array instead calling it as variables. So... (1 Reply)
Discussion started by: thiyagoo
1 Replies

2. Red Hat

Mount Points? How?

Hi folks, I have been asked to performed the following: Add the following new moint points systemA:/avp and SystemB:/usr/sap/trans to be the new linux server ZZZ How can I add those mount points and how those mount points can become another linuz server?:wall::wall::wall: (2 Replies)
Discussion started by: 300zxmuro
2 Replies

3. Filesystems, Disks and Memory

Mount NCR Unix disk on Linux box

Hi all I have an NCR UNIX hard disk I need to mount it on a Linux box The FS Type in fdisk on linux is '63' for the partition How can i mount on my linux box ? what is kernel module i needed ? (6 Replies)
Discussion started by: yasser202
6 Replies

4. Shell Programming and Scripting

Shell Script to see the mount points.

Hi all, First of all I dont even know the ABC of scripting .. But now I want a Script to see the mount points of the file systems Can any body help plsssssssss :o (1 Reply)
Discussion started by: priky
1 Replies

5. Shell Programming and Scripting

test a script about mount points

Hi there, I would like people to test a script on as many situations as possible so we can find out errors and lacks. I wrote the script to help me work around mount points, especially when doing batch job on files (like backup) and to avoid duplicate operations through mount points. For... (2 Replies)
Discussion started by: chebarbudo
2 Replies

6. UNIX for Advanced & Expert Users

mount points

hi, I believe a mount point does not have to be a physical disk, but rather a logical one? Is this correct? if so, how can I find out if my mount points are on different physical disks? thanks (9 Replies)
Discussion started by: JamesByars
9 Replies

7. Shell Programming and Scripting

Script to Reboot a linux box from a windows box

HI All, I need a script to reboot a linux box from a windows box. The script needs to run automatically whenever a sitescope alerts with an error message. Have searched for this in the forums, but could not get something relative. Pls. let me know the various alternatives we have to do... (2 Replies)
Discussion started by: Crazy_murli
2 Replies

8. UNIX for Dummies Questions & Answers

Mount Points at reboot

How do I make a mount point reconnect at boot without editing /etc/fstab? Is there an option (or switch) to make this persistent when issuing the mount command from a client? (1 Reply)
Discussion started by: AIXdumb455
1 Replies

9. UNIX for Advanced & Expert Users

mount points

sometimes in Solaris 8 when I go to mount filesystems using either the mount command or by editing the /etc/vfstab, i get a nice little error message saying the the number of allowable mount points has been exceeded. I have read man pages until I am blue in the face and no where can I find what the... (3 Replies)
Discussion started by: manderson19
3 Replies

10. UNIX for Dummies Questions & Answers

how to mount a hotswap scsi drive on a solaris 2.6 netra box using the mount command?

Hi... question is this: How do I mount an LVD hotswap scsi drive in bay #2 on a netra using the mount command? volmgt doesn't seem to mount it and/or I don't know how to view the drives data if it's formatted which it may not be. This drive is not new out of the box so I'm not sure. ... (4 Replies)
Discussion started by: soulshaker
4 Replies
Login or Register to Ask a Question