move functionality to get nagios data into helper function