collectd: use uname to get default Hostname
authorYousong Zhou <yszhou4tech@gmail.com>
Fri, 9 Aug 2019 13:08:39 +0000 (13:08 +0000)
committerYousong Zhou <yszhou4tech@gmail.com>
Sat, 10 Aug 2019 01:52:22 +0000 (09:52 +0800)
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
utils/collectd/files/collectd.init

index 71993f60120217cd79e4ecdde87141a8bbc5bcf2..a9182380f48348f7fdc860d588394b0df1c7f2de 100644 (file)
@@ -189,7 +189,7 @@ process_config() {
        config_get ReadThreads globals ReadThreads 2
        printf "ReadThreads \"%s\"\n" "$ReadThreads" >> "$COLLECTD_CONF"
 
-       config_get Hostname globals Hostname "$(hostname)"
+       config_get Hostname globals Hostname "$(uname -n)"
        printf "Hostname \"%s\"\n" "$Hostname" >> "$COLLECTD_CONF"
 
        printf "\n" >> "$COLLECTD_CONF"