If any county, county district, or municipal officer who has executed bond for the faithful performance of duty shall knowingly or wilfully fail, neglect, or refuse to perform any duty required of him by law or shall violate his official obligations in any respect, the president or, in the absence or disability or default of the president, the vice-president of the board of supervisors in case of a county or county district officer, and the mayor in case of a municipal officer, or any person interested in either case shall cause suit to be brought on the bond of such officer for the recovery of the damages that may have been sustained thereby.