if $hostname {
 $_hostname = $hostname
} else {
 $_hostname = "localhost"
}