Exemplo n.º 1
0
def replaceGlobalVariables(string):
	boxinfo = metrixTools.getBoxInfo()
	string = string.replace("%GLOBAL:BRAND%",boxinfo['brand'])
	string = string.replace("%GLOBAL:IMAGE%",metrixDefaults.getImageName())
	string = string.replace("%GLOBAL:MODEL%",boxinfo['model'])
	string = string.replace("%GLOBAL:NUMTUNERS%",str(len(boxinfo['tuners'])))
	return string
Exemplo n.º 2
0
def replaceGlobalVariables(string):
    boxinfo = metrixTools.getBoxInfo()
    string = string.replace("%GLOBAL:BRAND%", boxinfo['brand'])
    string = string.replace("%GLOBAL:IMAGE%", metrixDefaults.getImageName())
    string = string.replace("%GLOBAL:MODEL%", boxinfo['model'])
    string = string.replace("%GLOBAL:NUMTUNERS%", str(len(boxinfo['tuners'])))
    return string
Exemplo n.º 3
0
def getImageRestriction():
    if config.plugins.MyMetrix.Store.IgnoreRestrictions.value == True:
        return "%"
    CONFIG_SYSTEM_DESC = "/etc/systemdescription.cfg"
    restriction = "%image::" + metrixDefaults.getImageName() + "%"
    if config.plugins.MyMetrix.logLevel.value in ["debug"]:
        log("RESTRICTION-IMAGE: " + restriction)
    return restriction
Exemplo n.º 4
0
def getImageRestriction():
	if config.plugins.MyMetrix.Store.IgnoreRestrictions.value == True:
		return "%"
	CONFIG_SYSTEM_DESC = "/etc/systemdescription.cfg"
	restriction = "%image::"+ metrixDefaults.getImageName() +"%"
	if config.plugins.MyMetrix.logLevel.value in ["debug"]:
		log("RESTRICTION-IMAGE: "+restriction)
	return restriction
Exemplo n.º 5
0
def prepareInfoGeneral(session):
	#print "MetrixSync"
	try:
		prepareInfo(session)
	except:
		pass
	try:
		boxinfo = e2info.getInfo()
		sync_data = []
		
		if config.plugins.MetrixCloudSync.SyncNetworkInfo.value:
			try:
				for item in boxinfo["ifaces"]:
					sync_data.append(metrixCloudSync.getSyncRow("Box Info","Network Interface "+item["name"],item["name"]+"dhcp","DHCP status",item["dhcp"],1))
					sync_data.append(metrixCloudSync.getSyncRow("Box Info","Network Interface "+item["name"],item["name"]+"ip","IP address",item["ip"],2))
					sync_data.append(metrixCloudSync.getSyncRow("Box Info","Network Interface "+item["name"],item["name"]+"mac","MAC address",item["mac"],3))
					sync_data.append(metrixCloudSync.getSyncRow("Box Info","Network Interface "+item["name"],item["name"]+"mask","Net mask",item["mask"],4))
					sync_data.append(metrixCloudSync.getSyncRow("Box Info","Network Interface "+item["name"],item["name"]+"gw","Gateway",item["gw"],5))
			except:
				pass
		if config.plugins.MetrixCloudSync.SyncHardwareInfo.value:	
			try:
				for item in boxinfo["tuners"]:
					sync_data.append(metrixCloudSync.getSyncRow("Box Info","Tuners",item["name"],item["name"],item["type"])	)
			except:
				pass	
			try:
				for item in boxinfo["hdd"]:
					sync_data.append(metrixCloudSync.getSyncRow("Box Info","Hard disk "+item["model"],"hddcapacity","Capacity",item["capacity"],1))	
					sync_data.append(metrixCloudSync.getSyncRow("Box Info","Hard disk "+item["model"],"hddfree","Free",item["free"],2))	
			except:
				pass
			try:
				sync_data.append(metrixCloudSync.getSyncRow("Box Info","General","brand","Brand",boxinfo['brand'],2))
			except:
				pass
			try:
				sync_data.append(metrixCloudSync.getSyncRow("Box Info","General","model","Model",boxinfo['model'],3))
			except:
				pass
			try:
				sync_data.append(metrixCloudSync.getSyncRow("Box Info","General","chipset","Chipset",boxinfo['chipset'],4))
			except:
				pass
			try:
				sync_data.append(metrixCloudSync.getSyncRow("Box Info","General","mem1","Total memory",boxinfo['mem1'],5))
			except:
				pass
			try:
				sync_data.append(metrixCloudSync.getSyncRow("Box Info","General","mem2","Free memory",boxinfo['mem2'],6))
			except:
				pass
			
		if config.plugins.MetrixCloudSync.SyncBoxInfo.value:	
			sync_data.append(metrixCloudSync.getSyncRow("Box Info","Software","mymetrix_version","MyMetrix version",metrixDefaults.VERSION,0))
			sync_data.append(metrixCloudSync.getSyncRow("Box Info","Software","image_version","Image version",metrixDefaults.getImageName(),2))
			sync_data.append(metrixCloudSync.getSyncRow("Box Info","Software","mymetrix_build","MyMetrix build",metrixDefaults.BUILD,1))
			try:
				sync_data.append(metrixCloudSync.getSyncRow("Box Info","Software","enigmaver","GUI version",boxinfo['enigmaver'],3))
			except:
				pass
			try:
				sync_data.append(metrixCloudSync.getSyncRow("Box Info","Software","imagever","Firmware version",boxinfo['imagever'],4))
			except:
				pass
			try:
				sync_data.append(metrixCloudSync.getSyncRow("Box Info","Software","kernelver","Kernel version",boxinfo['kernelver'],5))
			except:
				pass
			try:
				sync_data.append(metrixCloudSync.getSyncRow("Box Info","General","uptime","Uptime",boxinfo['uptime'],7))
			except:
				pass
			metrixCloudSync.syncNow(sync_data)
	except:
		pass
