Share the first monitoring script, mount point disk space usage monitoring: If the use of space reached 75% to start the alarm, send a warning message.
On the mobile phone to install NetEase's mail client, you can achieve the effect of real-time reminders.
For the configuration of mail, see previous article: http://blog.csdn.net/rookie_ceo/article/details/46559195
#!/bin/shsource/etc/profileip= '/sbin/ifconfig|sed-n '/inet addr/s/^[^:]*:\ ([0-9.] \{7,15\}\). */\1/p ' |grep-v ' 127.0.0.1 ' warn_pct=70warn_name=[disk]performance_path=/monitor/performancemailtmp=/ U01/soft/smonitor/mailtmplet/disktmp.mail[email protected],[email protected]tt= ' Df-h|awk ' {print $6 ', ' $ "," $ "," $ $ "," $4} ' |tr ' \ n ' "" dt= "date +"%y-%m-%d%h:%m:%s "' #echo $ttOLD _ifs=" $IFS "ifs=" "arr= ($TT) ifs=" $OLD _ifs " For i in ' ${!arr[@]} "do #echo $i" "${arr[$i]}" If [$i-ge 1] then #echo "$i" "${arr[$i]}" disk_ Pct= ' echo ' ${arr[$i]} "|awk-f ', ' {print $} ' | Cut-f 1-d "%" ' #echo "disk_pct= $disk _pct warn_pct= $warn _pct" If [$disk _pct-ge $warn _pct] #if [$disk _p Ct-ge]then echo "Hello:" > $mailtmp echo "[$DT] Server: $IP disk: ${arr[$i]} usage has reached $warn_pct%, please Timely processing. "#>>" $performance _path "/performance_disk_$ (date +%y%m%d). Log echo" [$DT] Server: $IP disk: ${arr[$i]} usage Have reached $warn_pct%, please deal with it in time. ">> $mailtmp pp=${tt///\\n} echo-e $pp >> $mailtmp dt= ' date + '%y-%m-% D%h:%m:%s "' Echo-e" \nbest wishes! \ n------------------------------------\nca system Monitor \n$dt ">> $mailtmp cat $mailtmp | Mailx-s "$warn _name[Alarm]: server: $IP" $maillistfi Fidone
Email Alert effect
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Linx monitoring sharing--disk space monitoring + email alerts