how to check my hard disk is below 10%, and then send mail to superuser


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting how to check my hard disk is below 10%, and then send mail to superuser
# 1  
Old 08-06-2003
Network how to check my hard disk is below 10%, and then send mail to superuser

how to write bash to superuser, when the disk space dips below 10% of the total by automatically sending an email?
It is have any sample for reference
# 2  
Old 08-06-2003
if [df|grep|awk > this]; then that.....

Something along those lines...... just add a bit of thought and your there Smilie
# 3  
Old 08-06-2003
DFR=`df yourfilesystem |grep -v Filesystem |awk '{print $4}'`
if [ $DFR > "90% ]
then
....
else
...
fi
# 4  
Old 08-07-2003
bash solaris

that should do what you want..... cron it...

#!/usr/bin/bash
DISKUSE=`df -k | awk '{print $5}'`
TEST=`echo $DISKUSE | grep 9[0-9]`
if [ "$TEST" == "" ]
then
exit 0
else
echo "I don't know the mail syntax"
fi
#end


greetings Preßy
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Check file if not found send mail if exit call second script

I need to check my script and change to working mode. currently it was not sending the mail and exit without calling the second script. I need to check the file is present ="/home/Rvtools/test.csv" if this file not found after the time retry send mail file not found If the file exit run the... (2 Replies)
Discussion started by: ranjancom2000
2 Replies

2. HP-UX

How to check overall hard disk utilization in UNIX?

how to check overall hard disk utilization in unix? we use bdf command to find the utilized space for the particular path bdf filepath how can i find overall hard disk utilization? (4 Replies)
Discussion started by: ashwanthfrq
4 Replies

3. Shell Programming and Scripting

How to write this script:- check output word and send a mail?

Hi Guys, I am not Good at scripting. I need to write a script such that if output of command shows the particular word in output then send mail to abc@compay.com -bash-3.2$ ps -ef | grep bpbkar root 6040 1 0 13:05:19 ? 0:00 bpbkar -r 2678400 -ru root -dt 47395 -to 0... (20 Replies)
Discussion started by: manalisharmabe
20 Replies

4. AIX

Command to check the busy % for a hard disk device like hdisk5

Please help with command to check the busy % for a hard disk device like hdisk5 Best regards, Vishal (7 Replies)
Discussion started by: Vishal_dba
7 Replies

5. Shell Programming and Scripting

check postfix deferred mail and send notification script

Hi Guys, I have a postfix server which is deferring emails. Now I need to send notification to a specific email address if: The sender of the deferred email is: abc@example.com Contains specific subjects: a file (/opt/subjects) contains all the subjects in place Then need to send a... (0 Replies)
Discussion started by: linuxrulz
0 Replies

6. Shell Programming and Scripting

I have a requirement to check whose accounts are expired in Linux machine and send a mail to root

I have a requirement to check whose accounts are expired in Linux machine and send a mail to root user about the accounts. How can i achieve this in Linux? (1 Reply)
Discussion started by: mnmonu
1 Replies

7. Linux

C++ Code to Access Linux Hard Disk Sectors (with a LoopBack Virtual Hard Disk)

Hi all, I'm kind of new to programming in Linux & c/c++. I'm currently writing a FileManager using Ubuntu Linux(10.10) for Learning Purposes. I've got started on this project by creating a loopback device to be used as my virtual hard disk. After creating the loop back hard disk and mounting it... (23 Replies)
Discussion started by: shen747
23 Replies

8. UNIX for Dummies Questions & Answers

unix script to check if rsh to box and send status mail

rshstatus=`rsh -n lilo /db/p2/oracle/names9208/restart_names.sh` if $rshstatus <>0 then errstatus=1 mailx -s "xirsol8dr" ordba@xxx.com >> $log_dr else if errstatus=0 echo "status to xirsol8dr successful" can anyone provide if this is t he correct way to do this or is there a better way? (1 Reply)
Discussion started by: bpm12
1 Replies

9. UNIX for Dummies Questions & Answers

Hard Disk Check

How can we check the number of hard disks (both internal & external) in a server, their capacity and serial number (5 Replies)
Discussion started by: muneebr
5 Replies
Login or Register to Ask a Question