Created
July 3, 2015 12:47
-
-
Save ilyaevseev/b568e35939353567444d to your computer and use it in GitHub Desktop.
Check free space on server and in OpenVZ containers
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
( df -h | tail -n +2 | |
df -i | tail -n +2 | |
awk '/^\/vz/ {print $2}' /proc/mounts | xargs -r df -h | tail -n +2 | |
awk '/^\/vz/ {print $2}' /proc/mounts | xargs -r df -i | tail -n +2 | |
) | grep -v ^none | egrep -v ' [ 1234567 ][0-9]% ' | sort | uniq \ | |
| mail -E -s 'Check-df warning' admins |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
( df -h | grep -v ^none | egrep -v ' [ 12345678][0-9]% ' | tail -n +2 | |
df -i | grep -v ^none | egrep -v ' [ 1234567 ][0-9]% ' | tail -n +2 | |
) | mail -E -s 'Check-df warning' admins |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment