Index


General information
    Rationale
    Some details
Example 1 (create COMMAND Launcher without parameter substitution)
Example 2 (modify existing COMMAND Launcher to add parameter substitution)


General information

Rationale

Folks who support complicated remote equipment via command line access usually work as follows:

This way of working is prone to many errors:

Overall, this is resulting in the increased frequency of the "outages caused by workmanship issues".

To avoid such problems, Proxy32 incorporates COMMAND Launcher functionality. Commands to be sent to the equipment are stored as nodes on GUI tree. Those nodes are called COMMAND Launchers. COMMAND Launcher pastes text of the command into active terminal when user double-clicks on it.

Commands can be parametrized to make one single command flexible enough for the use in multiple situations, for example, instead of saying reset card 3 command may say reset card <PROXYPARM=enter card number to reset> and then the card number will be requested from user via dialog window at the time of COMMAND Launcher execution and substituted into text of the command before it pasted into terminal.

COMMAND Launcher node keeps not only text of the command itself but also associated notes (as tooltip field of the COMMAND Launcher). Tree of commands (LauncherTree) is fully searchable (using literal search or REGEX search, search includes command itself and notes). It is also saved as XML file that can be searched, bulk-edited in text editor and imported into Proxy32 installation of another user.

Using COMMAND Launchers functionality will protect from errors during execution part (which is often done under pressure or at night time) and shifting more focus to the preparation part when user builds tree of COMMAND launchers in advance to cover possible situations that may arise in the future.

Of course, there is always room for human errors. It could happen that user did not prepare text of command in the COMMAND Launcher correctly or did not supply correct card number as parameter when asked in parameter input dialog on COMMAND Launcher execution. Also, user may type some command partially at the command prompt of the equipment and then try to execute COMMAND Launcher to the same command prompt appending new command on the top of partially typed command. This can cause some troubles. But as long as user prepared text of COMMAND Launcher correctly, responded with correct card number for command execution and not mixing manual and automatic command execution mode in erratic fashion, using COMMAND Launchers is far superior and faster and safer way of working compare to the old way of working (manually editing, copying and pasting commands) that is still taking place in many support departments.


Some details

For automation of the built-in terminal there are several types of the launchers that can be created on the launcher tree. These launchers can help to automatically execute single commands or even predefined simple procedures.

Those launchers are different from each other by the complexity of their creation and also by their abilities - by how much each of them can do.

The simplest automation launcher is COMMAND launcher.

The only piece of information that is contained in the COMMAND launcher is the text of the command that will be pasted into the built-in terminal when COMMAND launcher is executed on the launcher tree.

To execute launcher on the launcher tree user have to double-click on such launcher.

In that case program will check which terminal window this launcher has to be executed to.

The program will look into the SELECTOR window to find out which window of the built-in terminal is active at this particular moment.

If one of the windows of the built-in terminal is active then text of the command that is stored in the COMMAND launcher will be pasted into the active terminal window as if user would typed it in manually from the keyboard.

In order for this operation to succeed one must first check a few things.

First of all one needs to make sure that when you run COMMAND launcher on the launcher tree one of the windows of the built-in terminal has to be highlighted as active in the selector window or if you look inside of the main window you should see that one of the windows of the built-in terminal has to be highlighted with a red frame meaning that this terminal window is active and it will be recipient of all automation that is started from the launcher tree.

One more thing to check before starting any automation is that the active terminal window is actually connected to something. There are two ways to check this:

One more thing to check before trying to execute any automation into the window of the built-in terminal is that this terminal is not busy at the moment executing some other automation type that may require additional time to finish execution. For example, it could be SCRIPT or PLUGIN because they can be executing for a long time and while they are running in this particular terminal window this window stays busy and it cannot accept another automation order from the launcher tree.

It is impossible to start COMMAND, SCRIPT or PLUGIN into the window of the built-in terminal if this window is busy executing SCRIPT or PLUGIN (until execution of SCRIPT or PLUGIN in this window will finish). User will have to wait until automation currently running in this terminal window will finish.

If one wants to immediately run new automation launcher into this particular terminal window, one has to first kill SCRIPT or PLUGIN that is currently running in this terminal window.

There is a button "Kill" in the left bottom corner of the terminal window and this button will be shown when SCRIPT or PLUGIN is currently executing in this terminal window.

This button can be only seen when SCRIPT or PLUGIN is running so that when SCRIPT or PLUGIN is finished you cannot see this button anymore.

