By latest systems I would be referring to the "Recently Registered Systems"
list located at the bottom of the Overview page.
spacewalk-report inventory works (good enough) in a shell script I created
to compare the present date minus 7 days with :
spacewalk-report inventory | awk -F , '{print $2, $7}'
Since we have many spacewalk servers it would be nice to get a report
working that touched all the servers via the API however. I have begun
writing a ruby program for that propose:
#!/usr/bin/env ruby
require "xmlrpc/client"
@SATELLITE_URL =
@SATELLITE_LOGIN =
@SATELLITE_PASSWORD =
@client = XMLRPC::Client.new2(@SATELLITE_URL)
@key = @client.call('auth.login', @SATELLITE_LOGIN, @SATELLITE_PASSWORD)
systems = @client.call('system.listSystems', @key)
#p channels
ID=[]
for system in systems do
ID << system["id"]
end
ID.each { |x|
p @client.call('system.getDetails', @key, x.to_i)
}
@client.call('auth.logout', @key)
Once I can strip the xmlrpc output and stuff the hostname and formatted
date in to an array to compare to the present date it will be a more
elegant solution...
C. Tyler McAdams
Sr. Systems Engineer | Silverpop, an IBM Company
[email protected]
200 Galleria Parkway, Suite 1000, Atlanta GA 30339
From: Tomas Lestach <[email protected]>
To: [email protected]
Date: 08/07/2015 04:47 AM
Subject: Re: [Spacewalk-list] How can you use the API to find newly
added systems?
Sent by: [email protected]
> I need a way to run a report against the API to find the latest
> systems added to spacewalk. Is there a switch using spacewalk-report
> or spacecmd that will show the latest systems added... or maybe
> something else?
Well, what are 'the latest systems'?
'spacewalk-report inventory' returns also 'registration_time',
system.listSystems API call returns 'created' (registration time),
so you may filter according to these values.
Regards,
--
Tomas Lestach
Red Hat Satellite Engineering, Red Hat
_______________________________________________
Spacewalk-list mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/spacewalk-list
_______________________________________________
Spacewalk-list mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/spacewalk-list