Quick Start
This guide will get you up and running with the SSI Agent in under 5 minutes.
Step 1: Install the Agent
bash
1git clone https://github.com/RemiZlatinis/ssi-agent.git
2cd ssi-agent
3sudo ./install.shStep 2: Register the Agent
Connect your agent to the SSI backend:
bash
1ssi registerYou'll see output like:
shell
1Registration Code: `123-456`
2
3Enter this code in an SSI client to complete registration.
4Waiting for confirmation...Open your SSI client, navigate to Add Agent, and enter the 6-digit code.
Step 3: Add Your First Service
Create a simple service script to monitor something. Here's an example that checks if a website is reachable:
Note the Block Structure of the service script
bash
1# Create a new service script
2cat > ~/website-check.bash << 'EOF'
3#!/bin/bash
4
5# --- Manifest --- #
6# name: Website Check
7# description: Checks if example.com is reachable
8# version: 1.0
9# schedule: *:0/5:00
10# timeout: 30
11
12# --- Standard Constants --- #
13STATUS_OK="OK"
14STATUS_UPDATE="UPDATE"
15STATUS_WARNING="WARNING"
16STATUS_FAILURE="FAILURE"
17TIMESTAMP=$(date +"%Y-%m-%d %H:%M:%S")
18
19# --- Configurations --- #
20URL="https://example.com"
21
22# --- Main --- #
23HTTP_CODE=$(curl -s -o /dev/null -w "%{http_code}" "$URL" 2>/dev/null)
24
25if [ "$HTTP_CODE" = "200" ]; then
26 echo "$TIMESTAMP, $STATUS_OK, Website is reachable"
27else
28 echo "$TIMESTAMP, $STATUS_FAILURE, Website returned HTTP $HTTP_CODE"
29 exit 1
30fi
31EOFAdd the service to the agent:
bash
1ssi add ~/website-check.bashStep 4: Verify It's Working
List your services:
bash
1ssi listCheck the status:
bash
1ssi statusManually run the service to test it:
bash
1ssi run website_checkStep 5: Monitor in the App
Open your SSI mobile app — your new service should appear with its current status!
What Just Happened?
- The agent registered with the backend and received an authentication token
- Your service script was copied to
/opt/ssi-agent/.installed-service-scripts/ - Systemd timer was created to run the script every 5 minutes
- Systemd service was created to execute the script
- The daemon is watching the log file and sending updates to the backend
Next Steps
Common Commands
| Task | Command |
|---|---|
| Add a service | ssi add <script.bash> |
| Remove a service | ssi remove <service_id> |
| List all services | ssi list |
| Check status | ssi status |
| Run service manually | ssi run <service_id> |
| View agent info | ssi whoami |