查看完整版本: Linux 檢查磁碟空間Quota並發送郵件警示Alarm


99770 2020-1-8 11:03

Linux 檢查磁碟空間Quota並發送郵件警示Alarm

主機有時會遇到空間不足,但常常是發生問題了,事後一查才知道是這個問題,現在可以利用建立
HdSpaceAlert.sh 這個檔,並設定排程每日自動執行HdSpaceAlert.sh,檢查Linux各FileSystem硬碟剩餘空間,
如任一FileSystem之空間小於90%,便發送郵件通知。

HdSpaceAlert.sh
[quote]
#郵件通知地址

ADMIN="adams@xxx.xxx.xxx"

# 設定空間使用達??%便通知,以下設90%

ALERT=90

#定出不需要檢查的FileSystem,中間用「|」隔開,以下為不檢查/dev/sda1及/dev/sda2

Excepti

#因df -H第一列是TITLE,所以awk完後使用grep -v 'Use%'過濾掉第一列TITLE列

df  -H | grep -vE $ExceptionalPartition | awk '{ print $5 " " $1 }' | grep -v 'Use%' | while read output;

do
      usep=$(echo $output | awk '{ print $1}' | cut -d'%' -f1 )
      partition=$(echo $output | awk '{ print $2 }' )
      if [ $usep -ge $ALERT ]; then
         echo -ne "SOS! SOS! SOS! \n out of space \"$partition ($usep%)\" on $(hostname) as on $(date)" | mail -s "Warning: out of disk space $usep %" $ADMIN

      fi
done
[/quote]

df0201f 2024-2-1 10:40

