Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated readme #3

Merged
merged 1 commit into from
Nov 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 19 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ CGO_ENABLED=0 go build -trimpath -o linux-agent

Download the latest release:
```bash
$ wget https://github.com/infrasonar/linux-agent/releases/download/v0.1.0/linux-agent
wget https://github.com/infrasonar/linux-agent/releases/download/v0.1.0/linux-agent
```

> _The pre-build binary is build for the **linux-amd64** platform. For other platforms build from source using the command:_ `CGO_ENABLED=0 go build -o linux-agent`
Expand All @@ -40,14 +40,14 @@ chmod +x linux-agent
Copy the binary to `/usr/sbin/infrasonar-linux-agent`

```
$ sudo cp linux-agent /usr/sbin/infrasonar-linux-agent
sudo cp linux-agent /usr/sbin/infrasonar-linux-agent
```

### Using Systemd

```bash
$ sudo touch /etc/systemd/system/infrasonar-linux-agent.service
$ sudo chmod 664 /etc/systemd/system/infrasonar-linux-agent.service
sudo touch /etc/systemd/system/infrasonar-linux-agent.service
sudo chmod 664 /etc/systemd/system/infrasonar-linux-agent.service
```

**1. Using you favorite editor, add the content below to the file created:**
Expand All @@ -65,35 +65,41 @@ ExecStart=/usr/sbin/infrasonar-linux-agent
WantedBy=multi-user.target
```

**2. Create the file `/etc/infrasonar/linux-agent.env` with at least:**
**2. Create the directory `/etc/infrasonar`**

```bash
sudo mkdir /etc/infrasonar
```

**3. Create the file `/etc/infrasonar/linux-agent.env` with at least:**

```
TOKEN=<YOUR TOKEN HERE>
```

Optionaly, add environment variable to the `linux-agent.env` file for settings like `ASSET_ID` or `CONFIG_PATH` _(see all [environment variables](#environment-variables) in the table above)_.

**3. Reload systemd:**
**4. Reload systemd:**

```bash
$ sudo systemctl daemon-reload
sudo systemctl daemon-reload
```

**4. Install the service:**
**5. Install the service:**

```bash
$ sudo systemctl enable infrasonar-linux-agent
sudo systemctl enable infrasonar-linux-agent
```

**Finally, you may want to start/stop or view the status:**
```bash
$ sudo systemctl start infrasonar-linux-agent
$ sudo systemctl stop infrasonar-linux-agent
$ sudo systemctl status infrasonar-linux-agent
sudo systemctl start infrasonar-linux-agent
sudo systemctl stop infrasonar-linux-agent
sudo systemctl status infrasonar-linux-agent
```

**View logging:**
```bash
$ journalctl -u infrasonar-linux-agent
journalctl -u infrasonar-linux-agent
```