Device scripts

ITNCM - Base uses device scripts to determine the work on which to proceed.

A device script can be used to customize scripts to address issues with a particular network device.

A device script consists of the following items:

  • Device script sections — The required section of the device script performs the functions needed. For example, the default.error section lists string errors. Each section of the device script specifies the commands in the order that they will be executed. If a special command (if then else) is in the section at the correct time, this will be constructed and the data will be checked against them.
  • Device script variables — Each device script makes use of variables, for example, $connect_username$, $alt_username$, $connect_password$, and so forth.
  • Device script commands — Each device script contains a list of the show commands that will be sent to the device. The various show commands are used to determine the hardware makeup of the device.
Note: A device script is in a loop.

The <script-id> element, specified in the RAD, identifies the device script that ITNCM - Base uses. Multiple device scripts (each with their own name) may be included within the RAD. However, only the one being referenced will be used. By convention, specifying the name default within the <script-id> element means the default device script stored in the database for that device (based on VTMOS) will be used.

The following briefly describes how ITNCM - Base interacts with a device script:

  • The commHandler sends a command and then waits to determine if something comes back. As the information is coming back it is received in packets and placed in a buffer. (The packet may or may not contain all the data, so many packets could come in.)
  • Each time a packet is received, ITNCM - Base reads the data and checks to see if there are more packets. ITNCM - Base will do this a number of times, and then stop to check for errors in the buffer.
  • If no errors are found, ITNCM - Base will look for the required token. If the token is not found, then ITNCM - Base checks to see if further processing is required (the if then else).
  • If this processing is required, ITNCM - Base will carry this out before it returns to reading the packets. ITNCM - Base will continue to read the packets until the token is found, an error occurs, or a predefined timer is hit.
  • Once a token is found then the special commands are taken down. It is important to realize that ITNCM - Base can go through a section many times until the token is found. This can cause ITNCM - Base to execute the same if then else command many times depending on the script.