In other words, you can figure out whether SCRIPT or PLUGIN is running in the current terminal window if you would look at the left bottom corner of the terminal window. If you would see the button "Kill" in the left bottom corner then you would know that this terminal is running SCRIPT or PLUGIN.

If all the checks have passed successfully:

  1. The window of the built-in terminal is selected in the SELECTOR window as an "active" terminal and it is highlighted by the red frame.

  2. This terminal is not minimized and residing in the current workspace.

  3. This terminal is connected to some equipment and capable to receive commands that are typed in manually.

  4. This terminal is not busy at the time executing some SCRIPT or PLUGIN.

If all those checks have succeeded user can simply double-click on any COMMAND launcher on the launcher tree and then this COMMAND launcher will be executed. That means that the text that is contained in this COMMAND launcher will be pasted into the active terminal window and then program will send the line termination character for example carriage return to imitate pressing ENTER key. The line termination character is needed to initiate execution of the pasted command.

At this moment command will be executed in the equipment and the result of the command execution will be printed in the terminal window.

COMMAND launcher is executed very fast on the terminal side because it only includes sending command text to the remote equipment. Executing the command in the remote equipment and printing execution results may take some time and normally user would have to wait until equipment will show command prompt on the screen. Command prompt on the screen of the terminal means that the equipment is ready to receive the next command. Though terminal is ready to execute next COMMAND, SCRIPT or PLUGIN launcher practically immediately after launching previous COMMAND launcher, usually user will have to wait until equipment is ready to receive the next command before actually executing next COMMAND, SCRIPT or PLUGIN launcher.

Because SCRIPT or PLUGIN launcher are normally sending more than one command into the equipment they are automatically making sure that the next command will only be sent to the equipment when equipment is ready to receive the next command. They are doing this by waiting for remote equipment command prompt before sending next command for execution.

Built-in terminal allows to paste up to 1 MB of text in one shot so pasting such a long text or executing COMMAND launcher that contains such a long text may take a long time.

Normally, the commands can be sent very quickly one after another by manually executing one by one COMMAND launchers in quick sequence. But while doing so user will have to watch that the next command will be sent into the equipment only when the equipment is ready to receive the next command.

If COMMAND launcher or operation of pasting text from the clipboard is sending large amount of text (up to 1 MB) to the remote equipment then, first, remote equipment should be in the mode in which it is able to receive this text (for example, in configuration mode or in the text editing mode) and, second, such operation may take significant amount of time because all this text has to be transferred to the remote equipment and remote equipment will have to process all this text before it will print the prompt saying that it is ready to receive the next command.

Pasted text may contain many sequential separate commands or it can represent one very long command that contains multiple lines. The interpretation of the text depends on the specifics of the equipment which will receive it. But it is important to remember that COMMAND launcher is not only sending text that is contained in this launcher but it is also sending the line termination character after this text in order to initiate command execution. When executing COMMAND launcher into the window of the built-in terminal line termination characters are always being sent and when executing COMMAND launcher into the window of the external process user can choose whether to send or not to send line termination character into such window and if he needs to send such character user can choose which one to send.

When user sends long text to remote equipment this text is first being placed into the buffer with a size of 1 MB inside of the built-in terminal. Then text from this buffer will be transferred into the remote equipment by the small amounts with a speed at which remote equipment will be capable to digest it. Until this buffer is completely free user can initiate pasting text, size of which is not exceeding the free space that is left in this buffer. When pasting of the previous text is already finished and free space in the buffer again is equal to 1 MB, user again can initiate pasting text up to 1 MB in size.

COMMAND launcher simply sends the sequence of bytes to the remote equipment (to which terminal is connected) and then terminates this sequence of bytes with the line termination characters (carriage return and new line) in order to initiate the execution of the command in the remote equipment. In addition to that, there is more complex mechanism that is called "substitution parameters" and user can use "substitution parameters" as a part of the command text.

For example, let's assume that the same command can be used to list files in any directory. To use this command user has to explicitly specify directory where he would like to list files.

The simplest thing we can do is to create many different COMMAND launchers by creating one launcher per every particular directory where we want to list files. If we have to create too many of such launchers, we will start looking for the way how to create one single COMMAND launcher that would allow us to list files in different directories. To do so we will have to take the text of our command in one of our launchers and replace name of particular directory in this text by something that is called "substitution parameter".

