Unmeshed Logo

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.

powershell

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.

batch

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.

powershell

Step 3: Start the Service

Start the newly created service:

powershell

Verification

Check if the service is running:

powershell

You should see STATE : 4 RUNNING.

Additionally, you can verify connectivity in the Unmeshed Dashboard:

  1. Go to Settings -> Connected Worker Clients.
  2. Look for your Windows workers (e.g., cmd.agent.windows).
  3. Status should be Connected.

Default Worker Configuration

The default configuration registers three types of workers:

Worker TypeEnv VariableDefault ValueDescription
CommandCMD_WORKER_NAMESdefault:cmd.agent.windows:50Executes shell/batch commands.
HTTPHTTP_WORKER_NAMESdefault:http.windows:100Executes HTTP requests.
File WatcherFILEWATCHER_WORKER_NAMESdefault:filewatcher.windows:50Monitors file system changes.

Format: namespace:worker_name:concurrency

Operating the Agent

Service Management Commands

Use these commands in an Administrative Command Prompt/PowerShell:

powershell

Viewing Logs

Logs are typically written to the installation directory or the Windows Event Viewer.

powershell

You can also check the Windows Event Viewer under Windows Logs -> Application for service-level events.

Uninstalling

To completely remove the agent:

  1. Stop and Delete the Service (Run as Admin):

    powershell
  2. Stop any remaining processes:

    powershell
  3. Remove Environment Variables (Optional, Run as Admin):

    powershell
  4. 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 binPath is correct during sc create.
    • Ensure you ran set-env.bat as Administrator.
    • Check agent.log in the installation folder.
  • Agent not connecting:
    • Verify UNMESHED_AUTH_ID and UNMESHED_AUTH_TOKEN are correct.
    • Ensure the server URL is reachable from the Windows machine.
    • Check Windows Firewall settings to allow outbound HTTPS connections.