From b30bb4c95e99dac5d84b50d9fb86a75d38fbf847 Mon Sep 17 00:00:00 2001 From: Simon Larsen Date: Tue, 14 May 2024 17:55:15 +0100 Subject: [PATCH] chore: Update infrastructure agent installation script and documentation --- .../infrastructure-agent/install-linux.sh | 54 ------------------- .../scripts/infrastructure-agent}/install.sh | 0 .../Monitor/ServerMonitor/Documentation.tsx | 12 ++--- InfrastructureAgent/README.md | 10 ++-- 4 files changed, 9 insertions(+), 67 deletions(-) delete mode 100644 App/FeatureSet/Docs/Static/scripts/infrastructure-agent/install-linux.sh rename {InfrastructureAgent => App/FeatureSet/Docs/Static/scripts/infrastructure-agent}/install.sh (100%) diff --git a/App/FeatureSet/Docs/Static/scripts/infrastructure-agent/install-linux.sh b/App/FeatureSet/Docs/Static/scripts/infrastructure-agent/install-linux.sh deleted file mode 100644 index 176c7be51f..0000000000 --- a/App/FeatureSet/Docs/Static/scripts/infrastructure-agent/install-linux.sh +++ /dev/null @@ -1,54 +0,0 @@ -#!/bin/bash - -# Check if this is debian based - -# Check if system supports apt-get - -if [ -x "$(command -v apt-get)" ]; then - # Update apt-get - sudo apt-get update - # Install build-essential - sudo apt-get install build-essential -y -fi - -# Check if system supports yum -if [ -x "$(command -v yum)" ]; then - # Update yum - sudo yum update - # Install build-essential - sudo yum install gcc-c++ make -y -fi - -# Check if system supports apk -if [ -x "$(command -v apk)" ]; then - # Update apk - sudo apk update - # Install build-essential - sudo apk add build-base -fi - - -# Install NVM -curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash - -# Export to path -export NVM_DIR="$HOME/.nvm" -[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm -[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion - - -# Refresh bash -source ~/.bashrc - -# Install latest Node.js via NVM -nvm install node - -# Make this nodejs version the default -nvm alias default node - -# Use the default version -nvm use default - -# Now install -npm install -g tsx -npm install -g @oneuptime/infrastructure-agent diff --git a/InfrastructureAgent/install.sh b/App/FeatureSet/Docs/Static/scripts/infrastructure-agent/install.sh similarity index 100% rename from InfrastructureAgent/install.sh rename to App/FeatureSet/Docs/Static/scripts/infrastructure-agent/install.sh diff --git a/Dashboard/src/Components/Monitor/ServerMonitor/Documentation.tsx b/Dashboard/src/Components/Monitor/ServerMonitor/Documentation.tsx index 15a26c63c0..181699266f 100644 --- a/Dashboard/src/Components/Monitor/ServerMonitor/Documentation.tsx +++ b/Dashboard/src/Components/Monitor/ServerMonitor/Documentation.tsx @@ -28,16 +28,16 @@ const ServerMonitorDocumentation: FunctionComponent = ( language="bash" code={` # Install the agent -curl -s ${HTTP_PROTOCOL}${HOST.toString()}/docs/static/scripts/infrastructure-agent/install-linux.sh | bash +curl -s ${HTTP_PROTOCOL}${HOST.toString()}/docs/static/scripts/infrastructure-agent/install.sh | bash -# For Windows and MacOS, install NodeJS and NPM and then... -npm install -g @oneuptime/infrastructure-agent tsx - -# Run the agent -oneuptime-infrastructure-agent start --secret-key=${props.secretKey.toString()} ${ +# Configure the agent +oneuptime-infrastructure-agent configure --secret-key=${props.secretKey.toString()} ${ showHost ? '--oneuptime-url=' + host : '' } +# To Start +oneuptime-infrastructure-agent start + # To Stop oneuptime-infrastructure-agent stop `} diff --git a/InfrastructureAgent/README.md b/InfrastructureAgent/README.md index 21dbedc0d0..48e7747212 100644 --- a/InfrastructureAgent/README.md +++ b/InfrastructureAgent/README.md @@ -4,14 +4,8 @@ The OneUptime Infrastructure Agent is a lightweight, open-source agent that coll ## Installation -Download the Installation Script -```bash -curl -O https://raw.githubusercontent.com/anxuanzi/oneuptime-infrastructure-agent-go/main/install.sh ``` - -Run the Installation Script -```bash -chmod +x install.sh && ./install.sh +curl -s https://oneuptime.com/docs/static/scripts/infrastructure-agent/install.sh | bash ``` ## Configure the agent @@ -19,6 +13,7 @@ chmod +x install.sh && ./install.sh Configure the agent as a system service - You can change the host to your own host if you're self hosting the OneUptime platform. - You can find the secret key on OneUptime Dashboard. Click on "View Monitor" and go to "Settings" tab. + ```bash oneuptime-infrastructure-agent configure --secret-key=YOUR_SECRET_KEY --oneuptime-url=https://oneuptime.com ``` @@ -28,6 +23,7 @@ oneuptime-infrastructure-agent configure --secret-key=YOUR_SECRET_KEY --oneuptim ``` oneuptime-infrastructure-agent start ``` + Once its up and running you should see the metrics on the OneUptime Dashboard. ## Stopping the agent