-
Notifications
You must be signed in to change notification settings - Fork 455
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8c214bc
commit 38427e1
Showing
3 changed files
with
104 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
#!/bin/bash | ||
|
||
set +e | ||
checkresult=/var/log/kube-ovn/env-check.log | ||
echo "Start environment check" > $checkresult | ||
echo "1) check cni configuration" >> $checkresult | ||
if [ ! -e "/etc/cni/net.d" ]; then | ||
echo "Directory /etc/cni/net.d does not exist, please check kube-ovn-cni pod status" >> $checkresult | ||
fi | ||
for file in $(ls "/etc/cni/net.d") | ||
do | ||
if [[ ! $file =~ "kube-ovn.conflist" ]]; then | ||
echo "Check files in /etc/cni/net.d, make sure if the config file $file should be deleted" >> $checkresult | ||
fi | ||
done | ||
|
||
echo "2) check system ipv4 config" >> $checkresult | ||
probe_mtu=`cat /proc/sys/net/ipv4/tcp_mtu_probing` | ||
if [ $probe_mtu == 0 ]; then | ||
echo "The 'tcp_mtu_probing' config may affect traffic, make sure if /proc/sys/net/ipv4/tcp_mtu_probing should be set to 1" >> $checkresult | ||
fi | ||
recycle=`cat /proc/sys/net/ipv4/tcp_tw_recycle` | ||
if [ $recycle == 1 ]; then | ||
echo "The 'tcp_tw_recycle' config affects nodeport service, make sure change /proc/sys/net/ipv4/tcp_tw_recycle to 0" >> $checkresult | ||
fi | ||
|
||
echo "3) check checksum value" >> $checkresult | ||
netstat -s > /dev/null | ||
if [[ $? != 0 ]]; then | ||
echo "The netstat cmd not found, maybe can be installed mannully and exec 'netstat -s' to check if there is 'InCsumErrors'" >> $checkresult | ||
echo "If there's 'InCsumErrors' and the value is increasing, should exec cmd 'ethtool -K ETH tx off' to disable checksum, where 'ETH' is the nic used for traffics" >> $checkresult | ||
else | ||
result=`netstat -s` | ||
if [[ $result =~ "InCsumErrors" ]]; then | ||
echo "Found 'InCsumErrors' para after exec 'netstat -s' cmd, check if the value is increasing, maybe should exec cmd 'ethtool -K ETH tx off' to disable checksum, where 'ETH' is the nic used for traffics" >> $checkresult | ||
fi | ||
fi | ||
|
||
echo "4) check dns config" >> $checkresult | ||
result=`cat /etc/resolv.conf` | ||
if [[ $result =~ ".com" ]]; then | ||
echo "There's *.com in dns search name, make sure the config /etc/resolv.conf is right" >> $checkresult | ||
fi | ||
|
||
echo "5) check firewall config" >> $checkresult | ||
result=`systemctl status firewalld` | ||
if [[ $result =~ "running" ]]; then | ||
echo "The firewalld is running, make sure it has no effect on traffics across nodes" >> $checkresult | ||
fi | ||
|
||
result=`ps -ef | grep security | wc -l` | ||
if [[ $result > 1 ]]; then | ||
echo "Found pid with '*security*' name, make sure it has no effect on traffics" >> $checkresult | ||
fi | ||
result=`ps -ef | grep qax | wc -l` | ||
if [[ $result > 1 ]]; then | ||
echo "Found pid with '*qax*' name, make sure it has no effect on traffics" >> $checkresult | ||
fi | ||
result=`ps -ef | grep safe | wc -l` | ||
if [[ $result > 1 ]]; then | ||
echo "Found pid with '*safe*' name, make sure it has no effect on traffics" >> $checkresult | ||
fi | ||
result=`ps -ef | grep defence | wc -l` | ||
if [[ $result > 1 ]]; then | ||
echo "Found pid with '*defence*' name, make sure it has no effect on traffics" >> $checkresult | ||
fi | ||
result=`ps -ef | grep vmsec | wc -l` | ||
if [[ $result > 1 ]]; then | ||
echo "Found pid with '*vmsec*' name, make sure it has no effect on traffics" >> $checkresult | ||
fi | ||
|
||
echo "6) check geneve 6081 connection" >> $checkresult | ||
nmap -sU 127.0.0.1 -p 6081 > /dev/null | ||
if [[ $? != 0 ]]; then | ||
echo "The nmap cmd not found, maybe can be installed mannully and exec 'nmap -sU 127.0.0.1 -p 6081' to check port connection" >> $checkresult | ||
else | ||
result=`nmap -sU 127.0.0.1 -p 6081` | ||
wait | ||
if [[ ! $result =~ "open" ]]; then | ||
echo "The 6081 port for geneve encapsulation may be not available, please check if ovs-ovn pod is health" >> $checkresult | ||
fi | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters