Checking the space for /archlog mount point script


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Checking the space for /archlog mount point script
# 1  
Old 03-23-2011
CPU & Memory 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.
Code:
#!/usr/bin/ksh
export MAIL_LIST="tlr.voora@zamn.com"
export ARCH_STATUS=`df -k /archlog | awk '{ print $5 }' | grep -v Use%`
echo $ARCH_STATUS
if [[ $ARCH_STATUS > 80% ]]
then echo "archive destination is $ARCH_STATUS full please contact DBA"
echo "archive destination /archlog is $ARCH_STATUS full on Cappire." | mailx -s "archive destination on cappire is $ARCH_STATUS full" $MAIL_LIST
else
exit 1 
fi

exit

When i scheduled a cron job it is giving different result. Right now /archlog is 6%, it should exit without e-mailing anything. But, i am getting the below e-mail from cappire server which is strange.
Code:
subject:archive destination on cappire is capacity
below is the e-mail content.
6% full
Content-Length: 62

archive destination /archlog is capacity 6% full on Cappire.

Please help me in resolving this issue - why i am getting the above e-mail, i should not get any e-mail with the logic.

Is there any issue with the cron. Please let me know.

Last edited by Scott; 03-23-2011 at 02:16 PM.. Reason: Code tags, please...
# 2  
Old 03-24-2011
Sometimes formatting of thngs like ls, df changes without a tty. You might try something like this to achieve the same end:
Code:
$ df -k .
/home                                       : 19971944 total allocated Kb
                                                   1043584 free allocated Kb
                                                  18928360 used allocated Kb
                                                        94 % allocation used
$
 
df -k /archlog | grep -c ' [ 1-8][0-9] % allocation used' | read BELOW_90

Send the whole df in the email.
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

Mount Point Increase script

Hello all. My aim is to monitor the size of my mount points. The algo that I want to follow is like this: 1) Use df -h to print all mount points. 2)Extract only Capacity and Mounted On columns and save them in Array1. 3)After 10 minutes , do the above same and save in Array 2 the 2 very... (1 Reply)
Discussion started by: Junaid Subhani
1 Replies

3. 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

4. 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

5. 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

6. Shell Programming and Scripting

Shell script for Server Mount Point space check

Does anybody have anything I can use to help me out with this one? (4 Replies)
Discussion started by: lbone007
4 Replies

7. 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

8. UNIX for Dummies Questions & Answers

Problem in checking space of mount.Please help me

Hi everyone, I am writing a script. As a part of this script, I wanted to check the space of few mounts, If the space usage percentage of the mount crosses over a certain limit then i wanted to display a warning message. The following is the command df -k | awk ' { if (($6 == "/export/temp")... (4 Replies)
Discussion started by: Sheethal
4 Replies

9. Solaris

Command used for checking space occupied by files & sub-direc's inside a mount in %?

Hi, I want to know the command which can be used for finding the % of disk space occupied by files & sub-folders inside a given mount in Sun Solaris For eg: I have /tmp/ folder when I sat df -k it will give the percentage of space used by /tmp/. Say if I want to see how much % the files &... (2 Replies)
Discussion started by: weblogicsupport
2 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