chore: Update infrastructure agent installation script and documentation

This commit is contained in:
Simon Larsen
2024-05-14 17:55:15 +01:00
parent 0e3eb81ae4
commit b30bb4c95e
4 changed files with 9 additions and 67 deletions

View File

@@ -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

View File

@@ -28,16 +28,16 @@ const ServerMonitorDocumentation: FunctionComponent<ComponentProps> = (
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
`}

View File

@@ -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