How to create a Script and a Query for your Generic OLT?

How to create a Script and a Query for your Generic OLT?

Once your Generic OLT has been added, you can configure 2 types of elements:

 In this article

 Important

You need to know the exact CLI commands of your OLT (Telnet) and/or the SNMP OIDs supported by your device. If you don't have them at hand, check your manufacturer's manual before continuing.

Create a Script

1 Go to OLT > [your OLT] > Scripts, Scripts tab.


2 Select one of the 2 buttons:

  • Add from template: creates the script with the typical commands already loaded as a starting point (if a template exists for that action).
  • Add blank: creates an empty script, letting you choose the Action Type.

 Information

Both options will take you to the same edit form.

3 Fill out the script form:

  1. Name / label: how you'll identify this script.
  2. Action Type: which AdminOLT action this script executes (only editable if it wasn't set automatically).
  3. Commands (steps): use Add command to add each line to be sent to the OLT, in order. You can use variables like {{port}}, {{onu_index}}, {{sn}}, which AdminOLT automatically replaces with the real value when running the script.

4 Save the script.

 Restore template

If you edited a script and want to go back to the base version, use the Restore template button (only visible if a template is available for that action).

Create a Query (Telnet or SNMP)

1 Go to the Telnet Queries or SNMP Queries tab as needed, and select Add query.

2 Fill out the basic details:

  1. Name: how you'll identify this query.
  2. Action: which AdminOLT information this query feeds (e.g. "VLAN List").
  3. Active: whether the query is enabled.

3 On the edit screen, add its steps with Add step:

4 Save the query.

 Important

When pasting Regex/TextFSM or Python Process text from another source (e.g. an email, a chat), check that no extra line breaks or spaces were added — this is the most common cause of syntax errors in these queries.
  • Telnet Query — each step: Name, Command, Regex / TextFSM, Python Process (optional).
  • Action: which AdminOLT information this query feeds (e.g. "VLAN List").
  • Active: whether the query is enabled.
    • Telnet Query — each step: Name, Command, Regex / TextFSM, Python Process (optional).
    • SNMP Query — each step: Name, OID, DB switch, Python Process.

Sept. 11, 2026, 9:37 a.m. - Visitas: 105