We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8d92e1e commit c004a02Copy full SHA for c004a02
diskspace.sh
@@ -0,0 +1,28 @@
1
+#!/bin/bash
2
+#Purpose: Monitoring Disk Space Utilization and Send Email Alert
3
+#Version:1.0
4
+#Created Date: Wed Jun 6 22:38:01 IST 2018
5
+#Modified Date:
6
+#WebSite: https://arkit.co.in
7
+#Author: Ankam Ravi Kumar
8
+# START #
9
+THRESHOULD=40
10
+mailto="root"
11
+HOSTNAME=$(hostname)
12
+
13
+for path in `/bin/df -h | grep -vE 'Filesystem|tmpfs' | awk '{print $5}' |sed 's/%//g'`
14
+do
15
+ if [ $path -ge $THRESHOULD ]; then
16
+ df -h | grep $path% >> /tmp/temp
17
+ fi
18
+done
19
20
+VALUE=`cat /tmp/temp | wc -l`
21
+ if [ $VALUE -ge 1 ]; then
22
+ mail -s "$HOSTNAME Disk Usage is Critical" $mailto < /tmp/temp
23
24
25
+#rm -rf /tmp/temp
26
27
28
+# END #
0 commit comments