If you liked Guards! Guards! (A Discworld Novel) by Terry Pratchett,
here are some books like this: