diff --git a/linux_service/README.md b/linux_service/README.md index 16f090e..049e319 100644 --- a/linux_service/README.md +++ b/linux_service/README.md @@ -67,6 +67,10 @@ The [start_moneo_services.sh](./start_moneo_services.sh) script is used to start or ```parallel-ssh -i -t 0 -h hostfile "sudo /opt/azurehpc/tools/Moneo/linux_service/start_moneo_services.sh geneva"``` +#### Exporters Alone #### + +```parallel-ssh -i -t 0 -h hostfile "sudo /opt/azurehpc/tools/Moneo/linux_service/start_moneo_services.sh workers"``` + #### Exporters with Managed Prometheus #### ```parallel-ssh -i -t 0 -h hostfile "sudo /opt/azurehpc/tools/Moneo/linux_service/start_moneo_services.sh"``` diff --git a/linux_service/start_moneo_services.sh b/linux_service/start_moneo_services.sh index fc12fd0..678a72c 100755 --- a/linux_service/start_moneo_services.sh +++ b/linux_service/start_moneo_services.sh @@ -5,6 +5,7 @@ # Managed Prometheus deployment: ./start_moneo_services.sh # Azure Monitor: ./start_moneo_services.sh azure_monitor # Geneva (internal msft): ./start_moneo_services.sh geneva +# Only start workers: ./start_moneo_services.sh workers PublisherMethod=$1 # Modify as necessary @@ -24,14 +25,16 @@ if lspci | grep -iq NVIDIA ; then procs+=("nvidia_exporter") fi -if [[ -n $PublisherMethod ]]; then +if [[ -n $PublisherMethod ]] ; then if [ "$PublisherMethod" == "geneva" ] || [ "$PublisherMethod" == "azure_monitor" ]; then echo "PublisherMethod is valid: $PublisherMethod" + procs+=("metrics_publisher") + elif [ "$PublisherMethod" == "workers" ]; then + echo "Only starting workers" else echo "PublisherMethod is not one of the valid choices." exit 1 fi - procs+=("metrics_publisher") fi function proc_check(){ @@ -69,6 +72,10 @@ sudo systemctl start moneo@node_exporter.service sudo systemctl start moneo@net_exporter.service sudo systemctl start moneo@nvidia_exporter.service +if [ "$PublisherMethod" == "workers" ]; then + proc_check false +fi + if [[ -n $PublisherMethod ]]; then if [ "$PublisherMethod" == "geneva" ]; then sudo $MONEO_PATH/src/worker/start_geneva.sh $PUBLISHER_AUTH /tmp/moneo-worker/publisher/config diff --git a/src/worker/start_geneva.sh b/src/worker/start_geneva.sh index bc3dc13..084523a 100755 --- a/src/worker/start_geneva.sh +++ b/src/worker/start_geneva.sh @@ -6,7 +6,7 @@ CONTAINER_NAME="genevamdmagent" GENEVA_CONFIG=$CONFIG/geneva_config.json # check if the docker container is running -if docker ps --format '{{.Names}}' | grep -q "^${CONTAINER_NAME}$"; then +if sudo docker ps -a --format '{{.Names}}' | grep -q "^${CONTAINER_NAME}$"; then echo "Geneva Docker is running" exit 0 fi