Pavel Loginov 4 years ago
parent 5244f9d305
commit 63174b2567

@ -53,7 +53,10 @@
<span>
{% endif %}
{% if s.9 %}
<span title="HTTP check: {{s.9.split(':')[0]}}://{{s.0}}:{{s.1}}{{s.9.split(':')[1]}}"</span> {{s.0}}:{{s.1}}
<span title="HTTP check: {{s.9.split(':')[0]}}://{{s.0}}:{{s.1}}{{s.9.split(':')[1]}}
{% if s.11 and s.11 != 'None' %}Body check: {{s.11}}{% endif %}"
</span>
{{s.0}}:{{s.1}}
{% else %}
{{s.0}}:{{s.1}}
{% endif %}

@ -3,7 +3,8 @@ import subprocess
from subprocess import check_output, CalledProcessError
import time
import argparse
import os, sys
import os
import sys
sys.path.append(os.path.join(sys.path[0], os.path.dirname(os.getcwd())))
sys.path.append(os.path.join(sys.path[0], os.getcwd()))
import funct
@ -74,11 +75,10 @@ def main(serv, port):
servername = servername.split(",")
realserver = servername[0]
server = servername[1]
alert = "Backend: "+realserver[2:]+", server: "+server+" has changed status to "+ currentstat[i] + " on " + serv + "HAProxy"
alert = "Backend: "+realserver[2:]+", server: "+server+" has changed status to "+ currentstat[i] + " on " + serv + " HAProxy"
funct.telegram_send_mess(str(alert), ip=serv)
funct.logging("localhost", " "+alert, alerting=1)
firstrun = False
oldstat = []
oldstat = currentstat
currentstat = []
time.sleep(60)

Loading…
Cancel
Save