From ac97265b9b3ca1c855a459803014efe15a28b861 Mon Sep 17 00:00:00 2001 From: Thomas Gebert Date: Tue, 12 Aug 2025 09:26:28 +0200 Subject: [PATCH 1/4] Fix double code --- gp-scripts/checkup.sh | 72 ++----------------------------------------- 1 file changed, 2 insertions(+), 70 deletions(-) diff --git a/gp-scripts/checkup.sh b/gp-scripts/checkup.sh index 05182b1..bed7efa 100644 --- a/gp-scripts/checkup.sh +++ b/gp-scripts/checkup.sh @@ -30,76 +30,8 @@ header1 "Check Mailing # - correct relay address/name # - correct sender address # - correct recipient address" -ansible -b all -m shell -a "grep -H ^relayhost /etc/postfix/main.cf; grep -H '^\ *from' /etc/kapacitor/kapacitor.conf" - -#!/bin/bash - -################################################################################ -# Global variables -################################################################################ -ANSIBLE_CMD="ansible -i /etc/filescale/cluster.ansible.yml" - -################################################################################ -# Functions -################################################################################ -header1() { -cat << HEADER1 - -################################################################################ -# ${@} -################################################################################ -HEADER1 -} - -################################################################################ -# Main Main Main -################################################################################ - -header1 "Check NTP/Chrony -# - correct address/name -# - Reach is > 0" -${ANSIBLE_CMD} -b all -m shell -a "chronyc sources" - -header1 "Check Mailing -# - correct relay address/name -# - correct sender address -# - correct recipient address" -ansible -b all -m shell -a "grep -H ^relayhost /etc/postfix/main.cf; grep -H '^\ *from' /etc/kapacitor/kapacitor.conf" - -#!/bin/bash - -################################################################################ -# Global variables -################################################################################ -ANSIBLE_CMD="ansible -i /etc/filescale/cluster.ansible.yml" - -################################################################################ -# Functions -################################################################################ -header1() { -cat << HEADER1 - -################################################################################ -# ${@} -################################################################################ -HEADER1 -} - -################################################################################ -# Main Main Main -################################################################################ - -header1 "Check NTP/Chrony -# - correct address/name -# - Reach is > 0" -${ANSIBLE_CMD} -b all -m shell -a "chronyc sources" - -header1 "Check Mailing -# - correct relay address/name -# - correct sender address -# - correct recipient address" -ansible -b all -m shell -a "grep -H ^relayhost /etc/postfix/main.cf; grep -H '^\ *from' /etc/kapacitor/kapacitor.conf" +${ANSIBLE_CMD} -b all -m shell -a "grep -H ^relayhost /etc/postfix/main.cf; grep -H '^\ *from' /etc/kapacitor/kapacitor.conf" header1 "Do some generic tests with # fs-manager check all" -fs-manager check all \ No newline at end of file +fs-manager check all From 194ee83433ecc60e26594fb94b9c1a92791b9e3c Mon Sep 17 00:00:00 2001 From: Thomas Gebert Date: Wed, 24 Sep 2025 15:28:30 +0200 Subject: [PATCH 2/4] Add MAX CSTATE --- cpupower/cpupower | 1 + cpupower/cpupower.sh | 1 + 2 files changed, 2 insertions(+) diff --git a/cpupower/cpupower b/cpupower/cpupower index d17ec34..2b99100 100644 --- a/cpupower/cpupower +++ b/cpupower/cpupower @@ -1,2 +1,3 @@ CPU_GOVERNOR="performance" +CPU_CSTATE_MAX="C1" CPU_CSTATES_DISABLE_BY_LATENCY="3" diff --git a/cpupower/cpupower.sh b/cpupower/cpupower.sh index 4323c8a..434f142 100644 --- a/cpupower/cpupower.sh +++ b/cpupower/cpupower.sh @@ -34,3 +34,4 @@ if [ ! "${CPU_CSTATES_DISABLE_BY_LATENCY}" == "" ]; then else echo "No CPU Cstates by latency configured." fi + From 776cdf6e92c1fcd1839bee8a1bdfeed711aaa8d2 Mon Sep 17 00:00:00 2001 From: Thomas Gebert Date: Wed, 24 Sep 2025 15:28:30 +0200 Subject: [PATCH 3/4] Add MAX CSTATE --- cpupower/cpupower | 1 + cpupower/cpupower.sh | 15 ++++++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/cpupower/cpupower b/cpupower/cpupower index d17ec34..2b99100 100644 --- a/cpupower/cpupower +++ b/cpupower/cpupower @@ -1,2 +1,3 @@ CPU_GOVERNOR="performance" +CPU_CSTATE_MAX="C1" CPU_CSTATES_DISABLE_BY_LATENCY="3" diff --git a/cpupower/cpupower.sh b/cpupower/cpupower.sh index 4323c8a..7fac44b 100644 --- a/cpupower/cpupower.sh +++ b/cpupower/cpupower.sh @@ -26,8 +26,21 @@ else echo "CPU governor is not set." fi +# Set the Cstate by Max C-State +if [ ! "${CPU_CSTATE_MAX}" == "" ]; then + print_header "Setting CPU CStates to max \"${CPU_CSTATE_MAX}\"" + CPU_POWER_SET_ACTION="-e" + CPU_POWER_CSTATE=0 + for CPU_CSTATE_NAME in /sys/devices/system/cpu/cpu0/cpuidle/state*/name; do + cpupower idle-set "${CPU_POWER_SET_ACTION}" "${CPU_POWER_CSTATE}" &> /dev/null + CPU_POWER_CSTATE=$((CPU_POWER_CSTATE+1)) + if grep -q "\b${CPU_CSTATE_MAX}\b" "${CPU_CSTATE_NAME}"; then + CPU_POWER_SET_ACTION="-d" + fi + done + cpupower idle-info # Set the Cstate by latency -if [ ! "${CPU_CSTATES_DISABLE_BY_LATENCY}" == "" ]; then +elif [ ! "${CPU_CSTATES_DISABLE_BY_LATENCY}" == "" ]; then print_header "Setting CPU CStates by latency to ${CPU_CSTATES_DISABLE_BY_LATENCY}" cpupower idle-set --disable-by-latency "${CPU_CSTATES_DISABLE_BY_LATENCY}" &> /dev/null cpupower idle-info From 6dfffd9f0f4ac8e5fce5ebe8bfc6c1203aac02a6 Mon Sep 17 00:00:00 2001 From: Thomas Gebert Date: Wed, 1 Oct 2025 10:15:40 +0200 Subject: [PATCH 4/4] Add Firewall check --- gp-scripts/checkup.sh | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/gp-scripts/checkup.sh b/gp-scripts/checkup.sh index bed7efa..cff33b6 100644 --- a/gp-scripts/checkup.sh +++ b/gp-scripts/checkup.sh @@ -20,17 +20,43 @@ HEADER1 ################################################################################ # Main Main Main ################################################################################ +header1 "Check Firewall +# Our zones used are external and nterconnecti and client and the bond devices +# have to be attached to one of these" +${ANSIBLE_CMD} -b all -m shell \ + -a 'for zone in external interconnect client; do + echo "### ${zone} ###" + echo -n "running: " + firewall-cmd --zone=external --list-interfaces + echo -n "permanent: " + firewall-cmd --permanent --zone=external --list-interfaces + echo "" + done' + header1 "Check NTP/Chrony # - correct address/name # - Reach is > 0" +${ANSIBLE_CMD} -b all -m shell -a "timedatectl" ${ANSIBLE_CMD} -b all -m shell -a "chronyc sources" + header1 "Check Mailing # - correct relay address/name # - correct sender address # - correct recipient address" -${ANSIBLE_CMD} -b all -m shell -a "grep -H ^relayhost /etc/postfix/main.cf; grep -H '^\ *from' /etc/kapacitor/kapacitor.conf" +${ANSIBLE_CMD} -b all -m shell \ + -a "grep -H ^relayhost /etc/postfix/main.cf; grep -H '^\ *from' /etc/kapacitor/kapacitor.conf" + + +header1 "Check Bonding" +${ANSIBLE_CMD} -b all -m shell \ + -a 'for bond in /proc/net/bonding/bond*; do + echo "### ${bond##*/} ###" + egrep "Bonding Mode|MII Status|Slave Interface|Permanent HW addr|port state|Churn State|Aggregator ID" ${bond} + echo "" + done' + header1 "Do some generic tests with # fs-manager check all"