In case anyone else likes ruby, someone posted a link to a ruby script that does similar checks the other day on HN.
https://gist.github.com/schmich/aeaffac922271a11b70e9a79a5fe...