A linux hard disk monitoring script

Source: Internet
Author: User
A linux Hardware Monitoring script-general Linux technology-Linux technology and application information. For more information, see the following. [Root @ mp3server ~] # Cat simple_disk_check.sh
######################################## ####################################
# Function: Check the disk usage just for a simple disk format server
# Name: simple_disk_check.sh
# Usage: $ simple_disk_check.sh
######################################## ####################################
#! /Bin/bash

Source ~ /. Bash_profile

Df-h>/home/dustin/disk_usage
Touch/home/dustin/disk_temp

For I in 'df-k | awk' {print $5} '| grep ^ [0-9] | awk-F "%"' {print $1 }''
Do
If [$ I-ge 85]
Then
Iconv-f UTF-8-t GB2312/home/dustin/disk_usage>/home/dustin/disk_temp
/Bin/mail-s "Server 201: Disk Usage Attention" mobile phone number @ 139.com, wangzhen@ku888.com Sendmail-q;
Break;
Fi
Done

# Reprocessing send mail
# Sendmail-q

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.