Command Runners (Agents)
Windows Agent Installation Guide
This document shows how to install and manage the Windows agent for Unmeshed Job Scheduling Platform. The agent runs natively on Windows machines and executes scheduled jobs as configured on the Unmeshed Platform.
Prerequisites
Unmeshed CLI
To install the agent, you must first install the Unmeshed CLI. You can find the guide here.
The CLI provides commands to install and manage agents:
install-agent: Download and set up the agent binaries.uninstall-agent: Remove the agent from the system.
Installation
Run the following command in PowerShell or Command Prompt to download the agent components. You will be prompted to select an installation directory.
Once the download is complete, the CLI will output specific instructions for configuring and running the agent.
Configuration and Service Setup
We recommend setting up the agent as a Windows Service for production environments. This ensures the agent starts automatically with Windows and runs in the background.
Step 1: Set Environment Variables
Create a batch file named set-env.bat in your installation directory (e.g., C:\unmeshed\agent\set-env.bat) with the following content. Replace the placeholder values with your actual credentials.
Right-click set-env.bat and select "Run as administrator" to apply these changes.
Step 2: Install the Windows Service
Open a Command Prompt or PowerShell as Administrator and run the following commands to create the service.
Note: Replace C:\unmeshed\agent\unmeshed-agent.exe with the actual path to your downloaded agent executable.
Step 3: Start the Service
Start the newly created service:
Verification
Check if the service is running:
You should see STATE : 4 RUNNING.
Additionally, you can verify connectivity in the Unmeshed Dashboard:
- Go to Settings -> Connected Worker Clients.
- Look for your Windows workers (e.g.,
cmd.agent.windows). - Status should be Connected.
Default Worker Configuration
The default configuration registers three types of workers:
| Worker Type | Env Variable | Default Value | Description |
|---|---|---|---|
| Command | CMD_WORKER_NAMES | default:cmd.agent.windows:50 | Executes shell/batch commands. |
| HTTP | HTTP_WORKER_NAMES | default:http.windows:100 | Executes HTTP requests. |
| File Watcher | FILEWATCHER_WORKER_NAMES | default:filewatcher.windows:50 | Monitors file system changes. |
Format: namespace:worker_name:concurrency
Operating the Agent
Service Management Commands
Use these commands in an Administrative Command Prompt/PowerShell:
Viewing Logs
Logs are typically written to the installation directory or the Windows Event Viewer.
You can also check the Windows Event Viewer under Windows Logs -> Application for service-level events.
Uninstalling
To completely remove the agent:
-
Stop and Delete the Service (Run as Admin):
powershell -
Stop any remaining processes:
powershell -
Remove Environment Variables (Optional, Run as Admin):
powershell -
Delete Installation Files: Remove the directory where you installed the agent (e.g.,
C:\unmeshed\agent).
Troubleshooting
- Service fails to start:
- Verify the path in
binPathis correct duringsc create. - Ensure you ran
set-env.batas Administrator. - Check
agent.login the installation folder.
- Verify the path in
- Agent not connecting:
- Verify
UNMESHED_AUTH_IDandUNMESHED_AUTH_TOKENare correct. - Ensure the server URL is reachable from the Windows machine.
- Check Windows Firewall settings to allow outbound HTTPS connections.
- Verify