Reprint the original source of the articleIn the absence of nagios monitoring, as long as the server can be on the Internet, you can send e-mail to remind administrators of the use of system resources.First, write the Linux system warning mail script# vim/scripts/sys-warning.sh#!/bin/Bash#monitor the system load and CPU, memory, hard disk, log on the number of us
Let's share the following, the way to close the MySQL log
LNMP a key package installed MySQL default open MySQL log, if the site on the database read and write more frequently may generate a large number of logs, and occupy disk space, but also may lead to the VPS's hard disk idle space consumption full cause the database can not be opened.
The path to this tut
files, etc.1, #! /bin/sh means that this script uses/bin/sh to interpret execution;2. The writing of several control statements in shell scripts:[Plain]View Plaincopyprint?
While true;
Do
...
Done
While True;do...done[Plain]View Plaincopyprint?
For ...
Do
...
Done
For ... Do...done[Plain]View Plaincopyprint?
If
Then
Fi
If T
A shell script that counts CPU memory hard disk usage for everyone to learn reference#!/bin/bash#this Script isUse fordescrible CPU hard memery utilizationtotal=0Idle=0system=0User=0 Nice=0Mem=0vmexec=/usr/bin/Vmstatwhich SAR>/dev/NULL 2>1if[$?-ne0]then ver= ' Vmstat-v | Awk
Tags: int definition mod partition real-time background warning ash sizeReal-time monitoring of the local memory and the remaining space on the hard disk, the remaining memory is less than 500M, the root partition remaining space is less than 1000M send alarm message to the root administrator1 Writing scripts[Email protected] ~]# vim jiankong.sh#!/bin/bash#此脚本中数字
/secHdsentinelThis tool I installed a few times have problems, after the implementation of the information is very few, I think it is the problem of their own outfit, but repeatedly check nothing wrong, and then go directly to the official website to see, only to find that the Linux version does exist this problem, many systems or servers are not supported. But the version of Windows is still available. The author in reply to the Netizen said will continue to develop the Linux version, the lates
Tags: shell script partition usage detection#!/bin/baship=$ (ifconfig eth0 |grep "inet addr" | awk ' {print $} ' |cut-f1-d ":") a=$ (df-h |grep/dev/sda2 |awk ' {print $} ' |cut-f1 -B "%") #截取分区使用率If [$a-ge] then echo "$IP the server root partition is about to have no space, please clean it up in time. "|mail-s" $IP root partition detection "[email protected]FiHere I use 163 mailbox, related settings to see the link76038868 turn from CSDNThe above is o
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.