Script management is the right tool when you need direct RouterOS control across one or more sites. SDX wraps scripts in an operational lifecycle so changes can be tested, scheduled, authorized, delivered through the device job plane, and audited afterward. Use scripts for device configuration tasks that are easier or more precise in RouterOS than in a workflow node.Documentation Index
Fetch the complete documentation index at: https://altostrat.io/docs/llms.txt
Use this file to discover all available pages before exploring further.
Prerequisites
Before you schedule a script, make sure you have:- Permission to create and manage scheduled scripts.
- At least one adopted site that can receive jobs.
- A script that has been reviewed for RouterOS version compatibility.
- A test site for validation.
- An authorization path for production execution.
Script Lifecycle
Create And Run A Scheduled Script
Create the script
Go to Scripts, open Scheduled Scripts, then create a scheduled script. Give it a description that will still make sense in an audit trail later.
Select targets
Choose the sites that should receive the script. Keep the first rollout small unless the script is already proven.
Add script content
Write the RouterOS script directly or start from a template. Keep scripts idempotent so retries or partial rollout recovery do not create duplicate configuration.
Templates
Templates help you standardize repeatable scripts. Use templates for tasks your team performs more than once, such as:- Adding common firewall rules.
- Updating service settings.
- Capturing diagnostic state.
- Applying a known workaround.
- Building version-aware script fragments.
AI-Assisted Script Drafting
AI can help draft RouterOS scripts from a natural-language prompt. Use it to speed up first drafts, not to skip review. Before running an AI-generated script:- Read every command.
- Check whether it could remove access, disable services, delete configuration, or change routing.
- Test it on a non-critical site.
- Confirm the resulting device state is what you intended.
- Use the normal authorization flow for production rollout.
Best Practices
Keep scripts idempotent
Check whether objects already exist before adding them. Avoid scripts that fail or duplicate state on a second run.
Use narrow targets first
Prove behavior on one test site, then a small cohort, before a fleet-wide launch.
Prefer templates for repeat work
Templates reduce copy-paste drift and make operational procedures easier to review.
Read outcomes, not just launch state
A launched script is not the same as a successful script. Review each site result.
Related Pages
Configuration backups
Create rollback points and compare device state before or after script changes.
Operational model
Understand how SDX delivers jobs to routers.