Ejemplo n.º 1
0
  try:
    raw_connection_instance=raw_connection_handle.readline()
    while raw_connection_instance:
       source_info=list()
       destination_info=list()
       sub_string=raw_connection_instance.split(' ')
#      Get the source information 
       source_sub_string=sub_string[1].split(':')
       source_ip=source_sub_string[0]
       source_port=source_sub_string[1]
       source_info.append(source_ip);       
#      Get the source process name from shell script
#      cmd_get_procname_by_port_with_port=cmd_get_procname_by_port+' '+source_port
#      os.system(cmd_get_procname_by_port_with_port)
#      Get the process name from look_up_netif_info       
       get_process_name=look_up_netif_info(source_port,work_dir)
       source_process_name=get_process_name.ret_process_name(source_port)
       source_info.append(source_process_name)
       source_info.append(source_port)
#      Get the destination information   
       destination_sub_string=sub_string[2].split(':')
       destination_ip=destination_sub_string[0]
#       if (cmp(destination_ip,source_ip)!=0):
#        remote_call=serverproxy(".....")
#         print 'We need to inquire the information from remote machine\n'
#       else:
       destination_port=destination_sub_string[1]
       destination_info.append(destination_ip)
       destination_process_name=get_process_name.ret_process_name(destination_port)
       destination_info.append(destination_process_name)
       destination_info.append(destination_port)
Ejemplo n.º 2
0
#!/bin/python
from look_up_netif_info import look_up_netif_info
import os
import sys
work_dir = '/EagleEye'
netIF = 'ssh'
proc_name_look_up = look_up_netif_info(netIF, work_dir)
proc_name = proc_name_look_up.ret_process_name(netIF)
if proc_name == '':
    print 'There is something wrong to open the proc_file!'
else:
    print proc_name

#print 'hello world'
Ejemplo n.º 3
0
#!/bin/python
from look_up_netif_info import look_up_netif_info
import os
import sys
work_dir='/EagleEye'
netIF='ssh'
proc_name_look_up=look_up_netif_info(netIF,work_dir)
proc_name=proc_name_look_up.ret_process_name(netIF)
if proc_name=='':
  print 'There is something wrong to open the proc_file!'
else:
  print proc_name


#print 'hello world' 
Ejemplo n.º 4
0
try:
    raw_connection_instance = raw_connection_handle.readline()
    while raw_connection_instance:
        source_info = list()
        destination_info = list()
        sub_string = raw_connection_instance.split(' ')
        #      Get the source information
        source_sub_string = sub_string[1].split(':')
        source_ip = source_sub_string[0]
        source_port = source_sub_string[1]
        source_info.append(source_ip)
        #      Get the source process name from shell script
        #      cmd_get_procname_by_port_with_port=cmd_get_procname_by_port+' '+source_port
        #      os.system(cmd_get_procname_by_port_with_port)
        #      Get the process name from look_up_netif_info
        get_process_name = look_up_netif_info(source_port, work_dir)
        source_process_name = get_process_name.ret_process_name(
            source_port)
        source_info.append(source_process_name)
        source_info.append(source_port)
        #      Get the destination information
        destination_sub_string = sub_string[2].split(':')
        destination_ip = destination_sub_string[0]
        #       if (cmp(destination_ip,source_ip)!=0):
        #        remote_call=serverproxy(".....")
        #         print 'We need to inquire the information from remote machine\n'
        #       else:
        destination_port = destination_sub_string[1]
        destination_info.append(destination_ip)
        destination_process_name = get_process_name.ret_process_name(
            destination_port)