usage: suite: multi-qemu simplify-ci: netdata: netdata_master_host: netdata_master_port: netdata_uuid:
Signed-off-by: Xiao Shenwei xiaoshenwei96@163.com --- setup/netdata | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100755 setup/netdata
diff --git a/setup/netdata b/setup/netdata new file mode 100755 index 00000000..b318dc7c --- /dev/null +++ b/setup/netdata @@ -0,0 +1,45 @@ +#!/bin/sh +# monitoring system resources +# depend on $LKP_SRC/setup/simplify-ci + +check_env() +{ + [ -d "/c/compass-ci" ] || { + echo "please setting the compass-ci environment" + return 1 + } +} + +check_variables() +{ + [[ -n "$netdata_master_host" && -n "$netdata_master_port" && -n "$netdata_uuid" ]] || { + echo "please check the following variables:" + echo "1. netdata_master_host" + echo "2. netdata_master_port" + echo "3. netdata_uuid" + return 1 + } +} + +modify_config_file() +{ + cd /c/compass-ci/container/netdata-slave/config + sed -i "s%destination =.*%destination = $netdata_master_host:$netdata_master_port%g" stream.conf + sed -i "s%api key =.*%api key = $netdata_uuid%g" stream.conf +} + +run_container() +{ + cd /c/compass-ci/container/netdata-slave + ./build && ./run +} + +main() +{ + check_env || return + check_variables || return + modify_config_file + run_container +} + +main
Reviewed-by: Wang Chenglong 18509160991@163.com
On Tue, Dec 08, 2020 at 10:10:59AM +0800, Xiao Shenwei wrote:
usage: suite: multi-qemu simplify-ci: netdata: netdata_master_host: netdata_master_port: netdata_uuid:
Signed-off-by: Xiao Shenwei xiaoshenwei96@163.com
setup/netdata | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100755 setup/netdata
diff --git a/setup/netdata b/setup/netdata new file mode 100755 index 00000000..b318dc7c --- /dev/null +++ b/setup/netdata @@ -0,0 +1,45 @@ +#!/bin/sh +# monitoring system resources +# depend on $LKP_SRC/setup/simplify-ci
+check_env() +{
- [ -d "/c/compass-ci" ] || {
echo "please setting the compass-ci environment"
return 1
- }
+}
+check_variables() +{
- [[ -n "$netdata_master_host" && -n "$netdata_master_port" && -n "$netdata_uuid" ]] || {
echo "please check the following variables:"
echo "1. netdata_master_host"
echo "2. netdata_master_port"
echo "3. netdata_uuid"
return 1
- }
+}
+modify_config_file() +{
- cd /c/compass-ci/container/netdata-slave/config
- sed -i "s%destination =.*%destination = $netdata_master_host:$netdata_master_port%g" stream.conf
- sed -i "s%api key =.*%api key = $netdata_uuid%g" stream.conf
+}
+run_container() +{
- cd /c/compass-ci/container/netdata-slave
- ./build && ./run
+}
+main() +{
- check_env || return
- check_variables || return
- modify_config_file
- run_container
+}
+main
2.23.0