deployed_jta_list = jta_checker.get_apps_diff() logging.debug('###################deployed_apps########################') logging.debug(deployed_jta_list['deployed_apps']) ##################################################### # Get the list of JTA applications under # # JTA server host == JTA-jasperServer-a # ##################################################### host_jta_server = z.host.get({ 'filter': { 'host': zabbix_info['jtaHostName'] }, 'output': 'extend' }) jta_server_hostID = host_jta_server[0]['hostid'] host_interface = jmp_zabbix.get_interface(z, jta_server_hostID) log_interfaceID = jmp_zabbix.get_interface(z, jta_server_hostID) logging.debug("list of interfaces \n") logging.debug(log_interfaceID) ##################################################### # Check for the JTA's and add the missing ones # ##################################################### deployed_jta_application_list = jmp_zabbix.get_jta_application_list( z, jta_server_hostID, "jta") logging.debug(deployed_jta_application_list) if not deployed_jta_list['deployed_apps']: logging.debug("list empty noting to update") else: #start adding JTA hosts for item in deployed_jta_list['deployed_apps']: if item in deployed_jta_application_list:
#print '###################deployed_apps########################' #print deployed_jta_list['deployed_apps'] logging.debug('###################deployed_apps########################') logging.debug(deployed_jta_list['deployed_apps']) ##################################################### # Get the list of JTA applicaitons under # # JTA server host == JTA-jasperServer-a # ##################################################### host_jta_server = z.host.get( { 'filter': { 'host': zabbix_info['jtaHostName']}, 'output': 'extend' }) jta_server_hostID=host_jta_server[0]['hostid'] host_interface = jmp_zabbix.get_interface(z,jta_server_hostID) log_interfaceID = jmp_zabbix.get_interface(z,jta_server_hostID) print "list of interfaces \n" print log_interfaceID ##################################################### # Check for the JTA's and add the missing ones # ##################################################### deployed_jta_applicaiton_list = jmp_zabbix.get_jta_applicaiton_list(z,jta_server_hostID,"jta") print deployed_jta_applicaiton_list if not deployed_jta_list['deployed_apps']: print "list empty noting to update \n" else: #start adding JTA hosts for item in deployed_jta_list['deployed_apps']: if item in deployed_jta_applicaiton_list: print item
##################################################### #Add item using host ID ##################################################### JTA_log_applicaitonID = z.application.get( { 'hostids':host_log[0]['hostid'], 'filter': { 'name': 'JTA-Logs'}, 'output': 'extend' }) #print"######applicaiton id##############" #print JTA_log_applicaitonID #print JTA_log_applicaitonID[0]['applicationid'] logging.debug("######applicaiton id##############") logging.debug(JTA_log_applicaitonID) logging.debug(JTA_log_applicaitonID[0]['applicationid']) log_interfaceID = jmp_zabbix.get_interface(z,host_log[0]['hostid']) print log_interfaceID[0]['interfaceid'] ##################################################### #Add log item to JTA_log applicaiotn in jasperServer-a ##################################################### key_value = "log[{$JTA_SVR_PATH}/logs/" + item + ".log]" #print"######keyvalue##############" #print key_value logging.debug("######keyvalue##############") logging.debug(key_value) z.item.create({ 'name':item, 'key_':key_value, 'type':'7', 'interfaceid':log_interfaceID[0]['interfaceid'], 'applications':[JTA_log_applicaitonID[0]['applicationid']],