### VMware ESX kernel vmknic stats ### Displays VMkernel port statistics on VMware ESX servers ### ### Authority: bert+dstat@debruijn.be # NOTE TO USERS: command-line plugin configuration is not yet possible, so I've # "borrowed" the -N argument. # EXAMPLES: # # dstat --vmknic -N vmk1 # You can even combine the Linux and VMkernel network stats (just don't just "total"). # # dstat --vmknic -n -N vmk0,vswif0 # NB Data comes from /proc/vmware/net/tcpip/ifconfig class dstat_plugin(dstat): def __init__(self): self.name = 'vmknic' self.open('/proc/vmware/net/tcpip/ifconfig') self.nick = ('recv', 'send') self.cols = 2 def check(self): try: os.listdir('/proc/vmware') except: raise Exception, 'Needs VMware ESX' info(1, 'The vmknic module is an EXPERIMENTAL module.') def discover(self, *list): ret = [] for l in self.fd[0].splitlines(replace=' /', delim='/'): if len(l) != 12: continue if l[2][:5] == '