From b8d802f54db7cb7843fae882e195af6d989bb36d Mon Sep 17 00:00:00 2001 From: xiaoshun Date: Thu, 30 May 2024 20:46:53 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E6=96=87=E4=BB=B6=E8=87=B3?= =?UTF-8?q?=20/?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 检测分区使用率是否过高.txt | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 检测分区使用率是否过高.txt diff --git a/检测分区使用率是否过高.txt b/检测分区使用率是否过高.txt new file mode 100644 index 0000000..e24cc45 --- /dev/null +++ b/检测分区使用率是否过高.txt @@ -0,0 +1,10 @@ +#!/usr/bin/bash +# +#by fuxiaoshun 4/1 +time=`date +%F-%T` +a=`df -h | awk NR==6'{print $5}'` +if [ ${a%\%*} -ge 1 ];then + echo "$time告警,/分区使用不足" >>/tmp/1.txt +else + echo "/分区内存足够" +fi \ No newline at end of file