mirror of
https://github.com/OneUptime/oneuptime.git
synced 2026-04-06 00:32:12 +02:00
chore: Update infrastructure agent installation script and documentation
This commit is contained in:
@@ -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
|
||||
@@ -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
|
||||
`}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user