You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
52 lines
1.2 KiB
52 lines
1.2 KiB
#!/usr/bin/env bash
|
|
|
|
set -u
|
|
|
|
DESC="Diag1."
|
|
|
|
SYSTEMS="bigboss lambda nomade societe tiny web"
|
|
|
|
run() {
|
|
|
|
. $VDN_PATH/bin/functions-scripts.sh
|
|
|
|
# tiny peut joindre bigboss (et vice versa).
|
|
|
|
echo "=== ping bigboss -> tiny"
|
|
vdn-ssh root@bigboss "timeout 2 ping -c 1 tiny &> /dev/null"
|
|
|
|
echo "=== ping tiny -> bigoss"
|
|
vdn-ssh root@tiny "timeout 2 ping -c 1 bigboss &> /dev/null"
|
|
|
|
# societe peut joindre toutes les machines
|
|
|
|
for i in $SYSTEMS; do
|
|
echo "=== ping societe -> $i"
|
|
vdn-ssh root@societe "timeout 2 ping -c 1 $i &> /dev/null"
|
|
done
|
|
|
|
# lambda peut joindre nomade (et vice-versa)
|
|
|
|
echo;
|
|
|
|
echo "=== ping lambda -> nomade"
|
|
vdn-ssh root@lambda "timeout 2 ping -c 1 nomade &> /dev/null"
|
|
|
|
echo "=== ping nomade -> lambda"
|
|
vdn-ssh root@nomade "timeout 2 ping -c 1 lambda &> /dev/null"
|
|
|
|
|
|
# vérifiez que les serveurs apache2 de lambda, web et bigboss fonctionnent
|
|
|
|
echo
|
|
echo "Tests des serveurs web."
|
|
|
|
vdn-ssh root@bigboss "timeout 2 lynx -dump bigboss" | grep -q 'Bienvenue'
|
|
vdn-ssh root@web "timeout 2 lynx -dump web" | grep -q 'Bienvenue'
|
|
vdn-ssh root@lambda "timeout 2 lynx -dump lambda" | grep -q 'Bienvenue'
|
|
|
|
echo
|
|
[ $? = 0 ] && green ok || red ko
|
|
|
|
}
|