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 e399523 commit f302b60Copy full SHA for f302b60
server_monitor_resource.sh
@@ -0,0 +1,12 @@
1
+#!/bin/sh
2
+THRESHOLD=85
3
+df -H | grep -vE '^Filesystem|tmpfs|cdrom' | awk '{ print $5 " " $1 }' | while read output;
4
+do
5
+ echo $output
6
+ usep=$(echo $output | awk '{ print $1}' | cut -d'%' -f1 )
7
+ partition=$(echo $output | awk '{ print $2 }' )
8
+ if [ $usep -ge $THRESHOLD ]; then
9
+ echo "Running out of memory space \"$partition ($usep%)\" on $(hostname) as on $(date)" |
10
+ mail -s "Alert: Almost out of disk space $usep%" [email protected]
11
+ fi
12
+done
0 commit comments