Pavel Loginov 2020-07-27 20:46:27 +02:00
parent 5244f9d305
commit 63174b2567
2 changed files with 7 additions and 4 deletions

View File

@ -53,7 +53,10 @@
<span> <span>
{% endif %} {% endif %}
{% if s.9 %} {% 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 %} {% else %}
{{s.0}}:{{s.1}} {{s.0}}:{{s.1}}
{% endif %} {% endif %}

View File

@ -3,7 +3,8 @@ import subprocess
from subprocess import check_output, CalledProcessError from subprocess import check_output, CalledProcessError
import time import time
import argparse 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.path.dirname(os.getcwd())))
sys.path.append(os.path.join(sys.path[0], os.getcwd())) sys.path.append(os.path.join(sys.path[0], os.getcwd()))
import funct import funct
@ -74,11 +75,10 @@ def main(serv, port):
servername = servername.split(",") servername = servername.split(",")
realserver = servername[0] realserver = servername[0]
server = servername[1] 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.telegram_send_mess(str(alert), ip=serv)
funct.logging("localhost", " "+alert, alerting=1) funct.logging("localhost", " "+alert, alerting=1)
firstrun = False firstrun = False
oldstat = []
oldstat = currentstat oldstat = currentstat
currentstat = [] currentstat = []
time.sleep(60) time.sleep(60)