Emailing a potential PI about applying to a Master's program at their school
Yes, you should contact them.

In terms of the content, you have it half right. Do briefly discuss your interests and why you think you would be a good fit for this lab.  Then simply ask, are you taking graduate students for the next term? 

However, I would say do not ask for advice in general.  That is a bit much and these PIs are busy and won't want to spend the time providing advice for a student they do not know. Keep your email as concise and clear as possible to ensure a response.

Finally, if a professor is a good match for your interests, you should email them even they do not have any openings currently listed on their website. Again, they are busy, they may not have updated their website recently. Or, they may have just received notice that they got a new grant. etc, and so on.  If they are a good match for your interests, it is worth emailing them. 

Good luck.