Created
June 19, 2012 18:02
-
-
Save gwynp/2955601 to your computer and use it in GitHub Desktop.
vmstat check for swapping
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/bash | |
| vmstat 5 1|tail -1|awk '{print $7,$8}' | while read vmstatResults; | |
| do | |
| SI=$(echo $vmstatResults | awk '{Print $1}') | |
| SO=$(echo $vmstatResults | awk '{Print $1}') | |
| if [[ $SI -gt 0 || $SO -gt 0 ]] | |
| then | |
| echo "swapping is showing as greater than zero in vmstat" | |
| return 1 | |
| else | |
| echo "vmstat is showing no swapping" | |
| return 0 | |
| fi | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment