Whenever necessary to make an inspection to enforce any of the provisions of this chapter, or whenever the building official has reasonable cause to believe that there exists in any building or upon any premises any condition or code violation which makes such building, structure, premises, electrical, gas, mechanical or plumbing system unsafe, dangerous or hazardous, the building official may enter such building, structure or premises at all reasonable times to inspect the same or to perform any duty imposed upon the building official by these standard building codes, provided that if such building or premises is occupied, he shall first make a reasonable effort to locate the owner or other persons having charge or control of such and request entry. If entry is refused, the building official shall have recourse to every remedy provided by law to secure entry, including inspection warrants or search warrants. No warrant shall be required to investigate visible and open violations or uses.