reorganized a bit; added check-icinga-errors function