Exemplo n.º 6
0
def prepareInfoGeneral(session):
	#print "MetrixSync"
	try:
		prepareInfo(session)
	except:
		pass
	try:
		boxinfo = metrixTools.getBoxInfo()
		sync_data = []
		
		if config.plugins.MetrixCloudSync.SyncNetworkInfo.value:
			try:
				for item in boxinfo["ifaces"]:
					sync_data.append(metrixCloudSync.getSyncRow("Box Info","Network Interface "+item["name"],item["name"]+"dhcp","DHCP status",item["dhcp"],1))
					sync_data.append(metrixCloudSync.getSyncRow("Box Info","Network Interface "+item["name"],item["name"]+"ip","IP address",item["ip"],2))
					sync_data.append(metrixCloudSync.getSyncRow("Box Info","Network Interface "+item["name"],item["name"]+"mac","MAC address",item["mac"],3))
					sync_data.append(metrixCloudSync.getSyncRow("Box Info","Network Interface "+item["name"],item["name"]+"mask","Net mask",item["mask"],4))
					sync_data.append(metrixCloudSync.getSyncRow("Box Info","Network Interface "+item["name"],item["name"]+"gw","Gateway",item["gw"],5))
			except:
				pass
		if config.plugins.MetrixCloudSync.SyncHardwareInfo.value:	
			try:
				for item in boxinfo["tuners"]:
					sync_data.append(metrixCloudSync.getSyncRow("Box Info","Tuners",item["name"],item["name"],item["type"])	)
			except:
				pass	
			try:
				for item in boxinfo["hdd"]:
					sync_data.append(metrixCloudSync.getSyncRow("Box Info","Hard disk "+item["model"],"hddcapacity","Capacity",item["capacity"],1))	
					sync_data.append(metrixCloudSync.getSyncRow("Box Info","Hard disk "+item["model"],"hddfree","Free",item["free"],2))	
			except:
				pass
			try:
				sync_data.append(metrixCloudSync.getSyncRow("Box Info","General","brand","Brand",boxinfo['brand'],2))
			except:
				pass
			try:
				sync_data.append(metrixCloudSync.getSyncRow("Box Info","General","model","Model",boxinfo['model'],3))
			except:
				pass
			try:
				sync_data.append(metrixCloudSync.getSyncRow("Box Info","General","chipset","Chipset",boxinfo['chipset'],4))
			except:
				pass
			try:
				sync_data.append(metrixCloudSync.getSyncRow("Box Info","General","mem1","Total memory",boxinfo['mem1'],5))
			except:
				pass
			try:
				sync_data.append(metrixCloudSync.getSyncRow("Box Info","General","mem2","Free memory",boxinfo['mem2'],6))
			except:
				pass
			
		if config.plugins.MetrixCloudSync.SyncBoxInfo.value:	
			sync_data.append(metrixCloudSync.getSyncRow("Box Info","Software","mymetrix_version","MyMetrix version",metrixDefaults.VERSION,0))
			sync_data.append(metrixCloudSync.getSyncRow("Box Info","Software","image_version","Image version",metrixDefaults.getImageName(),2))
			sync_data.append(metrixCloudSync.getSyncRow("Box Info","Software","mymetrix_build","MyMetrix build",metrixDefaults.BUILD,1))
			try:
				sync_data.append(metrixCloudSync.getSyncRow("Box Info","Software","enigmaver","GUI version",boxinfo['enigmaver'],3))
			except:
				pass
			try:
				sync_data.append(metrixCloudSync.getSyncRow("Box Info","Software","imagever","Firmware version",boxinfo['imagever'],4))
			except:
				pass
			try:
				sync_data.append(metrixCloudSync.getSyncRow("Box Info","Software","kernelver","Kernel version",boxinfo['kernelver'],5))
			except:
				pass
			try:
				sync_data.append(metrixCloudSync.getSyncRow("Box Info","General","uptime","Uptime",boxinfo['uptime'],7))
			except:
				pass
			metrixCloudSync.syncNow(sync_data)
	except:
		pass
Exemplo n.º 7
0
def getRestrictions():
	CONFIG_SYSTEM_DESC = "/etc/systemdescription.cfg"
	restriction = "%image::"+ metrixDefaults.getImageName() +"%"
	restriction = restriction + "%oe::"+metrixDefaults.getOEVersion()+"%"
	return restriction