"Substitution parameter" is like a name of the variable that is present in the command text and it can take different values that are specified by the user. When COMMAND launcher is executed before the text of the command is sent to the remote equipment the program will scan this text to see whether it contains any "substitution parameters". "Substitution parameters" use special format and because of this they can be easily separated from the regular text of the command.

If the program will find "substitution parameters" in the command text then it has to replace these "substitution parameters" by their values in order to build the final command text that can be used for the execution. "Substitution parameters" have names so that program will give the dialog to the user in which it will give the names of all parameters that are found in the command text and it will ask user to enter values for every parameter found and then initiate command execution by pressing OK button.

For example, if user performs double-click on the COMMAND launcher that contains parameter with the name "directory" then program will give user the dialog that will say that for execution of the command user will have to specify the value for the parameter "directory" and then it will let user to type in particular directory name into this dialog and press OK button to initiate command execution.

In this case, particular directory name that was typed in by the user will be substituted into the text of the command in place of the "substitution parameter" named "directory". After this the full command text (that contains directory name that was given by the user via dialog) will be sent to the remote equipment for the execution.

When using such COMMAND launcher user will be able to type in different directory names on every launch of this launcher. We can call such launcher "parametrized" COMMAND launcher to emphasize the fact that it can be adapted for particular task immediately on its execution.

Parameters (names) together with their values are kept in a special memory inside of the program. Also on the user's request they can be saved to the file "proxy-parms.txt" and then they will be automatically loaded from this file on the next start of the program.

This parameters saving is very convenient for the parameters for which the values are changing rarely. The values of those parameters are not changed by the user on every execution of the launcher. Such parameters can be included as needed into the text of many other launchers. When their value have to be changed such change can be done from one centralized place in the program (particularly, from the dialog of editing parameters). This will help us to avoid the need to edit large number of the individual launchers that use this parameter's value.

There is a special "substitution parameter" type that can be substituted in the command text instead of the password. The values of those parameters cannot be seen while those values are being typed into dialog. They are also hashed when they are being saved into the file "proxy-parms.txt".

Another thing that can be used inside of the command text - ability to insert special characters into the text of the command.

For example, if we want to send the text of the command but we also want to send Ctrl-C character to interrupt the execution of the previous command.

Depending on the type of the equipment it may be necessary to send into this equipment some special non-printed character combination to execute some task.

