[COOK-4104] Use private IP of nodes if in same aws vpc, else use public IP

The purpose of this PR is to allow a nagios host located in an AWS VPC to monitor hosts outside the VPC using their public IP. 

Without this, it will try to use their private IP which will not work.