#!/usr/bin/python # Author: Tristan Suerink # Version: Ipmi Plugin 1.0 for QuatView import sys, socket import elementtree.ElementTree as ET import os, glob # Get the variable from the commandline infile = sys.argv[1:] # Parse the XML tree = ET.parse(infile[0]) elem = tree.getroot() # Get the hostname from the XML Template hostname = elem.find("system/network/hostname").text try: print socket.getaddrinfo("%s.ipmi.nikhef.nl" % (hostname), None)[0][4][0] except: print "NULL"