currently fixed
This commit is contained in:
		@@ -1,8 +1,8 @@
 | 
			
		||||
core:
 | 
			
		||||
  autostart: false
 | 
			
		||||
  autostart: true
 | 
			
		||||
  clockspeed: 20
 | 
			
		||||
  interval: 10
 | 
			
		||||
  level: 2
 | 
			
		||||
  level: 0
 | 
			
		||||
  localadmin: true
 | 
			
		||||
sftp:
 | 
			
		||||
  filepath:
 | 
			
		||||
 
 | 
			
		||||
@@ -60,11 +60,12 @@ if linux or macos:
 | 
			
		||||
 | 
			
		||||
def netstat_done(res):
 | 
			
		||||
    fprint("netstat done, processing")
 | 
			
		||||
    #procdata_res = pool.apply_async(netstat.process, (res,), callback=process_done)
 | 
			
		||||
    netstat.process(res)
 | 
			
		||||
    procdata_res = pool.apply_async(netstat.process, (res,), callback=process_done)
 | 
			
		||||
    #netstat.process(res)
 | 
			
		||||
 | 
			
		||||
def process_done(res):
 | 
			
		||||
    if settings["running"] == True:
 | 
			
		||||
        #settings["newdata"] = True
 | 
			
		||||
        fprint("uploading to sftp...")
 | 
			
		||||
        #ssh.sftp_send_data(res, config, datafile)
 | 
			
		||||
        procdata_res = pool.apply_async(ssh.sftp_send_data, (config, datafile, 'send'), callback=upload_done)
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										10
									
								
								netstat.py
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								netstat.py
									
									
									
									
									
								
							@@ -84,7 +84,7 @@ def process(data):
 | 
			
		||||
        for line in output:
 | 
			
		||||
            string_split = line.split(" ")
 | 
			
		||||
            string_split = [i for i in string_split if i]
 | 
			
		||||
            fprint("Input: " + str(string_split))
 | 
			
		||||
            #fprint("Input: " + str(string_split))
 | 
			
		||||
 | 
			
		||||
            if string_split[1].find("Multipath") >= 0:
 | 
			
		||||
                break
 | 
			
		||||
@@ -92,16 +92,16 @@ def process(data):
 | 
			
		||||
                continue
 | 
			
		||||
            
 | 
			
		||||
            if len(string_split) == 10: # no connection status
 | 
			
		||||
                fprint(string_split)
 | 
			
		||||
                #fprint(string_split)
 | 
			
		||||
                string_split.append(string_split[-1])
 | 
			
		||||
                string_split[-7] = "UNKNOWN"
 | 
			
		||||
                string_split[-4] = string_split[-5]
 | 
			
		||||
                fprint(string_split)
 | 
			
		||||
                #fprint(string_split)
 | 
			
		||||
            
 | 
			
		||||
           
 | 
			
		||||
            
 | 
			
		||||
            output2.append(["", string_split[0], string_split[3], string_split[4], string_split[5], string_split[8]]) 
 | 
			
		||||
        fprint("FINAL CSV: " + str(output2))
 | 
			
		||||
            output2.append(["Unknown", string_split[0], string_split[3], string_split[4], string_split[5], string_split[8]]) 
 | 
			
		||||
        #fprint("FINAL CSV: " + str(output2))
 | 
			
		||||
        
 | 
			
		||||
        with open(find_data_file(util.datafile), "w", newline="") as f:
 | 
			
		||||
            writer = csv.writer(f)
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										5
									
								
								panel.py
									
									
									
									
									
								
							
							
						
						
									
										5
									
								
								panel.py
									
									
									
									
									
								
							@@ -164,7 +164,7 @@ class ServerPanel(wx.Panel):
 | 
			
		||||
        #main_sizer.SetBackgroundColour((44, 51, 51))
 | 
			
		||||
        # self.pnl1.SetBackgroundColour(wx.BLACK)
 | 
			
		||||
        self.handle_columns()
 | 
			
		||||
        #self.updatedata()
 | 
			
		||||
        # self.updatedata()
 | 
			
		||||
        wx.CallAfter(self.updatedata)
 | 
			
		||||
        
 | 
			
		||||
        wx.GetApp().ProcessPendingEvents() 
 | 
			
		||||
@@ -238,6 +238,7 @@ class ServerPanel(wx.Panel):
 | 
			
		||||
    def on_start(self, event):
 | 
			
		||||
        fprint('in on_start')
 | 
			
		||||
        settings["running"] = True
 | 
			
		||||
        # fprint("check if settings[running] is set to true" + str(settings["running"]))
 | 
			
		||||
 | 
			
		||||
    def on_stop(self, event):
 | 
			
		||||
        fprint('in on_stop')
 | 
			
		||||
@@ -276,7 +277,7 @@ def openwindow(data, sets, kill):
 | 
			
		||||
    killme = kill
 | 
			
		||||
    displaydata = data
 | 
			
		||||
    settings = sets
 | 
			
		||||
    if settings["loggedin"]:
 | 
			
		||||
    if settings["loggedin"] == False:
 | 
			
		||||
        fprint("Creating server panel")
 | 
			
		||||
        loaddata()
 | 
			
		||||
        app = wx.App(False)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user