def ambari_configs(): run_calc(POS_VALUE[0]) print(chr(27) + "[2J") print("===================================") print(" Ambari Configurations ") print("===================================") pprinttable(AMBARI_CONFIGS, DISPLAY_COLUMNS) ambaricalls = ambariRestCalls() print("===================================") print(" Ambari REST Call Configurations ") print("===================================") if ISSUE_MESSAGES > 0: environment_status() else: for line in ambaricalls: print line manual = manualCfgs() if len(manual) > 0: print("===================================") print(" Manual Configurations ") print("===================================") for cfg in manual: print("Manual Configuration: {0} [{1}]".format( cfg[POS_SHORT_DESC[0]], cfg[POS_VALUE[0]])) print("") raw_input("press enter...")
def logical_display(): run_calc(POS_VALUE[0]) global LOGICAL_CONFIGS pprinttable(LOGICAL_CONFIGS, DISPLAY_COLUMNS) print("") environment_status() print("") raw_input("press enter...")
def rpt_count_type(type, count_type): # master = datanode & compute print type fields = [[0, 'Count'], [1, 'Memory'], [2, 'Cores']] count_type_rows = [] for key in count_type: count_type_record = [ count_type[key]['count'], count_type[key]['memory'], count_type[key]['cores'] ] count_type_rows.append(count_type_record) pprinttable(count_type_rows, fields)
def rpt_totals(hosttable): totalFields = [[0, "Type"], [1, "Count"], [2, "OS"], [3, "CPU-Min"], [4, "CPU-Max"], [5, "Mem-Min"], [6, "Mem-Max"]] totalType = [] datanodes = ["Data Nodes", 0, [], 10000, 0, 100000, 0] for record in hosttable: if record[5]: datanodes[1] += 1 if (record[2] not in datanodes[2]): datanodes[2].append(record[2]) # CPU Min if record[1] < datanodes[3]: datanodes[3] = record[1] # CPU Max if record[1] > datanodes[4]: datanodes[4] = record[1] # Mem Min if record[3] < datanodes[5]: datanodes[5] = record[3] # Mem Max if record[3] > datanodes[6]: datanodes[6] = record[3] totalType.append(datanodes) computeNodes = ["Compute Nodes", 0, [], 10000, 0, 100000, 0] for record in hosttable: if record[6]: computeNodes[1] += 1 if (record[2] not in computeNodes[2]): computeNodes[2].append(record[2]) # CPU Min if record[1] < computeNodes[3]: computeNodes[3] = record[1] # CPU Max if record[1] > computeNodes[4]: computeNodes[4] = record[1] # Mem Min if record[3] < computeNodes[5]: computeNodes[5] = record[3] # Mem Max if record[3] > computeNodes[6]: computeNodes[6] = record[3] totalType.append(computeNodes) pprinttable(totalType, totalFields)
def rpt_hosttable(hosttable): # master = datanode & compute fields = [[0, 'Host'], [1, 'CPU Count'], [2, 'OS'], [3, 'Memory'], [4, 'Rack'], [5, 'Data Node'], [6, 'Compute Node']] pprinttable(hosttable, fields)
def rpt_hosttable(hosttable): # master = datanode & compute fields = [[0, "Host"], [1, "CPU Count"], [2, "OS"], [3, "Memory"], [4, "Rack"], [5, "Data Node"], [6, "Compute Node"]] pprinttable(hosttable, fields)