import socket
socket.setdefaulttimeout(10)
try:
from xenapi import XenAPI
except:
import XenAPI
def __run__(params):
for i in range(3):
try:
xapi = XenAPI.xapi_local();
xapi.xenapi.login_with_password("","")
except Exception, e:
continue
else:
xapi.xenapi.session.logout()
return [0, "OK"]
return [2,'CRITICAL: %s' % repr(e)]