[img]https://s2.loli.net/2024/01/25/KZMRUHS3jWvIceA.png[/img]
[img]https://s2.loli.net/2024/01/25/tsEqmAIheV2u1jJ.png[/img]
[img]https://s2.loli.net/2024/01/25/jPkdWEFXR8DOTaI.png[/img]
[img]https://s2.loli.net/2024/01/25/zT5Al1SDoPGM6wr.png[/img]
[img]https://s2.loli.net/2024/01/25/vEPOLy92rXqBGUC.png[/img]
[img]https://s2.loli.net/2024/01/25/AbN7R8nOXxF4rTP.png[/img]
[img]https://s2.loli.net/2024/01/25/z7RAH2e3jXcgya5.png[/img]
[img]https://s2.loli.net/2024/01/25/Rqm74IbzSxEYQAG.png[/img]
[img]https://s2.loli.net/2024/01/25/wMNoXznQaTIkLuD.png[/img]
[img]https://s2.loli.net/2024/01/25/azQkhUF8dnOXJfC.png[/img]
[img]https://s2.loli.net/2024/01/25/KBkWAazCbQpsoRc.png[/img]
[img]https://s2.loli.net/2024/01/25/h8wYqiXPJtvryQW.png[/img]
[img]https://s2.loli.net/2024/01/25/bSRnEydw6zPjIpX.png[/img]
[img]https://s2.loli.net/2024/01/25/JFiCSGIbsx3o9OB.png[/img]
[img]https://s2.loli.net/2024/01/25/FEAmia3DlpULNfM.png[/img]
[img]https://s2.loli.net/2024/01/25/OLk1mAHy9CKPEzc.png[/img]
[img]https://s2.loli.net/2024/01/25/Uyd5BuOAS2l36bK.png[/img]
[img]https://s2.loli.net/2024/01/25/1EckWlP7moU5FTL.png[/img]
[img]https://s2.loli.net/2024/01/25/Iij2pYwJSsz7ZT5.png[/img]
[img]https://s2.loli.net/2024/01/25/mjJ5ZqOI9KbydnR.png[/img]
[img]https://s2.loli.net/2024/01/25/nwuGQWz8gqDKjaX.png[/img]
[img]https://s2.loli.net/2024/01/25/X9mb3vGAuewxOk2.png[/img]
[img]https://s2.loli.net/2024/01/25/gAZWszNkrv1hMaR.png[/img]
[img]https://s2.loli.net/2024/01/25/MqW5XDazA6kPoKr.png[/img]
[img]https://s2.loli.net/2024/01/25/fRYBSxpaMm2v8oe.png[/img]
[img]https://s2.loli.net/2024/01/25/6bECrfLkOWXKhcm.png[/img]
[img]https://s2.loli.net/2024/01/25/2fmMtUy9Ir4qXYi.png[/img]
[img]https://s2.loli.net/2024/01/25/eoQd5ugpbVkrZPA.png[/img]
[img]https://s2.loli.net/2024/01/25/aw8pfcWvqdOeAPB.png[/img]
[img]https://s2.loli.net/2024/01/25/mGPQE5UTwWqs2fg.png[/img]
[img]https://s2.loli.net/2024/01/25/ysJ3x8Gz1ViFlwf.png[/img]
[img]https://s2.loli.net/2024/01/25/lFJbkunC4UvBr1z.png[/img]
[img]https://s2.loli.net/2024/01/25/dzcXlCO7NZGfRTj.png[/img]
[img]https://s2.loli.net/2024/01/25/HNsEhwVjo4U3yLa.png[/img]
[img]https://s2.loli.net/2024/01/25/f35nNvsReqZi2B7.png[/img]
[img]https://3o.hk/images/2024/01/26/73695364_202401251059300764680663.png[/img]
[img]https://3o.hk/images/2024/01/26/73695364_202401251059500999718260.png[/img]
[img]https://3o.hk/images/2024/01/26/73695364_202401251100070202263965.png[/img]
[img]https://3o.hk/images/2024/01/26/73695364_202401251100220937169879.png[/img]
[img]https://3o.hk/images/2024/01/26/73695364_202401251100380687858869.png[/img]
[img]https://3o.hk/images/2024/01/26/73695364_202401251100530093965918.png[/img]
[img]https://3o.hk/images/2024/01/26/73695364_202401251107010720174731.png[/img]
[img]https://3o.hk/images/2024/01/26/73695364_202401251107170205827032.png[/img]
[img]https://3o.hk/images/2024/01/26/73695364_202401251107300971778520.png[/img]
[img]https://3o.hk/images/2024/01/26/73695364_202401251107470611680705.png[/img]
[img]https://3o.hk/images/2024/01/26/73695364_202401251108010799953531.png[/img]
[img]https://3o.hk/images/2024/01/26/73695364_202401251108150690953531.png[/img]
[img]https://3o.hk/images/2024/01/26/73695364_202401251109060065787312.png[/img]
[img]https://3o.hk/images/2024/01/26/73695364_202401251109190768692759.png[/img]
[img]https://3o.hk/images/2024/01/26/73695364_202401251109330393988518.png[/img]
[img]https://3o.hk/images/2024/01/26/73695364_202401251109470050409286.png[/img]
[img]https://3o.hk/images/2024/01/26/73695364_202401251110010222181844.png[/img]
[img]https://3o.hk/images/2024/01/26/73695364_202401251110170815751441.png[/img]
[img]https://3o.hk/images/2024/01/26/73695364_202401251120360929237393.png[/img]
[img]https://3o.hk/images/2024/01/26/73695364_202401251120510023277644.png[/img]
[img]https://3o.hk/images/2024/01/26/73695364_202401251121060554720434.png[/img]
[img]https://3o.hk/images/2024/01/26/73695364_202401251121220726154604.png[/img]
[img]https://3o.hk/images/2024/01/26/73695364_202401251121400445588528.png[/img]
[img]https://3o.hk/images/2024/01/26/73695364_202401251121540882515205.png[/img]
[img]https://3o.hk/images/2024/01/26/73695364_202401251123310149381694.png[/img]
[img]https://3o.hk/images/2024/01/26/73695364_202401251123440883338498.png[/img]
[img]https://3o.hk/images/2024/01/26/73695364_202401251123590039580584.png[/img]
[img]https://3o.hk/images/2024/01/26/73695364_202401251124140994189694.png[/img]
[img]https://3o.hk/images/2024/01/26/73695364_202401251124270571375555.png[/img]
[img]https://3o.hk/images/2024/01/26/73695364_202401251124410337819846.png[/img]
[img]https://3o.hk/images/2024/01/26/73695364_202401251125440899211456.png[/img]
[img]https://3o.hk/images/2024/01/26/73695364_202401251125590290565312.png[/img]
[img]https://3o.hk/images/2024/01/26/73695364_202401251126110728831032.png[/img]
[img]https://3o.hk/images/2024/01/26/73695364_202401251126210681474208.png[/img]
[img]https://3o.hk/images/2024/01/26/73695364_202401251126330369476864.png[/img]
[img]http://www.rapidbbs.cn/data/attachment/forum/202401/26/163059dj8j7zshiiq787ny.png[/img]
[img]http://www.rapidbbs.cn/data/attachment/forum/202401/26/163111bcws55e37szcnpsd.png[/img]
[img]http://www.rapidbbs.cn/data/attachment/forum/202401/26/163125ow88df9fdl5a85fh.png[/img]
[img]http://www.rapidbbs.cn/data/attachment/forum/202401/26/163136ziccdjhjjjtothhz.png[/img]
[img]http://www.rapidbbs.cn/data/attachment/forum/202401/26/163147cxemhohlu5nylvym.png[/img]
[img]http://www.rapidbbs.cn/data/attachment/forum/202401/26/163159jycnhqzph4zbplxl.png[/img]
[img]http://www.rapidbbs.cn/data/attachment/forum/202401/26/163210so086q0hqyomrrqw.png[/img]
[img]http://www.rapidbbs.cn/data/attachment/forum/202401/26/163222xmy9666muc7ys4ny.png[/img]
[img]http://www.rapidbbs.cn/data/attachment/forum/202401/26/163229ek07okur707b7bd0.png[/img]
[img]http://www.rapidbbs.cn/data/attachment/forum/202401/26/163242ocy024k0yyi2zkke.png[/img]
[img]http://www.rapidbbs.cn/data/attachment/forum/202401/26/163256v92131731119e337.png[/img]
[img]http://www.rapidbbs.cn/data/attachment/forum/202401/26/163308fxf8dpkikystfret.png[/img]
[img]http://www.rapidbbs.cn/data/attachment/forum/202401/26/163514v3e6ssnsn495v9bv.png[/img]
[img]http://www.rapidbbs.cn/data/attachment/forum/202401/26/163523iockjrkdok6d66ro.png[/img]
[img]http://www.rapidbbs.cn/data/attachment/forum/202401/26/163534geteyqhwpvevjhex.png[/img]
[img]http://www.rapidbbs.cn/data/attachment/forum/202401/26/163543y9xuz4exsxeve02e.png[/img]
[img]http://www.rapidbbs.cn/data/attachment/forum/202401/26/163553ywuiwx9xn1w18q5f.png[/img]
[img]http://www.rapidbbs.cn/data/attachment/forum/202401/26/163606rwupaew3ueqswgya.png[/img]
[img]http://www.rapidbbs.cn/data/attachment/forum/202401/26/163619zk1afx7of1iokczf.png[/img]
[img]http://www.rapidbbs.cn/data/attachment/forum/202401/26/163628vhmy65powow0z6pa.png[/img]
[img]http://www.rapidbbs.cn/data/attachment/forum/202401/26/163642stitbe86e8tt96g6.png[/img]
[img]http://www.rapidbbs.cn/data/attachment/forum/202401/26/163654m25lmz5z35iii69n.png[/img]
[img]http://www.rapidbbs.cn/data/attachment/forum/202401/26/163706zws0l8o80s6ws0l8.png[/img]
[img]http://www.rapidbbs.cn/data/attachment/forum/202401/26/163717v07lg940vwh0a067.png[/img]
[img]http://www.rapidbbs.cn/data/attachment/forum/202401/26/163859gr40je0d1yr4jtm0.png[/img]
[img]http://www.rapidbbs.cn/data/attachment/forum/202401/26/163910bdzudw7dsd2sdxdj.png[/img]
[img]http://www.rapidbbs.cn/data/attachment/forum/202401/26/163922fijwxix4ejrr3995.png[/img]
[img]http://www.rapidbbs.cn/data/attachment/forum/202401/26/163932whqfhr97fqz19v7e.png[/img]
[img]http://www.rapidbbs.cn/data/attachment/forum/202401/26/163942e00uputwuswqfw9b.png[/img]
[img]http://www.rapidbbs.cn/data/attachment/forum/202401/26/163953ki0dbbgg0yzcc9i9.png[/img]
[img]http://www.rapidbbs.cn/data/attachment/forum/202401/26/164005qayuyyi84yyzdayk.png[/img]
[img]http://www.rapidbbs.cn/data/attachment/forum/202401/26/164019ogahp67otacmyzp6.png[/img]
[img]http://www.rapidbbs.cn/data/attachment/forum/202401/26/164029pc5dflklf5slddwl.png[/img]
[img]http://www.rapidbbs.cn/data/attachment/forum/202401/26/164034nijxx47drsj7r7sj.png[/img]
[img]http://www.rapidbbs.cn/data/attachment/forum/202401/26/164043ciru55ob7z8bregq.png[/img]


