Linx monitoring and sharing-disk space monitoring + email reminder, linx --
Share the first monitoring script. mount point disk space usage monitoring: If the used space reaches 75%, an alarm is triggered and an alarm email is sent.
Install Netease's email client on your mobile phone to receive real-time notifications.
For mail configuration, see the 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. mailmaillist = 490073687@qq.com, zhou.xiangxing210@163.comtt = 'df-h | awk '{print $6 "," $2 "," $5 "," $3 ", "$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 $3} '| cut-f 1-d" % "' # echo" disk_pct = $ disk_pct warn_pct = $ warn_pct "if [$ disk_pct-ge $ warn_pct] # if [$ disk_pct-ge 70] then echo "Hello: "> $ mailtmp echo" [$ DT] server: $ IP Disk: $ {arr [$ I]} usage has reached $ warn_pct %. Please handle it in time. "#>>" $ Performance_path "/performance_disk _ $ (date + % Y % m % d ). log echo "[$ DT] server: $ IP Disk: $ {arr [$ I]} usage has reached $ warn_pct %. Please handle 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 [alert]: SERVER: $ IP "$ maillistfi fidone
Email reminder Effect
Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.