Quota threshold


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Quota threshold
# 8  
Old 02-11-2009
One question for clarification: Do you want to test 2 filesystems (/export and /home/t2) or one (/export/home/t2)?
# 9  
Old 02-11-2009
Put this line in the head of your script
Code:
set -x

and start it again. Then put the output here.
# 10  
Old 02-11-2009
Just another dude chiming in to help.
  1. Taranjeet - I must second Zaxxon's request for more output (using set -x) - it really helps when you include your work in progress (output, descriptions) with your follow posts. It helps optimize the feedback loop, and also helps the helpers understand where you are coming from.
  2. Zaxxon I'm not so sure the problem is the for loop eating all arguments, I use that for quite a bit. Besides, T reported a "could not open" message, but on my system I saw "No such file or directory", I think it was a permissions problem.
  3. I think the best description of the problem with the script is it is not handling error conditions well. I've reposted your script with a few changes (in bold) that will hopefully both guide you to understanding and fix the problems you saw.


Code:
#!/bin/sh
set -x # turn on execution trace
warninglimit=350000
lowlimit=250000
filesystems="/export /home/t2/"
for fs in $filesystems
do
    # try the df separately and catch any errors
    dfoutput=`df -k $fs`
    if [ $? -ne 0 ] ; then
        echo "Error running 'df -k $fs', skipping" >&2
        continue
    fi
    size=`echo $dfoutput |grep $fs|awk '{ print $4; }'`
    if [ "$size" -le $lowlimit ]
    then
        echo mailx -s "URGENT: Low disk space for $fs ($size)" -r abc@sd.com
        # why do you want to stop
        # why not keep going?
        break
    fi
    if [ $size -le $warninglimit ]
    then
        echo mailx -s "WARNING: Low disk space for $fs ($size)" -r abc@sd.com
    fi
done

One thing I'll point out, notice the added double quotes around $size in the following line. This is another way to suppress the 'test' error messages you got, but it really just avoids the problem of the 'df' failing.
Code:
if [ "$size" -le $lowlimit ]

# 11  
Old 02-12-2009
QUOTA threshold

Hi All,

Thanks a lot for your suggestions.

I tried implementing the last one ,but it is still throwing an error while doing export.
I noted one thing very peculiar here,that it is not allowing me to export but it is still displaying the QUOTA of the environment.

Found it really strange.

Any suggestions/comments??

Thanks..


+ warninglimit=350000
+ lowlimit=250000
+ filesystems=/export /home/t2/
+ + df -k /export
df: open of /export failed
dfoutput=
+ [ 1 -ne 0 ]
+ echo Error running 'df -k /export', skipping
+ 1>& 2
Error running 'df -k /export', skipping
+ continue
+ + df -k /home/t2/
dfoutput=/home/t2 (/dev/vgt2_flat1/lvt2_home) : 71696384 total allocated Kb
19766688 free allocated Kb
51929696 used allocated Kb
72 % allocation used
+ [ 0 -ne 0 ]
+ + echo /home/t2 (/dev/vgt2_flat1/lvt2_home) : 71696384 total allocated Kb 19766688 free allocated Kb 51929696 used allocated Kb 72 % allocation used
+ awk { print $4; }
+ grep /home/t2/
size=
+ [ -le 250000 ]
+ echo mailx -s URGENT: Low disk space for /home/t2/ () -r abc@sd.com
mailx -s URGENT: Low disk space for /home/t2/ () -r abc@sd.com
+ break
# 12  
Old 02-12-2009
Ok, try this one:
Code:
df -k | grep \/export

Show the output please.

@qneill
Just tried it out - you get no error when issuing df for a filesystem you don't have any rights for. I am about to see it exists at all on his system.

Last edited by zaxxon; 02-12-2009 at 08:11 AM..
# 13  
Old 02-12-2009
Quota threshold

Hi ,
It didn't return any output.....
# 14  
Old 02-13-2009
No output? Should come at least some error text. Anyway it seems you even don't have a filesystem with the mount point /export Smilie
Can you confirm this?
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Threshold for swap memory

hi guys the monitoring team is using a tool for monitoring linux boxes and they set an alarm for swap memory to 10%(critical) I really has no idea when swap memory usage is high.... Can someone recommend me a threshold for this? when is warning or critical and this parameters can affect... (3 Replies)
Discussion started by: karlochacon
3 Replies

2. Shell Programming and Scripting

Diff two files with threshold value

i have two big file which have thousand of line. i have to sort on two key fields then diff the file. if the interger value of one of the column is less then or greater then 1 it should ignore it. for example File1 abc|7000|jhon|2.3 xyz|9000|sam|6.7 pqr|8000|kapi|4.6 File2... (11 Replies)
Discussion started by: Nishi2011
11 Replies

3. Solaris

Rootvol above threshold

Hi there, Root filesystem is above threshold, I have search and cleared unwanted files which are filling up space. But the root fs is still above threshold. I don't know about veritas volume management. Can anyone show me how to solve this. Du shows /proc is occupying a lot of space. Most of the... (2 Replies)
Discussion started by: sundar63
2 Replies

4. UNIX for Dummies Questions & Answers

threshold

Hi, I have a table with 14 columns. How can I filter the columns 2-14, so that I get only those rows back in which the data values are >= 6 in 5 or more columns. :confused: E.g. A 6 6 3 6 7 8 B 1 2 3 4 5 5 C 2 2 2 6 7 8 Here I should only get back the row A. I would like to work from... (5 Replies)
Discussion started by: danieladna
5 Replies

5. UNIX for Dummies Questions & Answers

Load Average threshold

What should be the threshold for load average of a quad core processor? What constitutes "good" and "bad" load average values? (2 Replies)
Discussion started by: proactiveaditya
2 Replies

6. UNIX for Advanced & Expert Users

how to lessen the threshold of diskusgae %

Hi experts, I found- $ tail -f /var/adm/messages .... .... Jan 17 05:16:31 server01b last message repeated 6 times Jan 17 05:17:05 server01c ufs: NOTICE: alloc: /var/fileserver:file system full but I checked with df -k and found /var/fileserver is only 49% is used. It means... (7 Replies)
Discussion started by: thepurple
7 Replies

7. Shell Programming and Scripting

Check Quota of the Environment and mail the user if the threshold increases.

Hi All, I wish to check the quota of the system and if it increases the threshold value,I need that a mail is shot to the environment user informing hi/her about the same. I know it can be done using cron jobs and warnquota command but I am unable to implement it as I am not acquianted with... (1 Reply)
Discussion started by: Taranjeet Singh
1 Replies

8. UNIX for Advanced & Expert Users

Check Quota of the Environment and mail the user if the threshold increases.

Hi All,I wish to check the quota of the system and if it increases the threshold value,I need that a mail is shot to the environment user informing hi/her about the same.I know it can be done using cron jobs and warnquota command but I am unable to implement it as I am not acquianted with both... (1 Reply)
Discussion started by: Taranjeet Singh
1 Replies

9. Shell Programming and Scripting

apache threshold

Hi folks, how can i check apache threshold values via shell scripting and what factors need to check via shell scripting process or number of users or what. pls do advice me. Thanks, Bash (9 Replies)
Discussion started by: learnbash
9 Replies
Login or Register to Ask a Question