[img]https://images2.imgbox.com/92/3c/8LWsYmsS_o.png[/img]
[img]https://images2.imgbox.com/c9/5b/0v5etPPy_o.png[/img]
[img]https://images2.imgbox.com/41/e4/ShxCqatg_o.png[/img]
[img]https://images2.imgbox.com/f1/ca/xbWvV1ch_o.png[/img]
[img]https://images2.imgbox.com/3d/18/XVgdSmWR_o.png[/img]
[img]https://images2.imgbox.com/80/7b/FQtGqV6W_o.png[/img]
[img]https://images2.imgbox.com/1c/70/UHFM0RKq_o.png[/img]
[img]https://images2.imgbox.com/15/99/RVdIxZR2_o.png[/img]
[img]https://images2.imgbox.com/b6/c8/LvNEaYFz_o.png[/img]
[img]https://images2.imgbox.com/e1/ab/EGkyqXmK_o.png[/img]
[img]https://images2.imgbox.com/56/f6/5rnVogYx_o.png[/img]
[img]https://images2.imgbox.com/73/50/h7U3FmZE_o.png[/img]
[img]https://images2.imgbox.com/9b/c8/TVBpivq4_o.png[/img]
[img]https://images2.imgbox.com/dc/9b/mvYH9Qe4_o.png[/img]
[img]https://images2.imgbox.com/08/1d/V3cNP7DH_o.png[/img]
[img]https://images2.imgbox.com/83/83/40EkLAgU_o.png[/img]
[img]https://images2.imgbox.com/3b/6b/wuhUB2rq_o.png[/img]
[img]https://images2.imgbox.com/79/44/Fx7GpyWh_o.png[/img]
[img]https://images2.imgbox.com/d6/02/qBJEaRmq_o.png[/img]
[img]https://images2.imgbox.com/5f/c9/7BDG3oBC_o.png[/img]
[img]https://images2.imgbox.com/50/b9/IYmBaUrD_o.png[/img]
[img]https://images2.imgbox.com/2f/99/FU7M796m_o.png[/img]
[img]https://images2.imgbox.com/cc/03/ukUyWTRQ_o.png[/img]
[img]https://images2.imgbox.com/ef/c8/uF8yhzVm_o.png[/img]
[img]https://images2.imgbox.com/71/93/k65hneiz_o.png[/img]
[img]https://images2.imgbox.com/e5/ae/ByZlDnUS_o.png[/img]
[img]https://images2.imgbox.com/b4/ac/ZlwjH7Hi_o.png[/img]
[img]https://images2.imgbox.com/7c/98/s4oiZB77_o.png[/img]
[img]https://images2.imgbox.com/ec/95/0F9r6c8l_o.png[/img]
[img]https://images2.imgbox.com/cb/c4/8S19jddM_o.png[/img]
[img]https://images2.imgbox.com/99/47/uwmr98w2_o.png[/img]
[img]https://images2.imgbox.com/47/21/35rZzOkw_o.png[/img]
[img]https://images2.imgbox.com/b3/b3/iaog25r8_o.png[/img]
[img]https://images2.imgbox.com/dc/57/xXbjLNKk_o.png[/img]
[img]https://images2.imgbox.com/4f/29/Qg9nUGH9_o.png[/img]



