...
Although the majority of Perl scripts will include Infoblox_Job.pm, a Perl script may do other tasks beyond communicating with the target device. For example, a Perl script can transmit acquired target device information (which is available via well-known variables in the script) with a trouble ticketing system that resides elsewhere on the network. In this case, though including Infoblox_Job.pm is permitted, doing s
Anchor | ||||
---|---|---|---|---|
|
The standard Infoblox_Job.pm initialization sequence and functions establish a DIS session and a CLI connection with the target device. A DIS session can support multiple CLI connections. You may develop more advanced use cases in which Perl scripts establish simultaneous connections to multiple network devices in addition to the target device. In this scenario, the Perl script must obtain the DeviceIDs for the non-target network devices and directly use the v2 API functionality to communicate with them (i.e. basically do the equivalent of
open_connection(), send_command()
, and so on).Python Scripting in NetMRI
The Infoblox 1102-A and NT-4000 platforms support Python scripting, as do all legacy appliances with 8 GB of RAM. Python scripting is not available on other legacy platforms. The virtual machine version of NetMRI also supports Python scripting and the Sandbox virtual environment. On platforms where Python scripting is not available, all related features are hidden and/or disabled via the GUI and administrative shell. To achieve optimum performance on legacy NetMRI platforms, a BIOS change is necessary. If you have one of these platforms and the BIOS change has not been made, a message to that effect appears when attempting to save a Python script. Contact Infoblox technical support to obtain the document describing the BIOS change process for these platforms.
...
Other features in Python support include the following:
- Access to the Python exit function from within a script. If the Python script exits with a zero exit code, the script ceases operation and NetMRI sets the job status to OK. If the Python script exits with a non-zero exit code it causes the script to cease operation and NetMRI sets the job status to Error;
- Ability to mark problem commands and perform try/catch exception handling;
- A logging function, available in the infoblox_job.pl file;
- A Libraries page (see
...
- Using Perl or Python Libraries for more information) containing blocks of Python code to be referenced by other Python scripts. The Libraries page supports creation, editing, deletion, and import and export of snippets of Python code;
- Refer to lists of data to fill variables and find matches during job batch processing, extract information and parse the returned data (see the section
...
- Defining Lists for ACM, Perl, Python, and CCS Script Reference for more information);
- Use of standard NetMRI variables and data model objects in scripting logic. NetMRI automatically associates variables with target devices during runtime. Users can define input and internal variables that can be mapped to the NetMRI data model. The data model also provides access to device and interface attributes;
- Users can open multiple, simultaneous, device connections from within scripts, enabling change coordination between multiple devices in sequence or in parallel, based on common elements such as VLAN membership or neighbor topology. The feature is helpful in advanced use cases: for example, a script opens a connection to a network device, encounters a configuration element, and opens new connections to other, similar devices for comparison and determines the action to take on the current device;
- Regular expression processing, without restrictions on data structure types where regular expressions can be used, including script input variables, device output, data from external files, lists and NetMRI data model information.
Anatomy of a Python Script
...