AGN Feedback in Groups and Clusters of Galaxies