nagios-server: Handled case for hostname localhost

If the host name is passed as 'localhost' the plugin used to fail
as the check_ping plugin does not work. Corrected to figure out the
host IP in case localhost is passed and then call the further plugins

Signed-off-by: Shubhendu Tripathi <shtripat@redhat.com>