ajout du downtime
This commit is contained in:
parent
fd66274527
commit
c12543ba82
17
data.py
17
data.py
|
@ -20,6 +20,7 @@ class HostData:
|
||||||
# Concerning host
|
# Concerning host
|
||||||
self.type = ""
|
self.type = ""
|
||||||
self.status = "OK"
|
self.status = "OK"
|
||||||
|
self.downtime = False
|
||||||
|
|
||||||
# Concerning services
|
# Concerning services
|
||||||
self.statuses = {}
|
self.statuses = {}
|
||||||
|
@ -179,8 +180,22 @@ class DataStore:
|
||||||
# We have a recovery
|
# We have a recovery
|
||||||
else:
|
else:
|
||||||
|
|
||||||
|
if "DOWNTIMESTART" in cur.type and not self.downtime:
|
||||||
|
message = "début de DOWNTIME" \
|
||||||
|
" sur %s" % (host)
|
||||||
|
cur.downtime = True
|
||||||
|
# send notification
|
||||||
|
log.info("Sending to %s: %s" % (destmuc, message))
|
||||||
|
self.linkedBot.push(destmuc, cur.maintainer+", "+message)
|
||||||
|
elif "DOWNTIMEEND" in cur.type and self.downtime:
|
||||||
|
message = "fin de DOWNTIME" \
|
||||||
|
" sur %s" % (host)
|
||||||
|
cur.downtime = False
|
||||||
|
# send notification
|
||||||
|
log.info("Sending to %s: %s" % (destmuc, message))
|
||||||
|
self.linkedBot.push(destmuc, cur.maintainer+", "+message)
|
||||||
# General problem
|
# General problem
|
||||||
if 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" \
|
||||||
" sur %s (%s)" % (host, text)
|
" sur %s (%s)" % (host, text)
|
||||||
# send notification
|
# send notification
|
||||||
|
|
Loading…
Reference in New Issue