I found this monitoring script

checks and writes to file no problem but does not send email alerts
because there is nowhere to enter a password or username, this was written a long time ago when mail servers were left wide open and didn't need one

does anybody know how I could use sendmail localhost
I have a plesk server that requires a password and username to send smtp


I also found another monitoring script here

this one works really perfect and sends email alerts but does not write to a log file, if somone could show how I could get this to write to a log file as well
that would be perfect