### 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 -M vmknic -N vmk1 # You can even combine the Linux and VMkernel network stats (just don't just "total"). # # dstat -M vmknic -n -N vmk0,vswif0 # NB Data comes from /proc/vmware/net/tcpip/ifconfig class dstat_vmknic(dstat): def __init__(self): self.name = 'vmknic' self.format = ('f', 5, 1024) self.open('/proc/vmware/net/tcpip/ifconfig') self.nick = ('recv', 'send') self.discover = self.discover() self.vars = self.vars() self.name = ['net/'+name for name in self.vars] self.init(self.vars + ['total',], 2) def discover(self, *list): ret = [] for line in self.fd[0].readlines(): l = line.replace(' /','/').split() if len(l) != 12: continue if l[2][:5] == '