So, sometimes I write scripts to be a quick way to monitor or audit other systems. The following script was written as a way to quickly audit a list of domain names, i.e. from a list of 1 domain per line. Initially it was used to audit a list of subdomains from a nettica account to see if the name still resolved and if so, determine if the server was running ssh with a valid key. I have realized the script has a lot of uses, as a way to validate hosts are up and also validate ssh is running. You could also replace the “ls” command in order to monitor other services on a server or even top or similar. So, this script could start as a foundation and easily expanded upon.
First, you need a text file containing 1 domain name per line, like this:
domain1.com
domain2.com
domain3.com
sub.domain4.com