Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Note: NetMRI needs the ENABLE password to access configuration files on some devices and to run the Configuration Command Scripts and Perl/Python scripts. To ensure easier identification of NetMRI actions, we recommend creation of a username and password on your network equipment specifically for NetMRI.

Job scripting is a key capability for NetMRI and for the Automation Change Manager system. Job scripting allows use of two linguistic approaches to script job-based automation: a proprietary language, called CCS (Change Control Scripting), a standard-language Perl API, and a standard-language Python API. This chapter focuses on Perl/Python scripting.

...

Note: NetMRI needs the ENABLE password to access configuration files on some devices and to run the Configuration Command Scripts and Perl/Python scripts. To ensure easier identification of NetMRI actions, we recommend creation of a username and password on your network equipment specifically for NetMRI.

...

CCS is a ‘highhigh-level’ level scripting language , which that walls off access to the internals of the operating system and prevents operations such as overwriting blocks of memory and other potentially harmful actions. CCS also does not use or access the NetMRI Sandbox, which is a separate VM-based resource for Perl/Python scripting. Perl/Python scripting offers low-level access to all NetMRI system internals and the ability to use any operating system function or API call to affect any aspect of system operation. To prevent serious mistakes when using Perl/Python scripts, a dedicated and isolated virtual machine environment is provided by NetMRI in which Perl/Python scripts are automatically executed on behalf of the user.

...

Anchor
Perl/PythonScripting
Perl/PythonScripting
Anchor
bookmark630
bookmark630
Perl/Python Scripting

...

As with CCS, you use Perl/Python for change automation and custom Issue analysis. Perl/Python scripting possesses far greater capabilities, providing access to all aspects of the Perl or Python programming language, including the Perl/Python API, at runtime. NetMRI’s Job Wizard also supports the use of Perl/Python scripts. You use your preferred text editor or IDE to write and debug the Perl or Python script before copying the text into the appropriate field in the Job Wizard.

Infoblox strongly recommends testing all Perl/Python scripts before running them in the appliance.testing all Perl/Python scripts before running them in the appliance.

...

Note: When you save a Perl/Python script, NetMRI will test-compile the script. If the compile fails, the appliance will disallow saving of the script and display the compilation errors to the user.

...

You can leverage Perl/Python scripting can be leveraged for use in custom issues, change scripts, and analysis scripts.

The Job Management tab provides a collection of scripting-related functions:

  • The Scripts tab provides creation, copying, editing, scheduling, and running of automation scripts;
  • The Library tab provides a convenient location for storing and Perl/Python subroutines and modules;
  • The Config Templates tab lists any configuration template files. Config templates are text files that contain CLI commands for a specific vendor, device type, equipment model or network operating system version. Config templates can serve as the basis for a job (described in this chapter);
  • The Lists tab provides external lists of information to which jobs can refer when running scripts (Described in Defining Lists for ACM, Perl, Python, and CCS Script Reference;
  • The Scheduled Jobs tab is where you create and schedule jobs, which run scripts against devices at a specified frequency. (Described in Creating and Scheduling Jobs);
  • The Triggered Jobs tab enables you to specify events that will trigger associated jobs. (Described in Triggering Jobs Through Events);
  • The Job History tab lists jobs that have been scheduled (or run immediately), and shows their status. (Described in Viewing the Job History and the Job Viewer);
  • The Custom Issues tab enables you to create and edit custom issues referenced by scripts.

Anchor
Creating New Scripts (CCS and Perl)
Creating New Scripts (CCS and Perl)
Anchor
bookmark631
bookmark631
Creating New

...

Scripts (CCS, Perl, and Python)
Anchor
bookmark632
bookmark632

...

Create and manage scripts at Configuration Management –> Job Management tab –> Scripts tab.Create and manage scripts at Configuration Management –> Job Management tab –> Scripts tab.

The following table describes user privileges required for scripts.

Run Level

Risk

User privilege required to run script

Low

Low

Scripts: Level 1

Medium

Medium

Scripts: Level 2

High

High

Scripts: Level 3

...

Note: You must have the Scripts: Author and Scripts: Level 3 privileges in a system administrator account to create and save scripts.

...

To create a script:

  1. At the top right of the page, click New. The Add New Script dialog appears.
  2. In the Add New Script dialog: , type a Name for the script.
    • Specify a Run Level. Run Level controls who can run the script.
    • Specify an optional Category in which the script should be placed. (Use categories to organize scripts.
    • Type a Description of the script.
    • Select the Language of the script: CCS, Perl, or Python.
    • Type or paste in the script in the lowest field in the dialog.
  3. Click Save & Close or Save.

...

Run Level

...

Risk

...

User privilege required to run script

...

Low

...

Low

...

Scripts: Level 1

...

Medium

...

Medium

...

Scripts: Level 2

...

High

...

High

...

...

Note: Users are assigned roles/privileges to edit and run scripts based on risk. A user with Scripts: Level 1 privilege, for example, can run scripts having a Run Level of Low, but not those having a Run Level of Medium or High. A user with Scripts: Level 2 can run scripts having a Run Level of Low or Medium, but not High, and so forth. An organization might assign Scripts: Level 1 privileges to tier one NOC operators. Further, the organization might designate some scripts that perform simple tasks (such as running a "show" command to collect more data) as Run Level Low. As a result, their tier one NOC team members can have limited access to some devices, but are prevented from making radical changes.

...

To copy a script:

  1. Select a script and click Copy.
  2. In the Copy Script dialog, type a name for the script, then click OK Anchorbookmark633bookmark633.

To edit a script

...

, click Edit.

To schedule a script for execution:

  1. Select a script and click Schedule. The Job Wizard opens.
  2. In the Fill out Job Details screen, type a Job Name.
  3. To allow a the job to run: , enable the Approved option. ( A job cannot be scheduled unless it is approved.)
  4. Type a Description of the job.
  5. In the Scripts list, select a script. If required by the script, enter data and/or select options.
  6. Click Next.
  7. In the Select Device Groups o r or Devices screen, click the Add icon to select specific device groups and/or devices to which this job applies.
  8. Click Next.
  9. In the Schedule when Job should run screen, specify the schedule for the job.
  10. Click Next.
  11. In the Review and save screen, review the job specifications. If changes are needed, click the click < Previous button to  to return to an earlier screen.
  12. Click Save.

Track scheduled jobs in on the Job History tab.

Note: You can also schedule a script in on the Scheduled Jobs tab.

...

Select a script

...

and click Run Now.

...

 The BatchStatus window displays the results of running the script.

To view batch details: Click a hyperlink in the Name column. The Job Viewer opens.

To view the entire script: Click a hyperlink in the Script column.

To delete a script: Click Delete, then confirm the deletion.

...

Note: Any single NetMRI instance can run a maximum of ten (10) active CLI sessions to network devices. This imposes a practical limit to the number of concurrent sessions that a script can run through CLI sessions to other devices in the network. This limit applies per NetMRI instance or per collector; for example, if you are running an Operations Center with three collectors, the Operations Center can run a script against up to 30 network devices at once.

...