Remove IPMI stuff from keepalive message and add to startup; convert memory into MB
This commit is contained in:
parent
266db3f66a
commit
181bd1f2b8
|
@ -185,8 +185,8 @@ class NodeInstance():
|
||||||
# Set our information in zookeeper
|
# Set our information in zookeeper
|
||||||
self.name = conn.getHostname()
|
self.name = conn.getHostname()
|
||||||
self.cpucount = conn.getCPUMap()[0]
|
self.cpucount = conn.getCPUMap()[0]
|
||||||
self.memused = psutil.virtual_memory().used / 1024 / 1024
|
self.memused = int(psutil.virtual_memory().used / 1024 / 1024)
|
||||||
self.memfree = psutil.virtual_memory().free / 1024 / 1024
|
self.memfree = int(psutil.virtual_memory().free / 1024 / 1024)
|
||||||
self.cpuload = os.getloadavg()[0]
|
self.cpuload = os.getloadavg()[0]
|
||||||
self.domains_count = len(conn.listDomainsID())
|
self.domains_count = len(conn.listDomainsID())
|
||||||
keepalive_time = int(time.time())
|
keepalive_time = int(time.time())
|
||||||
|
@ -206,7 +206,7 @@ class NodeInstance():
|
||||||
|
|
||||||
# Display node information to the terminal
|
# Display node information to the terminal
|
||||||
ansiiprint.echo('{}{} keepalive{}'.format(ansiiprint.purple(), self.name, ansiiprint.end()), '', 't')
|
ansiiprint.echo('{}{} keepalive{}'.format(ansiiprint.purple(), self.name, ansiiprint.end()), '', 't')
|
||||||
ansiiprint.echo('{0}CPUs:{1} {2} {0}Free memory [MiB]:{1} {3} {0}Used memory [MiB]:{4} {0}Load:{1} {5} {0}IPMI Address:{1} {6}'.format(ansiiprint.bold(), ansiiprint.end(), self.cpucount, self.memfree, self.memused, self.cpuload, self.ipmi_hostname), '', 'c')
|
ansiiprint.echo('{0}CPUs:{1} {2} {0}Free memory [MiB]:{1} {3} {0}Used memory [MiB]:{1} {4} {0}Load:{1} {5}'.format(ansiiprint.bold(), ansiiprint.end(), self.cpucount, self.memfree, self.memused, self.cpuload), '', 'c')
|
||||||
ansiiprint.echo('{}Active domains:{} {} [{}]'.format(ansiiprint.bold(), ansiiprint.end(), self.domains_count, ','.join(self.domain_list)), '', 'c')
|
ansiiprint.echo('{}Active domains:{} {} [{}]'.format(ansiiprint.bold(), ansiiprint.end(), self.domains_count, ','.join(self.domain_list)), '', 'c')
|
||||||
|
|
||||||
# Update our local node lists
|
# Update our local node lists
|
||||||
|
|
2
pvcd.py
2
pvcd.py
|
@ -144,6 +144,8 @@ else:
|
||||||
zk.create('/nodes/{}/ipmiusername'.format(myhostname), config['ipmi_username'].encode('ascii'))
|
zk.create('/nodes/{}/ipmiusername'.format(myhostname), config['ipmi_username'].encode('ascii'))
|
||||||
zk.create('/nodes/{}/ipmipassword'.format(myhostname), config['ipmi_password'].encode('ascii'))
|
zk.create('/nodes/{}/ipmipassword'.format(myhostname), config['ipmi_password'].encode('ascii'))
|
||||||
|
|
||||||
|
print('IPMI hostname: {}'.format(config['ipmi_hostname']))
|
||||||
|
|
||||||
t_node = dict()
|
t_node = dict()
|
||||||
s_domain = dict()
|
s_domain = dict()
|
||||||
node_list = []
|
node_list = []
|
||||||
|
|
Loading…
Reference in New Issue