Commit 36430496 authored by QA—索 文涛's avatar QA—索 文涛

new file: qa_shell_script/check/check.sh

	new file:   qa_shell_script/check/project_item.js
	modified:   qa_shell_script/config_server/get_project_config.js
parent c21999aa
#!/bin/bash
echo "=========================="
echo "==== check service ====="
echo "=========================="
servicetatus="/tmp/servicetatus.sh"
function check(){
_type=$1
_name=$2
_port=$3
_desc=$4
_bleo=$5
_targ=$6
#echo "$result" "$key"
#verify "$result" "$key"
#isstart=$?
_name_c=''
_status=''
_desc_c=''
#echo $_name "curl -s ${host}:${_port}"
result=`curl -s ${host}:${_port}`
if [[ $? == 0 ]]
then
_status='\033[32m start \033[0m'
else
_status='\033[31m stop \033[0m'
fi
if [[ ${#_name} -lt 8 ]]
then
_name_c="${_name}\t\t\t"
fi
if [[ ${#_name} -ge 8 && ${#_name} -lt 16 ]]
then
_name_c="${_name}\t\t"
fi
if [[ ${#_name} -ge 16 ]]
then
_name_c="${_name}\t"
fi
if [[ $_bleo =~ "${_targ}" ]]
then
_desc_c="\033[32m ${_desc} \033[0m"
else
_desc_c=" ${_desc} "
fi
echo "echo '${_status}\t|\t${_type}\t|\t${_name_c}\t${_desc_c}' " >>$servicetatus
echo "echo '----------------------------------------------------------------------------------------------'" >>$servicetatus
}
function info(){
echo "echo '\033[31m ---- \033[0m\t\t\t|\t$1' " >>$servicetatus
}
rm -rf $servicetatus
echo "#!/bin/bash" >>"/tmp/servicetatus.sh"
echo "echo '----------------------------------------------------------------------------------------------'" >>"servicetatus.sh"
host="127.0.0.1"
projectStr=`node project_item`
echo $projectStr
for line in ${projectStr[@]}; do
check ${line//|@|/ }
done
info "mysql"
info "zookeeper"
info "redis"
chmod 755 $servicetatus
sh $servicetatus
var item = require("../config_server/get_project_config");
var p="";
function show(objects){
for(var i = 0;i < objects.length; i++) {
p+=objects[i].type +"|@|" + objects[i].name + "|@|"+ objects[i].port +"|@|" + objects[i].desc.replace(/\s/g,"-") +"|@||" +" ";
}
}
show(item.java);
show(item.ui);
show(item.node);
show(item.python);
console.log(p);
\ No newline at end of file
...@@ -222,6 +222,15 @@ configFunction.prototype = { ...@@ -222,6 +222,15 @@ configFunction.prototype = {
} }
} }
} }
module.exports={
java : java_projects,
node : node_projects,
python : python_projects,
ui : ui_projects
}
var F = new configFunction(); var F = new configFunction();
if (param["type"] == "") { if (param["type"] == "") {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment