1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-08-07 03:22:57 +03:00
This commit is contained in:
David Hill
2017-05-20 17:41:22 -05:00
parent 6c93fe5496
commit fa21239a7e

View File

@@ -532,35 +532,33 @@ checkFirewalls()
# FIREWALL checks # FIREWALL checks
# #
echo "" echo ""
echo "** Run Firewall Services check - Firewall Services should to be disabled on all nodes" echo "** Run Firewall Services check - Firewall Services should to be Inactive on all nodes"
echo "" echo ""
declare -a FIREWALL_LIST=("iptables" "ufw" "firewalld" "firewall") declare -a FIREWALL_LIST=("iptables" "ufw" "firewalld" "firewall")
fpass=true fpass=true
#check local FIREWALLS #check local FIREWALLS
`chkconfig > /tmp/firewall_check 2>&1`
for firewall in "${FIREWALL_LIST[@]}"; do for firewall in "${FIREWALL_LIST[@]}"; do
pass=true pass=true
`cat /tmp/firewall_check | grep $firewall | grep on > /dev/null 2>&1` `service $firewall status > /tmp/firewall1_check 2>&1`
if [ "$?" -eq 0 ]; then if [ "$?" -eq 0 ]; then
echo "${bold}Failed${normal}, Local Node $firewall service is Enabled in chkconfig, please disable" echo "${bold}Failed${normal}, Local Node $firewall service is Active, please disable"
pass=false
fpass=false
REPORTPASS=false
else
`systemctl status $firewall > /tmp/firewall1_check 2>&1`
if [ "$?" -eq 0 ]; then
echo "${bold}Failed${normal}, Local Node $firewall service is Active, please disable"
pass=false pass=false
fpass=false fpass=false
REPORTPASS=false REPORTPASS=false
fi fi
`systemctl status $firewall > /tmp/firewall1_check 2>&1`
`cat /tmp/firewall1_check | grep "Active: active" > /dev/null 2>&1`
if [ "$?" -eq 0 ]; then
echo "${bold}Failed${normal}, Local Node $firewall service is Enabled in systemctl, please disable"
pass=false
fpass=false
REPORTPASS=false
fi fi
if $pass ; then if $pass ; then
echo "Local Node $firewall service is Not Enabled" echo "Local Node $firewall service is Not Active"
fi fi
done done
@@ -571,71 +569,22 @@ checkFirewalls()
echo "" echo ""
fpass=true fpass=true
for ipadd in "${NODE_IPADDRESS[@]}"; do for ipadd in "${NODE_IPADDRESS[@]}"; do
`./remote_command.sh $ipadd $PASSWORD 'chkconfig > /tmp/firewall_check 2>&1' 1 > /tmp/remote_command_check`
rc="$?"
if [ $rc -eq 0 ] || ( [ $rc -eq 2 ] && [ $OS == "suse12" ] ) ; then
`./remote_scp_get.sh $ipadd $PASSWORD /tmp/firewall_check > /tmp/remote_scp_get_check 2>&1`
if [ "$?" -ne 0 ]; then
echo "Error running remote_scp_get.sh to $ipadd Node, check /tmp/remote_scp_get_check"
else
for firewall in "${FIREWALL_LIST[@]}"; do
pass=true
`cat firewall_check | grep $firewall | grep on > /dev/null 2>&1`
if [ "$?" -eq 0 ]; then
echo "${bold}Failed${normal}, $ipadd Node $firewall service is Enabled in chkconfig, please disable"
pass=false
fpass=false
REPORTPASS=false
fi
`./remote_command.sh $ipadd $PASSWORD "systemctl status '$firewall' > /tmp/firewall1_check 2>&1" 1 > /tmp/remote_command_check`
rc="$?"
if [ $rc -eq 0 ] || ( [ $rc -eq 2 ] && [ $OS == "suse12" ] ) ; then
`./remote_scp_get.sh $ipadd $PASSWORD /tmp/firewall1_check > /tmp/remote_scp_get_check 2>&1`
if [ "$?" -ne 0 ]; then
echo "Error running remote_scp_get.sh to $ipadd Node, check /tmp/remote_scp_get_check"
else
`cat firewall1_check | grep "Active: active" > /dev/null 2>&1`
if [ "$?" -eq 0 ]; then
echo "${bold}Failed${normal}, $ipadd Node $firewall service is Enabled in systemctl, please disable"
pass=false
fpass=false
REPORTPASS=false
fi
`rm -f firewall1_check`
fi
fi
if $pass ; then
echo "$ipadd Node $firewall service is Not Enabled"
fi
done
`rm -f firewall_check`
fi
else
# 'sysconfig not on remote node # 'sysconfig not on remote node
for firewall in "${FIREWALL_LIST[@]}"; do for firewall in "${FIREWALL_LIST[@]}"; do
pass=true pass=true
`./remote_command.sh $ipadd $PASSWORD "systemctl status '$firewall' > /tmp/firewall1_check 2>&1" 1 > /tmp/remote_command_check` `./remote_command.sh $ipadd $PASSWORD "service '$firewall' status > /tmp/firewall_check 2>&1" 1 > /tmp/remote_command_check`
rc="$?"
if [ $rc -eq 0 ] || ( [ $rc -eq 2 ] && [ $OS == "suse12" ] ) ; then
`./remote_scp_get.sh $ipadd $PASSWORD /tmp/firewall1_check > /tmp/remote_scp_get_check 2>&1`
if [ "$?" -ne 0 ]; then
echo "Error running remote_scp_get.sh to $ipadd Node, check /tmp/remote_scp_get_check"
else
`cat firewall1_check | grep "Active: active" > /dev/null 2>&1`
if [ "$?" -eq 0 ]; then if [ "$?" -eq 0 ]; then
echo "${bold}Failed${normal}, $ipadd Node $firewall service is Enabled in systemctl, please disable" echo "${bold}Failed${normal}, $ipadd Node $firewall service is Active, please disable"
pass=false
fpass=false
REPORTPASS=false
else
`./remote_command.sh $ipadd $PASSWORD "systemctl status '$firewall' > /tmp/firewall_check 2>&1" 1 > /tmp/remote_command_check`
if [ "$?" -eq 0 ]; then
echo "${bold}Failed${normal}, $ipadd Node $firewall service is Active, please disable"
pass=false pass=false
fpass=false fpass=false
REPORTPASS=false REPORTPASS=false
fi
`rm -f firewall1_check`
if $pass ; then
echo "$ipadd Node $firewall service is Not Enabled"
fi
fi fi
fi fi
@@ -643,7 +592,6 @@ checkFirewalls()
echo "$ipadd Node $firewall service is Not Enabled" echo "$ipadd Node $firewall service is Not Enabled"
fi fi
done done
fi
echo "" echo ""
done done
@@ -656,14 +604,14 @@ checkFirewalls()
# rcSuSEfirewall2 check # rcSuSEfirewall2 check
# #
echo "" echo ""
echo "** Run rcSuSEfirewall2 check - Service should to be disabled on all nodes" echo "** Run rcSuSEfirewall2 check - Service should to be Inactive on all nodes"
echo "" echo ""
pass=true pass=true
#check local IPTABLES #check local IPTABLES
`/sbin/rcSuSEfirewall2 status > /tmp/rcSuSEfirewall2_check 2>&1` `/sbin/rcSuSEfirewall2 status > /tmp/rcSuSEfirewall2_check 2>&1`
if [ "$?" -eq 0 ]; then if [ "$?" -eq 0 ]; then
echo "${bold}Failed${normal}, Local Node rcSuSEfirewall2 service is Enabled, please disable" echo "${bold}Failed${normal}, Local Node rcSuSEfirewall2 service is Active, please disable"
pass=false pass=false
REPORTPASS=false REPORTPASS=false
else else
@@ -674,7 +622,7 @@ checkFirewalls()
`./remote_command.sh $ipadd $PASSWORD '/sbin/rcSuSEfirewall2 status > /tmp/rcSuSEfirewall2_check 2>&1' 1 > /tmp/remote_command_check` `./remote_command.sh $ipadd $PASSWORD '/sbin/rcSuSEfirewall2 status > /tmp/rcSuSEfirewall2_check 2>&1' 1 > /tmp/remote_command_check`
rc="$?" rc="$?"
if [ $rc -eq 0 ] ; then if [ $rc -eq 0 ] ; then
echo "${bold}Failed${normal}, $ipadd Node rcSuSEfirewall2 service is Enabled, please disable" echo "${bold}Failed${normal}, $ipadd Node rcSuSEfirewall2 service is Active, please disable"
pass=false pass=false
REPORTPASS=false REPORTPASS=false
else else
@@ -927,7 +875,7 @@ checkPackages()
for PKG in "${UBUNTU_PKG[@]}"; do for PKG in "${UBUNTU_PKG[@]}"; do
`./remote_command.sh $ipadd $PASSWORD "dpkg -s '$PKG' > /tmp/pkg_check 2>&1" 1 > /tmp/remote_command_check 2>&1` `./remote_command.sh $ipadd $PASSWORD "dpkg -s '$PKG' > /tmp/pkg_check 2>&1" 1 > /tmp/remote_command_check 2>&1`
rc="$?" rc="$?"
if [ $rc -eq 0 ] || ( [ $rc -eq 2 ] && [ $OS == "suse12" ] ) ; then if [ $rc -eq 0 ] ; then
`./remote_scp_get.sh $ipadd $PASSWORD /tmp/pkg_check > /tmp/remote_scp_get_check 2>&1` `./remote_scp_get.sh $ipadd $PASSWORD /tmp/pkg_check > /tmp/remote_scp_get_check 2>&1`
if [ "$?" -ne 0 ]; then if [ "$?" -ne 0 ]; then
echo "Error running remote_scp_get.sh to $ipadd Node, check /tmp/remote_scp_get_check" echo "Error running remote_scp_get.sh to $ipadd Node, check /tmp/remote_scp_get_check"
@@ -998,15 +946,29 @@ checkPackages()
for PKG in "${DEBIAN_PKG[@]}"; do for PKG in "${DEBIAN_PKG[@]}"; do
`./remote_command.sh $ipadd $PASSWORD "dpkg -s '$PKG' > /tmp/pkg_check 2>&1" 1 > /tmp/remote_command_check 2>&1` `./remote_command.sh $ipadd $PASSWORD "dpkg -s '$PKG' > /tmp/pkg_check 2>&1" 1 > /tmp/remote_command_check 2>&1`
rc="$?" rc="$?"
if [ $rc -eq 2 ] ; then if [ $rc -eq 0 ] ; then
echo "${bold}Failed${normal}, $ipadd Node, 'dpkg' not installed" `./remote_scp_get.sh $ipadd $PASSWORD /tmp/pkg_check > /tmp/remote_scp_get_check 2>&1`
if [ "$?" -ne 0 ]; then
echo "Error running remote_scp_get.sh to $ipadd Node, check /tmp/remote_scp_get_check"
else
`cat /tmp/remote_command_check | grep 'command not found' > /dev/null 2>&1`
if [ "$?" -eq 0 ]; then
echo "${bold}Failed${normal}, $ipadd Node ${bold}dpkg${normal} package not installed"
pass=false pass=false
REPORTPASS=false
break break
elif [ $rc -eq 1 ] ; then else
`cat pkg_check | grep 'install ok installed' > /dev/null 2>&1`
if [ "$?" -ne 0 ]; then
echo "${bold}Failed${normal}, $ipadd Node package ${bold}${PKG}${normal} is not installed, please install" echo "${bold}Failed${normal}, $ipadd Node package ${bold}${PKG}${normal} is not installed, please install"
pass=false pass=false
REPORTPASS=false fi
`rm -f pkg_check`
fi
fi
else
echo "Error running remote_command.sh to $ipadd Node, check /tmp/remote_command_check"
pass=false
fi fi
done done