Hi,
I am not sure if I should post this as a new topic or it should go into one of 
the existing threads.If it does need to be moved, forum admins please feel free 
to do so.

I have successfully used wget to add devices on the command line with for 
loops, etc. This is great and does save some significant time but nothing is 
ever enough, right?
I wanted to know why every time I tried the code snipper posted on the twiki 
here: http://dev.zenoss.org/trac/wiki/HowToAddDevice doesn't work for me.
so I tried it from ruby using the xmlrpc component that ships with it.
I wrote this code :

require 'xmlrpc/client'
require 'net/http'
begin
server = XMLRPC::Client.new('zenoss.server','/zport/dmd/DeviceLoader', 8080)
server.user="user"
server.password="password"
device = {'deviceName' => "testdevice.net", 'devicePath' =>  "/Server/Linux" }
puts device['deviceName']
puts device['devicePath']
response =server.call('loadDevice',device)
rescue XMLRPC::FaultException => e
puts "Error: "
puts e.faultCode
puts e.faultString
end
and when I ran it I saw that the LoadDevice couldn't parse the hash correctly. 
and gave me the error :<td>zen.DeviceLoader</td><td>load of device 
{'devicePath': '/Server/Linux', 'deviceName': 'testdevice.net'} failed</td>
If I change the server.call to use something like
response = server.call('loadDevice',device['deviceName'],device['devicePath'])
Everything worked.

I tried this from perl to make sure this is not a rubyism. i had the same 
result.
Can anyone from the developers look quick into this and update the wiki page to 
be accurate.

Regards

------------------------
 Mohamed Hussein




-------------------- m2f --------------------

Read this topic online here:
http://community.zenoss.com/forums/viewtopic.php?p=4494#4494

-------------------- m2f --------------------



_______________________________________________
zenoss-users mailing list
[email protected]
http://lists.zenoss.org/mailman/listinfo/zenoss-users

Reply via email to