Correct the IP check logic to check the right node

I had it checking the Nagios server's attributes before when I wanted
the search discovered node
Merge pull request #140 from tas50/COOK-2257

COOK-2257: Correct the IP check logic to check the right node