Hello All,
I am working on building a "live agent" to tie into Cobbler. Essentially, a new system is powered on, automatically PXE boots with this live agent, and would register itself to Cobbler, at which point a person can select the profile, and add in the customizations for ksmeta, and then reboot to be installed.
My problem is that I can't seem to find the proper object name for adding the mac address when registering the server. I get the error:
xmlrpclib.Fault: <Fault 1: "<class 'cobbler.cexceptions.CX'>:'object has no method: mac_address'">
The code snippet is:
def registerSelf(): mac = commands.getoutput("ifconfig eth0 | grep HWaddr | awk {'print $5'}") mem = commands.getoutput("cat /proc/meminfo | grep MemTotal | awk {'print $2 $3'}") cpu = commands.getoutput("cat /proc/cpuinfo | grep 'model name' | uniq | cut -f1,2 | awk {'print $0'}") numproc = commands.getoutput("cat /proc/cpuinfo | grep 'processor' | uniq ")
print "MAC: %s" % mac print "Memory: %s" % mem print "CPU: %s" % cpu
object = server.new_system(token) server.modify_system(object, "name", mac, token) server.modify_system(object, "profile", "Registration", token) server.modify_system(object, "mac_address", mac, token)
result = server.save_system(object, token)
I am trying to find where in the remote.py or any of the packages that has the correct naming for the model, so any help would be greatly appreciated.
Thanks,
Eric
Eric Raymond wrote:
Hello All,
I am working on building a "live agent" to tie into Cobbler. Essentially, a new system is powered on, automatically PXE boots with this live agent, and would register itself to Cobbler, at which point a person can select the profile, and add in the customizations for ksmeta, and then reboot to be installed.
Interesting, is this based on booting a customized Fedora live image?
My problem is that I can't seem to find the proper object name for adding the mac address when registering the server. I get the error:
xmlrpclib.Fault: <Fault 1: "<class 'cobbler.cexceptions.CX http://cobbler.cexceptions.CX'>:'object has no method: mac_address'">
The code snippet is:
def registerSelf(): mac = commands.getoutput("ifconfig eth0 | grep HWaddr | awk {'print $5'}") mem = commands.getoutput("cat /proc/meminfo | grep MemTotal | awk {'print $2 $3'}") cpu = commands.getoutput("cat /proc/cpuinfo | grep 'model name' | uniq | cut -f1,2 | awk {'print $0'}") numproc = commands.getoutput("cat /proc/cpuinfo | grep 'processor' | uniq ")
print "MAC: %s" % mac print "Memory: %s" % mem print "CPU: %s" % cpu object = server.new_system(token) server.modify_system(object, "name", mac, token) server.modify_system(object, "profile", "Registration", token) server.modify_system(object, "mac_address", mac, token) result = server.save_system(object, token)
The mac address is stored with the interface.
You can take a look at either remote.py (the tests at the bottom) or CobblerWeb.py to see how the web application is modifying the interface data.
Essentially you have to send a hash down with the interface information as opposed to addressing the mac address directly. Each cobbler system can have more than one mac address, hence the complexity, and also now interfaces can have arbitrary names.
--Michael
I am trying to find where in the remote.py or any of the packages that has the correct naming for the model, so any help would be greatly appreciated.
Thanks,
Eric
cobbler mailing list cobbler@lists.fedorahosted.org https://fedorahosted.org/mailman/listinfo/cobbler
grep rather than cat | grep
sort | uniq rather than just uniq
- Dave
cobbler-bounces@lists.fedorahosted.org wrote on 01/13/2009 02:11:08 PM:
Eric Raymond wrote:
Hello All,
I am working on building a "live agent" to tie into Cobbler. Essentially, a new system is powered on, automatically PXE boots with this live agent, and would register itself to Cobbler, at which point a person can select the profile, and add in the customizations for ksmeta, and then reboot to be installed.
Interesting, is this based on booting a customized Fedora live image?
My problem is that I can't seem to find the proper object name for adding the mac address when registering the server. I get the error:
xmlrpclib.Fault: <Fault 1: "<class 'cobbler.cexceptions.CX http://cobbler.cexceptions.CX'>:'object has no method:
mac_address'">
The code snippet is:
def registerSelf(): mac = commands.getoutput("ifconfig eth0 | grep HWaddr | awk {'print $5'}") mem = commands.getoutput("cat /proc/meminfo | grep MemTotal | awk {'print $2 $3'}") cpu = commands.getoutput("cat /proc/cpuinfo | grep 'model name' | uniq | cut -f1,2 | awk {'print $0'}") numproc = commands.getoutput("cat /proc/cpuinfo | grep 'processor'
| uniq ")
print "MAC: %s" % mac print "Memory: %s" % mem print "CPU: %s" % cpu object = server.new_system(token) server.modify_system(object, "name", mac, token) server.modify_system(object, "profile", "Registration", token) server.modify_system(object, "mac_address", mac, token) result = server.save_system(object, token)
The mac address is stored with the interface.
You can take a look at either remote.py (the tests at the bottom) or CobblerWeb.py to see how the web application is modifying the interface data.
Essentially you have to send a hash down with the interface information as opposed to addressing the mac address directly. Each cobbler system
can have more than one mac address, hence the complexity, and also now interfaces
can have arbitrary names.
--Michael
I am trying to find where in the remote.py or any of the packages that
has the correct naming for the model, so any help would be greatly appreciated.
Thanks,
Eric
------------------------------------------------------------------------
cobbler mailing list cobbler@lists.fedorahosted.org https://fedorahosted.org/mailman/listinfo/cobbler
cobbler mailing list cobbler@lists.fedorahosted.org https://fedorahosted.org/mailman/listinfo/cobbler
On Tue, Jan 13, 2009 at 11:33 AM, David Quenzler quenzler@us.ibm.com wrote:
grep rather than cat | grep
sort | uniq rather than just uniq
- Dave
<sarcasm>When you are attempting to school someone please do it right. </sarcasm>
sort -u rather than sort | uniq
Jeff Schroeder wrote:
On Tue, Jan 13, 2009 at 11:33 AM, David Quenzler quenzler@us.ibm.com wrote:
grep rather than cat | grep
sort | uniq rather than just uniq
- Dave
<sarcasm>When you are attempting to school someone please do it right.
</sarcasm>
sort -u rather than sort | uniq
I'd write an Python function to do it!
</ducks>
On Tue, 13 Jan 2009 15:15:02 -0500, Michael DeHaan mdehaan@redhat.com wrote:
Jeff Schroeder wrote:
On Tue, Jan 13, 2009 at 11:33 AM, David Quenzler quenzler@us.ibm.com wrote:
grep rather than cat | grep
sort | uniq rather than just uniq
- Dave
<sarcasm>When you are attempting to school someone please do it right.
</sarcasm>
sort -u rather than sort | uniq
I'd write an Python function to do it!
</ducks>
I thought I had unsubscribed from LKML...
cobbler@lists.fedorahosted.org