Private
Public Access
1
0

monitoring ftp

This commit is contained in:
Sander Roosendaal
2022-12-17 16:27:36 +01:00
parent 55ac4245d2
commit a7a33d0d17
9 changed files with 69 additions and 13 deletions

View File

@@ -721,23 +721,33 @@ def update_rolling_cp(r, types, mode='water'):
powerdf.drop_duplicates(subset='Delta', keep='first', inplace=True)
res2 = datautils.cpfit(powerdf)
p1 = res2[0]
# calculate FTP
hourseconds = 3600.
pwr = p1[0]/(1+hourseconds/p1[2])
pwr += p1[1]/(1+hourseconds/p1[3])
if len(powerdf) != 0:
if mode == 'water':
p1 = res2[0]
r.p0 = p1[0]
r.p1 = p1[1]
r.p2 = p1[2]
r.p3 = p1[3]
r.cpratio = res2[3]
r.save()
if pwr > r.ftp*(100.-r.otwslack)/100. and r.getemailnotifications and not r.emailbounced:
_ = myqueue(queuehigh, handle_sendemail_newftp(r,pwr,'water'))
else:
p1 = res2[0]
r.ep0 = p1[0]
r.ep1 = p1[1]
r.ep2 = p1[2]
r.ep3 = p1[3]
r.ecpratio = res2[3]
r.save()
if pwr > r.ftp and r.getemailnotifications and not r.emailbounced:
_ = myqueue(queuehigh, handle_sendemail_newftp(r,pwr,'water'))
return True
return False