various refactoring for nagios to make it more generic and added check_puppetd_lock plugin