<div dir="ltr">H William, thanks for response<div>no it doesn't make any sence. I was walking about renaming machine name in the SP if actual host was changed. </div><div><br></div><div>Thanks!</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, May 4, 2016 at 6:29 AM, William H. ten Bensel <span dir="ltr"><<a href="mailto:WHTENBEN@up.com" target="_blank">WHTENBEN@up.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><font size="2" face="sans-serif">I am making the assumption that you are
referring to the spacewalk profile id, let say abc123 and the hostname
is now xyz123:<br></font><br><font size="2" face="sans-serif"><br>On server/device /etc/sysconfig/rhn/systemid will have the abc123:</font><br><font size="2" face="sans-serif"><br><name>profile_name</name></font><br><font size="2" face="sans-serif"><value><string><b>abc123</b></string></value><br></font><br><br><font size="2" face="sans-serif">Now you want to rename the spacewalk
profile:</font><br><br><font size="2" face="sans-serif">        #
spacecmd -s spacewalk.domain  <br>        spacemcd >> system_rename abc123
xyz123</font><br><br><font size="2" face="sans-serif">Re-register/reactivate: (2 ways of doing
this)</font><br><br><font size="2" face="sans-serif">1. Via UI and Server.<br>        GO to the server in spacewalk ->
reactivation -> Generate key.</font><br><font size="2" face="sans-serif">        ON
the server:</font><br><font size="2" face="sans-serif">         rhnreg_ks
--force --serverUrl=<a href="https://spacewalk.domain/XMLRPC" target="_blank">https://spacewalk.domain/XMLRPC</a> --sslCACert=/usr/share/rhn/RHN-ORG-TRUSTED-SSL-CERT
--activationkey=key-from-gui</font><br><font size="2" face="sans-serif">        Validate:</font><br><font size="2" face="sans-serif">        /etc/sysconfig/rhn/systemid
---> <br></font><br><font size="2" face="sans-serif">2.   Write a perl/python/java script
which runs on the server/device (or you can schedule a script run to re-register
with the activation key) that does something like the following (Sorry:
not the full code)</font><br><br><font size="2" face="sans-serif">        system_id
= "/etc/sysconfig/rhn/systemid"</font><br><font size="2" face="sans-serif">        rhn_cert
= "/usr/share/rhn/RHN-ORG-TRUSTED-SSL-CERT"</font><br><font size="2" face="sans-serif">        keys = sys.argv[1:]</font><br><br><font size="2" face="sans-serif">        if os.path.exists(rhn_cert):</font><br><font size="2" face="sans-serif">           
    for line in open(rhn_cert):</font><br><font size="2" face="sans-serif">           
            if "OU=<u>xxxxx</u>="
in line:</font><br><font size="2" face="sans-serif">           
                    http_server=line.split("OU=<u>xxxx</u>=")[-1]</font><br><font size="2" face="sans-serif">           
                    http_server=str(http_server.rstrip())</font><br><font size="2" face="sans-serif">           
                    http_xml="http://"
+ http_server + "/XMLRPC"</font><br><font size="2" face="sans-serif">           
                    http_server="http://"
+ http_server + "/rpc/api"</font><br><font size="2" face="sans-serif">           
    if not http_server:</font><br><font size="2" face="sans-serif">           
            http_server="</font><a href="http://uprrsat.sos.tla.uprr.com/rpc/api" target="_blank"><font size="2" color="blue" face="sans-serif"><u>http://xxxxxx/rpc/api</u></font></a><font size="2" face="sans-serif">"</font><br><br><font size="2" face="sans-serif">        if os.path.exists(system_id):</font><br><font size="2" face="sans-serif">           
    if os.path.exists(system_id):</font><br><font size="2" face="sans-serif">           
            client = xmlrpclib.Server(http_server)</font><br><font size="2" face="sans-serif">           
            keys.append(client.system.obtain_reactivation_key(open(system_id).read()))</font><br><br><br><font size="2" face="sans-serif">        command
= "rhnreg_ks --force --activationkey=" + string.join(keys, ",")</font><br><font size="2" face="sans-serif">        os.system(command)</font><br><br><br><font size="2" face="sans-serif">- Thanks and good luck</font><br><br><br><br><br><font size="1" color="#5f5f5f" face="sans-serif">From:      
 </font><font size="1" face="sans-serif">Konstantin Raskoshnyi
<<a href="mailto:konrasko@gmail.com" target="_blank">konrasko@gmail.com</a>></font><br><font size="1" color="#5f5f5f" face="sans-serif">To:      
 </font><font size="1" face="sans-serif"><a href="mailto:spacewalk-list@redhat.com" target="_blank">spacewalk-list@redhat.com</a></font><br><font size="1" color="#5f5f5f" face="sans-serif">Date:      
 </font><font size="1" face="sans-serif">05/04/2016 01:46 AM</font><br><font size="1" color="#5f5f5f" face="sans-serif">Subject:    
   </font><font size="1" face="sans-serif">[Spacewalk-list]
Update hosts names in SP</font><br><font size="1" color="#5f5f5f" face="sans-serif">Sent by:    
   </font><font size="1" face="sans-serif"><a href="mailto:spacewalk-list-bounces@redhat.com" target="_blank">spacewalk-list-bounces@redhat.com</a></font><br><hr noshade><br><br><br><font size="3">This email originated from outside of the company. Please
use discretion if opening attachments or clicking on links.</font><hr><font size="3"> </font><p><span class=""><font size="3">If I run rhn-profile-sync on hosts then if I click on  a
host in SP I see the actual hostname.</font><br><br><font size="3">But does spacewalk has a mechanism to update the host
name in SP and set in equal to actual hostname?</font><br></span><font size="3">THanks</font><tt><font size="2">This email originated from
outside of the company.  Please use discretion if opening attachments
or clicking on links.<br><br>_______________________________________________<br>Spacewalk-list mailing list<br><a href="mailto:Spacewalk-list@redhat.com" target="_blank">Spacewalk-list@redhat.com</a><br></font></tt><a href="https://www.redhat.com/mailman/listinfo/spacewalk-list" target="_blank"><tt><font size="2">https://www.redhat.com/mailman/listinfo/spacewalk-list</font></tt></a><br><br>
<br>
<br>
**<br>
<br>
<br>
<br>
This email and any attachments may contain information that is confidential and/or privileged for the sole use of the intended recipient.  Any use, review, disclosure, copying, distribution or reliance by others, and any forwarding of this email or its contents, without the express permission of the sender is strictly prohibited by law.  If you are not the intended recipient, please contact the sender immediately, delete the e-mail and destroy all copies.<br>
<br>
**<br></p><br>_______________________________________________<br>
Spacewalk-list mailing list<br>
<a href="mailto:Spacewalk-list@redhat.com">Spacewalk-list@redhat.com</a><br>
<a href="https://www.redhat.com/mailman/listinfo/spacewalk-list" rel="noreferrer" target="_blank">https://www.redhat.com/mailman/listinfo/spacewalk-list</a><br></blockquote></div><br></div>