[img]https://i.im.ge/2024/01/26/blMKg6.73695364-202401251059300764680663.png[/img]
[img]https://i.im.ge/2024/01/26/blMzE9.73695364-202401251059500999718260.png[/img]
[img]https://i.im.ge/2024/01/26/blMHJX.73695364-202401251100070202263965.png[/img]
[img]https://i.im.ge/2024/01/26/blMvS8.73695364-202401251100220937169879.png[/img]
[img]https://i.im.ge/2024/01/26/blMfMF.73695364-202401251100380687858869.png[/img]
[img]https://i.im.ge/2024/01/26/blMkDK.73695364-202401251100530093965918.png[/img]
[img]https://i.im.ge/2024/01/26/blMBrY.73695364-202401251107010720174731.png[/img]
[img]https://i.im.ge/2024/01/26/blMeg4.73695364-202401251107170205827032.png[/img]
[img]https://i.im.ge/2024/01/26/blQQMC.73695364-202401251107300971778520.png[/img]
[img]https://i.im.ge/2024/01/26/blQTIq.73695364-202401251107470611680705.png[/img]
[img]https://i.im.ge/2024/01/26/blQoEp.73695364-202401251108010799953531.png[/img]
[img]https://i.im.ge/2024/01/26/blQXJP.73695364-202401251108150690953531.png[/img]
[img]https://i.im.ge/2024/01/26/blQqQT.73695364-202401251109060065787312.png[/img]
[img]https://i.im.ge/2024/01/26/blQaxL.73695364-202401251109190768692759.png[/img]
[img]https://i.im.ge/2024/01/26/blQ7JG.73695364-202401251109330393988518.png[/img]
[img]https://i.im.ge/2024/01/26/blQLPa.73695364-202401251109470050409286.png[/img]
[img]https://i.im.ge/2024/01/26/blQ09S.73695364-202401251110010222181844.png[/img]
[img]https://i.im.ge/2024/01/26/blQjQ6.73695364-202401251110170815751441.png[/img]
[img]https://i.im.ge/2024/01/26/blQtP8.73695364-202401251120360929237393.png[/img]
[img]https://i.im.ge/2024/01/26/blQCFM.73695364-202401251120510023277644.png[/img]
[img]https://i.im.ge/2024/01/26/blQE9Y.73695364-202401251121060554720434.png[/img]
[img]https://i.im.ge/2024/01/26/blQxRD.73695364-202401251121220726154604.png[/img]
[img]https://i.im.ge/2024/01/26/blQYQ4.73695364-202401251121400445588528.png[/img]
[img]https://i.im.ge/2024/01/26/blQbLC.73695364-202401251121540882515205.png[/img]
[img]https://i.im.ge/2024/01/26/blQZkf.73695364-202401251123310149381694.png[/img]
[img]https://i.im.ge/2024/01/26/blQVFm.73695364-202401251123440883338498.png[/img]
[img]https://i.im.ge/2024/01/26/blQfjr.73695364-202401251123590039580584.png[/img]
[img]https://i.im.ge/2024/01/26/blQkRW.73695364-202401251124140994189694.png[/img]
[img]https://i.im.ge/2024/01/26/blQpUT.73695364-202401251124270571375555.png[/img]
[img]https://i.im.ge/2024/01/26/blQv3c.73695364-202401251124410337819846.png[/img]
[img]https://i.im.ge/2024/01/26/blTOs9.73695364-202401251125440899211456.png[/img]
[img]https://i.im.ge/2024/01/26/blT9Of.73695364-202401251125590290565312.png[/img]
[img]https://i.im.ge/2024/01/26/blTjmm.73695364-202401251126110728831032.png[/img]
[img]https://i.im.ge/2024/01/26/blTmZr.73695364-202401251126210681474208.png[/img]
[img]https://i.im.ge/2024/01/26/blT6oW.73695364-202401251126330369476864.png[/img]
{2024年01月01日}2024春季,全球 崩 盘,三 峡 溃 坝

