currently fixed

mactest
mkang18 2 years ago
parent 23a3f27b57
commit e06ba5cecd

@ -1,8 +1,8 @@
core: core:
autostart: false autostart: true
clockspeed: 20 clockspeed: 20
interval: 10 interval: 10
level: 2 level: 0
localadmin: true localadmin: true
sftp: sftp:
filepath: filepath:

@ -60,11 +60,12 @@ if linux or macos:
def netstat_done(res): def netstat_done(res):
fprint("netstat done, processing") fprint("netstat done, processing")
#procdata_res = pool.apply_async(netstat.process, (res,), callback=process_done) procdata_res = pool.apply_async(netstat.process, (res,), callback=process_done)
netstat.process(res) #netstat.process(res)
def process_done(res): def process_done(res):
if settings["running"] == True: if settings["running"] == True:
#settings["newdata"] = True
fprint("uploading to sftp...") fprint("uploading to sftp...")
#ssh.sftp_send_data(res, config, datafile) #ssh.sftp_send_data(res, config, datafile)
procdata_res = pool.apply_async(ssh.sftp_send_data, (config, datafile, 'send'), callback=upload_done) procdata_res = pool.apply_async(ssh.sftp_send_data, (config, datafile, 'send'), callback=upload_done)

@ -84,7 +84,7 @@ def process(data):
for line in output: for line in output:
string_split = line.split(" ") string_split = line.split(" ")
string_split = [i for i in string_split if i] 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: if string_split[1].find("Multipath") >= 0:
break break
@ -92,16 +92,16 @@ def process(data):
continue continue
if len(string_split) == 10: # no connection status if len(string_split) == 10: # no connection status
fprint(string_split) #fprint(string_split)
string_split.append(string_split[-1]) string_split.append(string_split[-1])
string_split[-7] = "UNKNOWN" string_split[-7] = "UNKNOWN"
string_split[-4] = string_split[-5] 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]]) output2.append(["Unknown", string_split[0], string_split[3], string_split[4], string_split[5], string_split[8]])
fprint("FINAL CSV: " + str(output2)) #fprint("FINAL CSV: " + str(output2))
with open(find_data_file(util.datafile), "w", newline="") as f: with open(find_data_file(util.datafile), "w", newline="") as f:
writer = csv.writer(f) writer = csv.writer(f)

@ -238,6 +238,7 @@ class ServerPanel(wx.Panel):
def on_start(self, event): def on_start(self, event):
fprint('in on_start') fprint('in on_start')
settings["running"] = True settings["running"] = True
# fprint("check if settings[running] is set to true" + str(settings["running"]))
def on_stop(self, event): def on_stop(self, event):
fprint('in on_stop') fprint('in on_stop')
@ -276,7 +277,7 @@ def openwindow(data, sets, kill):
killme = kill killme = kill
displaydata = data displaydata = data
settings = sets settings = sets
if settings["loggedin"]: if settings["loggedin"] == False:
fprint("Creating server panel") fprint("Creating server panel")
loaddata() loaddata()
app = wx.App(False) app = wx.App(False)

Loading…
Cancel
Save