Linx monitoring and sharing-disk space monitoring + email reminder, linx --

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.