def get_dmdbstatus_v(self): try: status, result = commands.getstatusoutput( "dmdb_status -v | sed '1,5d' | sed '$d'") # status, result = commands.getstatusoutput("dmdb_status -v | sed '1,5d' | sed '$d'") if (status == 0): data = "" for line in result.splitlines(): nodeinfo = ' '.join(line.split()).strip() nodename = nodeinfo.split(" ")[0] data += MonitorInfo("dmdb_node_master", "dmdb master node", "nodename", nodename, nodeinfo.split(" ")[1]).printInfo() data += MonitorInfo("dmdb_node_slave", "dmdb slave node", "nodename", nodename, nodeinfo.split(" ")[2]).printInfo() data += MonitorInfo("dmdb_node_master_status", "dmdb master node status", "nodename", nodename, nodeinfo.split(" ")[3]).printInfo() data += MonitorInfo("dmdb_node_slave_status", "dmdb slave node status", "nodename", nodename, nodeinfo.split(" ")[4]).printInfo() except Exception as err: print err data = str(err) return data
def get_dmdbstatus_y(self): try: result = os.popen("dmdb_status -y | sed '1,5d' | sed '$d'") res = result.read() data = "" for line in res.splitlines(): nodeinfo = ' '.join(line.split()).strip() nodename = nodeinfo.split(" ")[0] data += MonitorInfo( "dmdb_synchronize_process_master_status", "dmdb synchronize process master node status", "nodename", nodename, nodeinfo.split(" ")[1]).printInfo() data += MonitorInfo( "dmdb_synchronize_process_slave1_status", "dmdb synchronize process slave1 node status", "nodename", nodename, nodeinfo.split(" ")[2]).printInfo() if (len(nodename) > 3): data += MonitorInfo( "dmdb_synchronize_process_slave2_status", "dmdb synchronize process slave node status", "nodename", nodename, nodeinfo.split(" ")[2]).printInfo() result.close() except Exception as err: print err data = str(err) return data
def get_dmdbha_v_all(self): try: result = os.popen("dmdb_ha -v all | sed '1,4d' | sed '$d'") res = result.read() data = "" for line in res.splitlines(): nodeinfo = ' '.join(line.split()).strip() nodename = nodeinfo.split(" ")[0] data += MonitorInfo( "dmdb_duplicate_node_status", "dmdb duplicate node status(0:normal 1:standby 2:maintenance 9:toswitch)", "nodename", nodename, nodeinfo.split(" ")[1]).printInfo() data += MonitorInfo("dmdb_duplicate_applications", "how many applications connected dmdb", "nodename", nodename, nodeinfo.split(" ")[2]).printInfo() result.close() except Exception as err: print err data = str(err) return data
def get_dmdbstatus_j(self): try: result = os.popen("dmdb_status -j | sed '1,5d' | sed '$d'") res = result.read() data = "" for line in res.splitlines(): nodeinfo = ' '.join(line.split()).strip() nodename = nodeinfo.split(" ")[0] data += MonitorInfo( "dmdb_duplicate_overstock_master_slave_status", "dmdb duplicate overstock from master to slave status", "nodename", nodename, nodeinfo.split(" ")[1]).printInfo() data += MonitorInfo( "dmdb_duplicate_overstock_slave_master_status", "dmdb duplicate overstock from slave to master status", "nodename", nodename, nodeinfo.split(" ")[2]).printInfo() result.close() except Exception as err: print err data = str(err) return data
def get_dmdbparam_max_client(self): try: result = os.popen("dmdb_param get MAX_CLIENT | sed '$d'") res = result.read() data = "" for line in res.splitlines(): nodeinfo = ' '.join(line.split()).strip() nodename = nodeinfo.split(" ")[0] data += MonitorInfo("dmdb_param_max_client", "dmdb param max client", "nodename", nodename, nodeinfo.split(" ")[4]).printInfo() result.close() except Exception as err: print err data = str(err) return data
def get_dmdbstatus_m(self): try: result = os.popen("dmdb_status -m | sed '1,5d' | sed '$d'") res = result.read() data = "" for line in res.splitlines(): nodeinfo = ' '.join(line.split()).strip() nodename = nodeinfo.split(" ")[0] data += MonitorInfo("dmdb_memory_share_flag", "dmdb memory share flag", "nodename", nodename, nodeinfo.split(" ")[1]).printInfo() data += MonitorInfo("dmdb_memory_utc_create", "dmdb memory utc create", "nodename", nodename, nodeinfo.split(" ")[2]).printInfo() data += MonitorInfo("dmdb_memory_total", "dmdb memory total(M)", "nodename", nodename, nodeinfo.split(" ")[3]).printInfo() data += MonitorInfo("dmdb_memory_used", "dmdb memory used(M)", "nodename", nodename, nodeinfo.split(" ")[4]).printInfo() data += MonitorInfo("dmdb_memory_used_percent", "dmdb memory used percent(%)", "nodename", nodename, nodeinfo.split(" ")[5]).printInfo() data += MonitorInfo("dmdb_memory_fragment", "dmdb memory fragment(M)", "nodename", nodename, nodeinfo.split(" ")[6]).printInfo() result.close() except Exception as err: print err data = str(err) return data