Adding devices via discovery or by hand is not feasible for me. 

I have had success adding devices via REST calls, now I am testing XMLRPC 
calls. 
The procedure I am using is a slightly modified version of what is present in 
the dev. guide. I've changed 'yourhost' to 'localhost' and 'NEWDEVICE' to 
'localhost'.

In IDLE:
from xmlrpclib import ServerProxy
serv = ServerProxy('http://admin:[EMAIL PROTECTED]:8080/zport/dmd/DeviceLoader')
dev = {'deviceName':'localhost','devicePath':'/Server/Linux'}
serv.loadDevice(dev)

The output:
0

When I test to see whether the device exists, I get the error below and it does 
not appear in the web interface.

Traceback (most recent call last):
  File "<pyshell#5>", line 1, in <module>
    print serv.getManageIp()
  File "/usr/lib/python2.5/xmlrpclib.py", line 1147, in __call__
    return self.__send(self.__name, args)
  File "/usr/lib/python2.5/xmlrpclib.py", line 1437, in __request
    verbose=self.__verbose
  File "/usr/lib/python2.5/xmlrpclib.py", line 1201, in request
    return self._parse_response(h.getfile(), sock)
  File "/usr/lib/python2.5/xmlrpclib.py", line 1340, in _parse_response
    return u.close()
  File "/usr/lib/python2.5/xmlrpclib.py", line 787, in close
    raise Fault(**self._stack[0])
Fault: <Fault -1: 'Unexpected Zope exception: zExceptions.NotFound -  \n \n\n 
\n \n \n\n \n   Site Error \n   An error was encountered while publishing this 
resource.\n   \n    Resource not found  \n\n  Sorry, the requested resource 
does not exist. Check the URL and try again.   Resource:  
http://localhost:8080/zport/dmd/Devices/Server/Linux/devices/localhost \n   
\n\n   Troubleshooting Suggestions \n\n   \n   The URL may be incorrect. \n   
The parameters passed to this resource may be incorrect. \n   A resource that 
this resource relies on may be\n      encountering an error. \n   \n\n   For 
more detailed information about the error, please\n  refer to error log.\n   
\n\n   If the error persists please contact the site maintainer.\n  Thank you 
for your patience.\n   \n  \n '>

Any ideas?

Best,
Hugo




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

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

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



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

Reply via email to