first commit

This commit is contained in:
Roy
2025-06-23 21:19:51 +02:00
commit a4f9ea11f3
69 changed files with 4857 additions and 0 deletions

View File

@ -0,0 +1,8 @@
#!/bin/bash
HOST=$1
TIME=$(date)
while echo -e "\n**$TIME**" >> gluster_peer_$HOST ;do
ssh -o ConnectTimeout=3 -n root@$HOST "gluster peer status"
sleep 5;
done >> gluster_peer_$HOST.log 2>&1

View File

@ -0,0 +1,6 @@
for (( ; ; ))
do
date >> oc_node_status.log
oc get nodes -o wide >> oc_node_status.log
sleep 2
done

View File

@ -0,0 +1,6 @@
for (( ; ; ))
do
date >> oc_pod_status.log
oc get pods --all-namespaces -o wide >> oc_pod_status.log
sleep 10
done

View File

@ -0,0 +1,14 @@
#!/bin/bash
FROM_SERVER=$1
TO_SERVER=$2
LOG_FILE="ping_${FROM_SERVER}_to_${TO_SERVER}.log"
for (( ; ; ))
do
date >> $LOG_FILE
ssh -o ConnectTimeout=1 -o ConnectionAttempts=1 \
${FROM_SERVER} ping ${TO_SERVER} | awk '{ print strftime("%Y-%m-%d %H:%M:%S"), $0; fflush(); }' >> $LOG_FILE
echo "Disconnected from server..." >> $LOG_FILE
sleep 10
done

View File

@ -0,0 +1,18 @@
#!/bin/bash
HOSTS=(host1
host2
)
uptime_mv ()
{
for host in "${HOSTS[@]}" ;
do
PONG=$(ping -c 1 $host)
echo "$(date) $PONG" >> ping_$host.log &
done
}
while true ;do
uptime_mv ;
sleep 1
done

View File

@ -0,0 +1,33 @@
#!/bin/bash
function cleanup {
# Your cleanup code here
echo "My pid is: $$ ?"
echo "Pids to kill: $(pgrep -P $$)"
pkill -P $$
}
trap cleanup EXIT
# Now the real work:
# Things to measure:
# - availability of loadbalancer (log_haproxy.sh)
# - availability of webconsole and master APIs (log_master_api.sh)
# - state of nodes (log_oc_nodes.sh)
# - state of pods (log_oc_pods.sh)
# - availability of servers
# - pings between servers (log_ping_between.sh)
mkdir $1
cd $1
#../log_haproxy.sh &
#../log_master_api.sh &
#../log_oc_nodes.sh &
#../log_oc_pods.sh &
../uptime_hv.sh &
../virsh_list_hv.sh &
../uptime_vm.sh &
../gluster_peer_check.sh<Hostname> &
wait

View File

@ -0,0 +1,18 @@
#!/bin/bash
HOSTS=(
)
uptime_ost ()
{
for host in "${HOSTS[@]}" ;
do
ssh -o ConnectTimeout=3 -o ConnectionAttempts=1 -n root@$host "uptime" >> uptime_$host.log
done
}
while true ;do
uptime_ost;
sleep 5
done > /dev/null 2>&1

View File

@ -0,0 +1,17 @@
#!/bin/bash
HOSTS=(host1
host2
)
uptime_mv ()
{
for host in "${HOSTS[@]}" ;
do
ssh -o ConnectTimeout=3 -o ConnectionAttempts=1 -n root@$host "uptime" >> uptime_$host.log
done
}
while true ;do
uptime_mv ;
sleep 5
done > /dev/null 2>&1

View File

@ -0,0 +1,19 @@
#!/bin/bash
HOSTS=(
host1
host2
)
virsh_test ()
{
for host in "${HOSTS[@]}" ;
do
echo $(date) >> virsh_$host
ssh -o ConnectTimeout=3 -o ConnectionAttempts=1 -n root@$host "virsh -r list" >> virsh_$host.log
done
}
while true ;do
virsh_test;
sleep 5
done > /dev/null 2>&1