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.sh

Step 2: Register the Agent

Connect your agent to the SSI backend:

bash
1ssi register

You'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
31EOF

Add the service to the agent:

bash
1ssi add ~/website-check.bash

Step 4: Verify It's Working

List your services:

bash
1ssi list

Check the status:

bash
1ssi status

Manually run the service to test it:

bash
1ssi run website_check

Step 5: Monitor in the App

Open your SSI mobile app — your new service should appear with its current status!


What Just Happened?

  1. The agent registered with the backend and received an authentication token
  2. Your service script was copied to /opt/ssi-agent/.installed-service-scripts/
  3. Systemd timer was created to run the script every 5 minutes
  4. Systemd service was created to execute the script
  5. The daemon is watching the log file and sending updates to the backend

Next Steps

Common Commands

TaskCommand
Add a servicessi add <script.bash>
Remove a servicessi remove <service_id>
List all servicesssi list
Check statusssi status
Run service manuallyssi run <service_id>
View agent infossi whoami