For example, for some types of LOGIN user will always have to send Ctrl-C at the end of the command to get the prompt showing that the equipment is ready to receive the commands. Sometimes Ctrl-C combination may be needed in order to perform LOGOUT. Combination Ctrl-[ is used to switch command-line telnet client from transparent mode into the command mode (default telnet escape sequence).

Non-printed ASCII characters can be inserted into the text of the command with the help of the special button in the COMMAND launcher editor. This allows to insert special characters into command text and then those characters become part of the command text and sent to remote equipment when such command is executed.

COMMAND launchers are the simplest way of automation but they can be executed not only into the window the built-in terminal but also into the window of external process. Because we don't have access to the code of the external process we have to execute COMMAND launchers in the following way:

COMMAND launcher can be executed only into the window of any external process that is not reading the keyboard directly but receiving key-presses from the system keyboard buffer. COMMAND launcher successfully works in 99% of all external processes but it may not always work in the windows that are created by the remote/virtual desktop systems (X-Window etc.).

For example, COMMAND launcher can be executed into following windows of external processes:

For example, we may have a page inside of the web browser that will contain several fields for entering the text. When this page is opened in the browser the text entry cursor normally will be placed into the first field for entering text. If user will start typing, typed text will be entered into the first field for entering text because the cursor is located in this field. When user typed in all the necessary information into the first text field he will press the tabulation key in order to move text cursor into the next field for inputting text. After this user will type in all the necessary information into the next text field etc. The order in which the text fields will be traversed with the help of the tabulation key is normally from the left to the right and from the top to the bottom but the webpage can actually specify the other order internally. In order to automate entering text into such webpage user will have to find out three things:

For example, let's assume that user will open webpage that will ask for username and the password for the access to the protected information. This page will contain one text field to enter user name and one text field to enter user password and also the button LOGIN that will send content of these two text fields for checking to the server. In order to automate passing through such page with the help of the COMMAND launcher user will have to find out whether it is possible to pass through such a page only by using keyboard and without using the mouse. That is because the COMMAND launcher only imitates the keyboard presses and not the mouse clicks. Typical page will place the text cursor in the username field when the page is open. After this when user presses tabulation key the cursor will automatically move into the text field for entering the password and then when user presses the ENTER key it will automatically press "LOGIN" button on the page that will send content of those two text fields for checking to the server. Using this information user would have to create COMMAND launcher with the following text:

Note:

  1. Tabulation is non-printed character that is inserted into command text with the help of the special button in the COMMAND launcher editor. 2.The ENTER key is imitated by the NL character or by pair of characters (carriage return and new line) depending on the type of the program of the external process. When executing COMMAND launcher user can choose which line termination character will be send at the end of the command. There are three options:

User can choose how COMMAND will be terminated with the help of the button that is present in the menubar of the main window. When COMMAND launcher is created user doesn't have to insert line termination characters that would imitate final pressing of the ENTER key if user will choose the mode in which line terminator is automatically sent after the command text.

When creating such launcher user will have to:

In order to execute such launcher user will have to do following:

Note:

If the username and password are present in the command text not literally but through substitution parameters then on execution of the COMMAND launcher the program will first ask user for parameter values if user didn't specify them in advance and didn't say that program shouldn't ask confirmation every time when those parameters are substituted on launcher execution.


Example 1 (create COMMAND Launcher without parameter substitution)

Fig.1 Right-Click on empty space inside of LauncherTree window and select "Add COMMAND Launcher"

Fig.1 Right-Click on empty space inside of LauncherTree window and select "Add COMMAND Launcher"

Fig.2 "Edit COMMAND Launcher dialog" has opened. Keep default command text "ls -altr" and click "OK" button to finish editing COMMAND Launcher

Fig.2 "Edit COMMAND Launcher dialog" has opened. Keep default command text "ls -altr" and click "OK" button to finish editing COMMAND Launcher

Fig.3 If needed, switch LauncherTree display mode (seventh button on the LauncherTree toolbar) to ensure that Launcher Configuartion is displayed on LauncherTree

Fig.3 If needed, switch LauncherTree display mode (seventh button on the LauncherTree toolbar) to ensure that Launcher Configuartion is displayed on LauncherTree

Fig.4 Launcher configuration is visible and Launcher is ready for execution (via double-clicking on the launcher)

Fig.4 Launcher configuration is visible and Launcher is ready for execution (via double-clicking on the launcher)

Fig.5 Launcher configuration is visible and Launcher is ready for execution (via double-clicking on the launcher)

Fig.5 Launcher configuration is visible and Launcher is ready for execution (via double-clicking on the launcher)


Example 2 (modify existing COMMAND Launcher to add parameter substitution)

Fig.6 Middle-click on existing launcher to open "Edit COMMAND Launcher dialog". Place cursor in the position where parameter will be inserted and click on "Insert new parameter/password" button

Fig.6 Middle-click on existing launcher to open "Edit COMMAND Launcher dialog". Place cursor in the position where parameter will be inserted and click on "Insert new parameter/password" button

Fig.7 In the "Insert New Proxy Parameter/Password" dialog select desired parameter template and click on "OK" button

Fig.7 In the "Insert New Proxy Parameter/Password" dialog select desired parameter template and click on "OK" button

Fig.8 Parameter is inserted. Select name of the parameter to prepare to replace it with your own name

Fig.8 Parameter is inserted. Select name of the parameter to prepare to replace it with your own name

Fig.9 Parameter name was replaced with your own name, click "OK" button to finish editing COMMAND Launcher

Fig.9 Parameter name was replaced with your own name, click "OK" button to finish editing COMMAND Launcher

Fig.10 After double-clicking on the launcher it will start execution to the window of ACTIVE terminal. Before execution parameter values must be defined, therefore, "Parameter input dialog" is displayed

Fig.10 After double-clicking on the launcher it will start execution to the window of ACTIVE terminal. Before execution parameter values must be defined, therefore, "Parameter input dialog" is displayed

Fig.11 Enter value for the parameter and click on "OK" button to execute launcher

Fig.11 Enter value for the parameter and click on "OK" button to execute launcher

Fig.12 Terminal screen after parameter substitution and execution of COMMAND Launcher

Fig.12 Terminal screen after parameter substitution and execution of COMMAND Launcher


General information
    Rationale
    Some details
Example 1 (create COMMAND Launcher without parameter substitution)
Example 2 (modify existing COMMAND Launcher to add parameter substitution)


Index