Skip to content

Commit

Permalink
modify start scripts to correct bugs and add worker only launch
Browse files Browse the repository at this point in the history
modify start scripts to correct bugs and add worker only launch

modify start scripts to correct bugs and add worker only launch
  • Loading branch information
Ubuntu authored and Ubuntu committed Feb 27, 2024
1 parent 9d59626 commit 29a6bd7
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
4 changes: 4 additions & 0 deletions linux_service/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"```
Expand Down
11 changes: 9 additions & 2 deletions linux_service/start_moneo_services.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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(){
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/worker/start_geneva.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 29a6bd7

Please sign in to comment.