Skip to content

Instantly share code, notes, and snippets.

@gwynp
Created June 19, 2012 18:02
Show Gist options
  • Save gwynp/2955601 to your computer and use it in GitHub Desktop.
Save gwynp/2955601 to your computer and use it in GitHub Desktop.

Revisions

  1. gwynp created this gist Jun 19, 2012.
    16 changes: 16 additions & 0 deletions vmstatCheck.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,16 @@
    #!/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