Skip to main content
Altostrat’s Script Management transforms how you deploy changes and run operational tasks on your MikroTik fleet. Instead of manually connecting to each device, you can write, schedule, and monitor script executions from a single, centralized platform. This provides a scalable, auditable, and safe way to automate everything from routine maintenance to fleet-wide configuration updates, leveraging the platform’s asynchronous job engine for reliable delivery.

How it Works: The Asynchronous Job Lifecycle

When you schedule a script, you create a Scheduled Script job within the SDX platform. This job progresses through a series of states, and its payload is delivered to target devices via our secure, poll-based communication model. This ensures commands are delivered reliably, even to devices on unstable connections.
1

1. Creation & Authorization

You create a script and define its targets. The job begins in an unauthorized state. An approver must then authorize it, moving it to scheduled. This two-step process provides a critical control gate for all network changes.
2

2. Launch & Execution

At the scheduled launch_at time, the job’s status changes to launched. For each target site, a unique Outcome record is created to track its individual progress.
3

3. Delivery & Reporting

When a target device next checks in with the Altostrat platform, it receives the script, reports its status as busy, executes the payload, and finally reports back with a completed or failed status. This entire process is logged for auditing.
This asynchronous process is fundamental to the platform’s security and resilience. Because the device initiates the connection to fetch the job, you never need to open inbound firewall ports.

The Script Management Toolset

Our platform provides a complete ecosystem for the entire script lifecycle, from creation to execution.

Scheduled Scripts

The core execution engine. Define a RouterOS script, select your target sites, and schedule it to run. Includes built-in safety features like pre-flight backups and a mandatory authorization workflow.

Script Templates

Build a library of reusable, standardized scripts. Templates can be private to your organization or designated as Global (read-only and available to all users), enforcing consistency and best practices.

Community Scripts

Don’t reinvent the wheel. Browse and import from a curated library of public scripts for common MikroTik tasks, sourced directly from the community on GitHub.

AI Script Generation

Your expert co-pilot. Describe your intent in plain English (e.g., “Block all traffic from this IP address”), and our AI will generate a functional and safe RouterOS script for you.

The Scripting Workflow: A Focus on Safety

Our workflow is designed with safety and control as top priorities, ensuring changes are tested, approved, and auditable.
1

1. Create a Scheduled Script

  1. Navigate to Automation → Script Management and click Create Scheduled Script.
  2. Configuration:
    • Description: Give the job a clear, auditable name (e.g., “Q4-2025: Nightly Guest WiFi Disable”).
    • Script Content: Write your RouterOS script, or load it from a Template.
    • Targets: Select the Site(s) where the script will run.
    • Schedule: Set the Launch At time for the execution.
  3. Safety Options:
    • Make Backup: (Highly Recommended) If enabled, the platform automatically prepends a command to your script that performs a secure configuration backup via SFTP before your script content is executed. This creates an immediate rollback point for every device.
    • Test Site: Designate one of your target sites as a test site. This allows you to run a one-off test before scheduling the full deployment.
  4. Click Save. The script is now in an unauthorized state.
2

2. Test the Script (Recommended)

Before deploying to your entire fleet, validate the script’s behavior on your designated test site.
  1. Find your newly created script in the list.
  2. Click the Run Test button.
  3. A test job is dispatched immediately only to the test site. Monitor the Orchestration Log for that site to verify the outcome and check for any errors.
3

3. Authorize the Execution

For security and compliance, a scheduled script must be explicitly authorized before it can run. This creates a clear, auditable approval record for all network changes.
  1. Once you are confident in your script, click the Request Authorization button.
  2. This triggers a notification (via Email and WhatsApp) to the designated approvers in your team, containing a unique, secure link to approve the script’s execution.
  3. An authorized user reviews the script details and approves it, moving its status to Scheduled.
4

4. Monitor the Launch

At the scheduled launch_at time, the job begins. You can monitor its progress in real-time from the Script Management dashboard, which shows the status of each target site: pending, completed, or failed. For detailed output from a specific device, consult its Orchestration Log.

AI Script Generation

Leverage our generative AI to accelerate your scripting process and translate your operational intent into RouterOS code.
  1. From the script editor, click on the AI Generate tab.
  2. In the prompt box, write a clear, concise description of the task you want to accomplish. For best results, state your goal and provide context (e.g., “I need to create a firewall rule to block access to our internal server at 10.1.1.5 from the guest VLAN”).
  3. Click Generate. The AI will produce a script based on your request.
Always review AI-generated scripts carefully. The AI analyzes the script and will flag it as potentially destructive if it contains commands that could cause a loss of connectivity or delete data. Treat these scripts as an expert-drafted starting point, not as a blind instruction. Always use the Run Test feature to validate their behavior in a controlled environment before deploying.

Best Practices

Test Before You Deploy

Always use the Run Test feature on a non-critical site. This is the single most important step to prevent unintended consequences across your fleet.

Keep Scripts Atomic and Idempotent

Write scripts that are self-contained and can be run multiple times without causing errors. For example, use find commands to check if a rule already exists before trying to add it, preventing duplicate configurations.

Build a Template Library

For any script you plan to reuse, save it as a Template. This enforces consistency, saves your team time, and reduces the risk of copy-paste errors. Standardize common tasks by creating shared, read-only Global Templates.