Readaility: Factor out the warning for readable lines, and use a different delimiter for `s///` not to have to escape slashes:

    WARNING="# If you change hostname please delete /var/lib/collectd/WebYaST"
    sed -i "s@^#Hostname[[:space:]].*@$WARNING\nHostname \"WebYaST\"@" /etc/collectd.conf