mirror of https://github.com/Aidaho12/haproxy-wi
parent
eebbf4354f
commit
2715ecab29
|
@ -28,6 +28,7 @@ Support the project
|
||||||
18. SSH Key support for managing multiple HAproxy Servers straight from haproxy-wi
|
18. SSH Key support for managing multiple HAproxy Servers straight from haproxy-wi
|
||||||
19. SYN flood protect
|
19. SYN flood protect
|
||||||
20. Alerting about changes backends state
|
20. Alerting about changes backends state
|
||||||
|
21. Alerting about HAProxy service state
|
||||||
|
|
||||||
# Install
|
# Install
|
||||||
The installer will ask you a few questions
|
The installer will ask you a few questions
|
||||||
|
|
|
@ -319,6 +319,7 @@
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="ssh">
|
<div id="ssh">
|
||||||
<table id="ssh_enable_table" class="overview">
|
<table id="ssh_enable_table" class="overview">
|
||||||
<tr class="overviewHead" style="width: 50%;">
|
<tr class="overviewHead" style="width: 50%;">
|
||||||
|
|
|
@ -96,7 +96,7 @@
|
||||||
</ul>
|
</ul>
|
||||||
</nav>
|
</nav>
|
||||||
<div class="copyright-menu">
|
<div class="copyright-menu">
|
||||||
HAproxy-WI v2.7.2.2
|
HAproxy-WI v2.7.3
|
||||||
<br>
|
<br>
|
||||||
<a href="https://www.patreon.com/haproxy_wi" title="Donate" target="_blank" style="color: #fff; margin-left: 30px; color: red;" class="patreon"> Patreon</a>
|
<a href="https://www.patreon.com/haproxy_wi" title="Donate" target="_blank" style="color: #fff; margin-left: 30px; color: red;" class="patreon"> Patreon</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -319,6 +319,7 @@
|
||||||
$('#add-ssh-button').css('display', 'none');
|
$('#add-ssh-button').css('display', 'none');
|
||||||
$('#ssh_key_upload').css('display', 'none');
|
$('#ssh_key_upload').css('display', 'none');
|
||||||
$('#add-telegram-button').css('display', 'none');
|
$('#add-telegram-button').css('display', 'none');
|
||||||
|
$('input').css('color', 'rgba(0, 0, 0, 0.3)');
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
$("input[type=checkbox]").checkboxradio( "disable" );
|
$("input[type=checkbox]").checkboxradio( "disable" );
|
||||||
$("select").selectmenu( "disable" );
|
$("select").selectmenu( "disable" );
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
import subprocess
|
import subprocess
|
||||||
|
from subprocess import check_output, CalledProcessError
|
||||||
import time
|
import time
|
||||||
import argparse
|
import argparse
|
||||||
import os, sys
|
import os, sys
|
||||||
|
@ -23,13 +24,35 @@ def main(serv, port):
|
||||||
currentstat = []
|
currentstat = []
|
||||||
readstats = ""
|
readstats = ""
|
||||||
killer = GracefulKiller()
|
killer = GracefulKiller()
|
||||||
|
old_stat_service = ""
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
try:
|
try:
|
||||||
readstats = subprocess.check_output(["echo show stat | nc "+serv+" "+port], shell=True)
|
readstats = subprocess.check_output(["echo show stat | nc "+serv+" "+port], shell=True)
|
||||||
except:
|
except CalledProcessError as e:
|
||||||
print("Unexpected error:", sys.exc_info())
|
if firstrun == False:
|
||||||
|
cur_stat_service = "error"
|
||||||
|
if old_stat_service != cur_stat_service:
|
||||||
|
alert = "Can't connect to HAProxy service at " + serv
|
||||||
|
funct.telegram_send_mess(str(alert), ip=serv)
|
||||||
|
funct.logging("localhost", " "+alert, alerting=1)
|
||||||
|
|
||||||
|
firstrun = False
|
||||||
|
old_stat_service = cur_stat_service
|
||||||
|
continue
|
||||||
|
except OSError as e:
|
||||||
|
print(e)
|
||||||
sys.exit()
|
sys.exit()
|
||||||
|
else:
|
||||||
|
cur_stat_service = "Ok"
|
||||||
|
if firstrun == False:
|
||||||
|
if old_stat_service != cur_stat_service:
|
||||||
|
alert = "Now UP HAProxy service at " + serv
|
||||||
|
funct.telegram_send_mess(str(alert), ip=serv)
|
||||||
|
funct.logging("localhost", " "+alert, alerting=1)
|
||||||
|
firstrun = True
|
||||||
|
time.sleep(2)
|
||||||
|
old_stat_service = cur_stat_service
|
||||||
|
|
||||||
vips = readstats.splitlines()
|
vips = readstats.splitlines()
|
||||||
|
|
||||||
|
|
|
@ -184,6 +184,8 @@ cat << EOF > /etc/logrotate.d/checker
|
||||||
rotate 10
|
rotate 10
|
||||||
missingok
|
missingok
|
||||||
notifempty
|
notifempty
|
||||||
|
create 0644 apache apache
|
||||||
|
dateext
|
||||||
sharedscripts
|
sharedscripts
|
||||||
}
|
}
|
||||||
EOF
|
EOF
|
||||||
|
|
Loading…
Reference in New Issue