--- zabbix_sender.c	2010-06-19 19:31:25.000000000 +0200
+++ zabbix_sender.c.hostname	2010-06-19 19:31:07.000000000 +0200
@@ -490,6 +490,11 @@
 				continue;
 			}
 
+			/* If hostname = "-" then replace with hostname from config */
+			if (strcmp("-",hostname) == 0 && ZABBIX_HOSTNAME ) {
+				zbx_strlcpy(hostname, ZABBIX_HOSTNAME, sizeof(hostname));
+			}
+
 			zbx_rtrim(key_value, "\r\n");
 
 			zbx_json_addobject(&sentdval_args.json, NULL);
