Added external Ping to other Supernode
This commit is contained in:
parent
c836fb0ae3
commit
3e82d856b5
@ -59,9 +59,11 @@ while [ true ] ; do
|
|||||||
then
|
then
|
||||||
my_SN_IP=185.66.193.105
|
my_SN_IP=185.66.193.105
|
||||||
other_SN_IP=185.66.193.106
|
other_SN_IP=185.66.193.106
|
||||||
|
other_SN_IP_EXTERN=46.4.138.189
|
||||||
else
|
else
|
||||||
my_SN_IP=185.66.193.106
|
my_SN_IP=185.66.193.106
|
||||||
other_SN_IP=185.66.193.105
|
other_SN_IP=185.66.193.105
|
||||||
|
other_SN_IP_EXTERN=5.9.76.198
|
||||||
fi
|
fi
|
||||||
if [ $loadbalance == 1 ]
|
if [ $loadbalance == 1 ]
|
||||||
then
|
then
|
||||||
@ -76,8 +78,8 @@ while [ true ] ; do
|
|||||||
ping -q -c5 $other_SN_IP -I eth0 > /dev/null
|
ping -q -c5 $other_SN_IP -I eth0 > /dev/null
|
||||||
if [ $? -eq 0 ]
|
if [ $? -eq 0 ]
|
||||||
then
|
then
|
||||||
|
supernode_off
|
||||||
if [ $online == 1 ]; then
|
if [ $online == 1 ]; then
|
||||||
supernode_off
|
|
||||||
curl -X POST --data-urlencode 'payload={"text": "Aktiver Supernode wieder online. Ich habe mich wieder ausgeschaltet", "channel": "#technik", "username": "{{ sn_hostname }}", "icon_emoji": ":white_check_mark:"}' https://hooks.slack.com/services/{{ slack_token }}
|
curl -X POST --data-urlencode 'payload={"text": "Aktiver Supernode wieder online. Ich habe mich wieder ausgeschaltet", "channel": "#technik", "username": "{{ sn_hostname }}", "icon_emoji": ":white_check_mark:"}' https://hooks.slack.com/services/{{ slack_token }}
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
@ -90,8 +92,8 @@ while [ true ] ; do
|
|||||||
ping -q -c5 $my_SN_IP -I eth0 > /dev/null
|
ping -q -c5 $my_SN_IP -I eth0 > /dev/null
|
||||||
if [ $? -eq 0 ]
|
if [ $? -eq 0 ]
|
||||||
then
|
then
|
||||||
|
supernode_on
|
||||||
if [ $online == 0 ]; then
|
if [ $online == 0 ]; then
|
||||||
supernode_on
|
|
||||||
curl -X POST --data-urlencode 'payload={"text": "Ich bin jetzt Supernode!", "channel": "#technik", "username": "{{ sn_hostname }}", "icon_emoji": ":white_check_mark:"}' https://hooks.slack.com/services/{{ slack_token }}
|
curl -X POST --data-urlencode 'payload={"text": "Ich bin jetzt Supernode!", "channel": "#technik", "username": "{{ sn_hostname }}", "icon_emoji": ":white_check_mark:"}' https://hooks.slack.com/services/{{ slack_token }}
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
@ -99,5 +101,10 @@ while [ true ] ; do
|
|||||||
curl -X POST --data-urlencode 'payload={"text": "Ich konnte mich selbst nicht anpingen. Ich versuche mal die Services neu zu starten", "channel": "#technik", "username": "{{ sn_hostname }}", "icon_emoji": ":warning:"}' https://hooks.slack.com/services/{{ slack_token }}
|
curl -X POST --data-urlencode 'payload={"text": "Ich konnte mich selbst nicht anpingen. Ich versuche mal die Services neu zu starten", "channel": "#technik", "username": "{{ sn_hostname }}", "icon_emoji": ":warning:"}' https://hooks.slack.com/services/{{ slack_token }}
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
# Ping other Supernode on external interface
|
||||||
|
ping -q -c5 $other_SN_IP_EXTERN -I eth0 > /dev/null
|
||||||
|
if [ $? -eq 0 ]
|
||||||
|
then
|
||||||
|
curl -X POST --data-urlencode 'payload={"text": "Anderer Supernode ist nicht über seine Externe adresse Pingbar!", "channel": "#technik", "username": "{{ sn_hostname }}", "icon_emoji": ":warning:"}' https://hooks.slack.com/services/{{ slack_token }}
|
||||||
sleep 60
|
sleep 60
|
||||||
done
|
done
|
||||||
|
Loading…
Reference in New Issue
Block a user