• Please refer the below link,

    http://www.sqlservercentral.com/articles/Automating+SQL+Server+Health+Checks/68910/

    I hope it helps.

    Satnam