A generation of building inspectors is about to retire and cities across the country are struggling to replace them.