{2024年01月01曰}2024春季,全球 崩 盘,三 峡 溃 坝



作者 : 林斯丁
时间:  2023年12月16曰 16:46:41     星期六      农历十一月初四
           上正宗指 2942.56点    恒指 16792.19点   道指37305.16点
         
           
755年12月16曰:唐朝藩镇安禄山与其部将史思明以清君侧之名发动
                           叛乱,长达8年的内战成为唐朝由盛转衰的转捩点。
16⑧9年12月16曰:英囯囯卝会通卝过《泉卝利fǎ案》,确立了人卝民拥有不
                             可剥夺的民事和zhèng卝治泉卝利。
1966年12月16曰:联合囯大卝会采纳“囯际人卝泉公约”。
1932年12月16曰:林卝昭生曰,中卝囯右卝派分卝子,民卝主人卝士。
                             (1968年4月29曰逝世,基卝督徒)


         
突然的,全球 金 融 市 场 连 续 跌 停 大 崩 盘,
没有什么,谁也没想到啊,友邦惊诧,黑 天 鹅 白天鹅 哥斯拉,
一切都是,蓄 谋 已 久 的精心策划。zéi 喊捉zéi。


{一} 今时今曰{癸卯黑兔2023年12月16曰 } :
今时今曰,我预.测,人类有始.以来最大的金.融.崩 盘 ,未来三个月
之内,即,2024年02月、03月、04月,将 震 撼呈 现。
---- 中卝囯股市、全球股市、全球金融市场 连序跌婷大崩 盘 , 大盘连
       续或稍稍间断30/40多个跌亭板,人类有.史以来最大的金融.嗨啸。
股市、汇市、债市、期货商品、可能还有楼卝市,全部连卝锁式彻底崩溃。
黄 金 价 格 应 该 避 险 bào 涨。
忽 然 之 间 ,天 塌 了。{ 全 球 闪 崩 }
十 八 级 金融大 地.震,史无前例地球崩卝盘,要 多 惨 有 多惨,世界沫曰。
金融天坑,股市雪崩、铡 dāo 斩 首 、bào 雷 溃 坝 ,希 特 勒 巴巴罗萨
頁: [1]
查看完整版本: Linux 檢查磁碟空間Quota並發送郵件警示Alarm