adding code to monitor resource usage and HAproxy status