X-Git-Url: http://xvm.mit.edu/gitweb/invirt/packages/xvm-munin-config.git/blobdiff_plain/a8cfb93c06c30653b497c6bce80f6f0b1261aee2..refs/tags/0.0.5:/host/usr/share/xvm-munin-host-config/plugins/xen_cpu diff --git a/host/usr/share/xvm-munin-host-config/plugins/xen_cpu b/host/usr/share/xvm-munin-host-config/plugins/xen_cpu index 755c476..2efffe4 100755 --- a/host/usr/share/xvm-munin-host-config/plugins/xen_cpu +++ b/host/usr/share/xvm-munin-host-config/plugins/xen_cpu @@ -3,9 +3,14 @@ from xen.xm.main import SERVER_LEGACY_XMLRPC, SERVER_XEN_API, parseServer, parseAuthentication from xen.xend import sxp import atexit +import sys serverType, serverURI = parseServer() +if serverType != SERVER_LEGACY_XMLRPC: + print >>sys.stderr, "xen_cpu is untested with this Xen server type" + sys.exit(1) + if serverType == SERVER_XEN_API: from xen.xm import XenAPI server = XenAPI.Session(serverURI) @@ -21,8 +26,6 @@ else: from xen.util.xmlrpcclient import ServerProxy server = ServerProxy(serverURI) -import sys - if len(sys.argv) > 1: cmd = sys.argv[1] else: