ajout du downtime

This commit is contained in:
Adrien Bourmault 2022-02-14 19:25:51 +01:00
parent aa558146fe
commit b32fc936c6
No known key found for this signature in database
GPG Key ID: 6EB408FE0ACEC664
1 changed files with 17 additions and 17 deletions

34
data.py
View File

@ -180,23 +180,23 @@ class DataStore:
# We have a recovery # We have a recovery
else: else:
if "DOWNTIMESTART" in cur.type and not self.downtime: if "DOWNTIME" in type:
message = "début de DOWNTIME" \ if "DOWNTIMESTART" in type and not self.downtime:
" sur %s" % (host) cur.downtime = True
cur.downtime = True message = "début de downtime sur" \
# send notification " sur %s (%s)" % (host, text)
log.info("Sending to %s: %s" % (destmuc, message)) # send notification
self.linkedBot.push(destmuc, cur.maintainer+", "+message) log.info("Sending to %s: %s" % (destmuc, message))
elif "DOWNTIMEEND" in cur.type and self.downtime: self.linkedBot.push(destmuc, cur.maintainer+", "+message)
message = "fin de DOWNTIME" \
" sur %s" % (host) elif "DOWNTIMEEND" in type and not self.downtime:
cur.downtime = False cur.downtime = True
# send notification message = "début de downtime sur" \
log.info("Sending to %s: %s" % (destmuc, message)) " sur %s (%s)" % (host, text)
self.linkedBot.push(destmuc, cur.maintainer+", "+message) # send notification
# ignore unregistered downtimes log.info("Sending to %s: %s" % (destmuc, message))
elif "DOWNTIME" in cur.type: self.linkedBot.push(destmuc, cur.maintainer+", "+message)
pass
# General problem # General problem
elif not service and problemCount == 0: elif not service and problemCount == 0:
message = "fin d'alerte générale sur" \ message = "fin d'alerte générale sur" \