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..7021301 100644 --- a/cpupower/cpupower.sh +++ b/cpupower/cpupower.sh @@ -26,11 +26,25 @@ 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 else - echo "No CPU Cstates by latency configured." + echo "No CPU Cstates configured." fi + diff --git a/gp-scripts/checkup.sh b/gp-scripts/checkup.sh index 05182b1..cff33b6 100644 --- a/gp-scripts/checkup.sh +++ b/gp-scripts/checkup.sh @@ -20,86 +20,44 @@ 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 -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" -#!/bin/bash -################################################################################ -# Global variables -################################################################################ -ANSIBLE_CMD="ansible -i /etc/filescale/cluster.ansible.yml" +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' -################################################################################ -# 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" header1 "Do some generic tests with # fs-manager check all" -fs-manager check all \ No newline at end of file +fs-manager check all