Hey there :-)
I am writing a Nagios plugin for checking virtual machines through a VCenter.
Problem is that if I try to create a client object like that:
self.client = Client(self['host'], self['user'], self['password'])
I got this error message:
<<<
...
self.client = Client(self['host'], self['user'], self['password'])
File "/usr/lib/python2.6/dist-packages/psphere/client.py", line 116, in __init__
self.login(self.username, self.password)
File "/usr/lib/python2.6/dist-packages/psphere/client.py", line 152, in login
self.sc.sessionManager.Login(userName=username, password=password)
File "/usr/lib/python2.6/dist-packages/psphere/__init__.py", line 354, in func
**kwargs)
File "/usr/lib/python2.6/dist-packages/psphere/client.py", line 184, in invoke
result = getattr(self.service, method)(_this=_this, **kwargs)
File "/usr/lib/pymodules/python2.6/suds/client.py", line 539, in __call__
return client.invoke(args, kwargs)
File "/usr/lib/pymodules/python2.6/suds/client.py", line 598, in invoke
result = self.send(msg)
File "/usr/lib/pymodules/python2.6/suds/client.py", line 633, in send
result = self.failed(binding, e)
File "/usr/lib/pymodules/python2.6/suds/client.py", line 684, in failed
r, p = binding.get_fault(reply)
File "/usr/lib/pymodules/python2.6/suds/bindings/binding.py", line 238, in get_fault
raise WebFault(p, faultroot)
suds.WebFault: Server raised fault: '
Unexpected element tag "ns0:_type" seen
while parsing MoRef for ManagedObject of type vmodl.ManagedObject
at line 5, column 9
while parsing call information for method Login
at line 4, column 6
while parsing SOAP body
at line 3, column 3
while parsing SOAP envelope
at line 1, column 0
while parsing HTTP request for method login
on object of type vim.SessionManager
at line 1, column 0'
>>>
I am sure that user and password are correct. While searching on the net I found this side:
https://bitbucket.org/jkinred/psphere/issue/13/examples-fail-with-vsphere-5what seems exactly like the err I got. Is there a solution?
Best whishes
Tobias