There are various different derivatives of Linux, Unix etc. out there. Each have different ways to check for such things you listed.
Depending on that, it can be much more thanjust a little script to check out different conditions and to interpret them correctly etc.
Try to write a script yourself and if you have particular problem, don't hesitate to ask.
For checking the result of exit codes, you only need some basic knowledge of shell scripting. Also for sending mails there is still the help of the search function of this forum since this is a very common question being asked here.
I change the subject since it is not very descriptive. When opening threads in future, please use some more descriptive subjects so that people that search for similar topics have it much easier to find them, thank you.