[Spacewalk-list] Duplicate system ID
Thomas Foster
thomas.foster80 at gmail.com
Mon May 20 15:00:46 UTC 2013
I have used the following to test for servers with the same id in
satellite...possibly could work for you..or could help you out.
#!/usr/bin/python
import xmlrpclib,sys
import socket
SATELLITE_URL = "http://<put the name of your satellite servers full
url..ex vasat.com>/rpc/api"
#User account to connect to satellite server
SATELLITE_LOGIN = "<user login for satellite server>"
#Password for above connection
SATELLITE_PASSWORD = "password for satellite user"
#Accept an argument
SERVENAME = sys.argv
try:
client = xmlrpclib.Server(SATELLITE_URL, verbose=0)
key = client.auth.login(SATELLITE_LOGIN, SATELLITE_PASSWORD)
except socket.gaierror:
#print SATELLITE_URL + " does not exits."
sys.exit(2)
list = client.system.listUserSystems(key)
#Loop through list and return server name that's matched
for system in list:
#if the server name exists in the server then delete it
if system.get('name') in (SERVENAME):
#print "Found the server " + system.get('name')
#print "System ID is " + `system.get('id')`
#print "Deleting system from satellite server"
returncode = client.system.deleteSystems(key,system.get('id'))
#print returncode
client.auth.logout(key)
On Mon, May 20, 2013 at 10:52 AM, Coffman, Anthony J <
Tony.Coffman at snapon.com> wrote:
> Is there an easy way in Spacewalk to detect duplicate system IDs
> checking in with different hostnames?****
>
> ** **
>
> Occasionally we’ll screw up a VM clone and end up with a new hostname but
> the same systemid. In that case the duplicate won’t show up in Duplicate
> Systems and it can be somewhat difficult to spot until a scheduled action
> fails or acts in an otherwise surprising way or we spot it in an audit
> (compare Spacewalk inventory to other inventory DBs).****
>
> ** **
>
> Regards,****
>
> --Tony****
>
> ** **
>
> _______________________________________________
> Spacewalk-list mailing list
> Spacewalk-list at redhat.com
> https://www.redhat.com/mailman/listinfo/spacewalk-list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/spacewalk-list/attachments/20130520/a0a62761/attachment.htm>
More information about the Spacewalk-list
mailing list