Write correct 'mon_host' with IPv6 addresses

When the IP-address from a monitor is a IPv6 address, encapsulate
it with [ and ]

Fixes: #8309