Automatically Installing AI-Scripts. Juniper ADVANCED INSIGHT SCRIPTS 2.5 - S REV 1
Reklama
Reklama
Advanced Insight Scripts (AI-Scripts) 2.5 Release Notes
Junos Scope settings (Settings > General > JUNOScope Settings).
Set up AI-Scripts bundles (Settings > General > Script Bundles).
Set up organizations.
Set up user groups.
Set up users.
Automatically Installing AI-Scripts
You can optionally use AIM to install AI-Scripts bundles (also known as AI-Scripts install packages) on devices as long as there is a Junos Scope software installation. AIM communicates with Junos Scope to install AI-Scripts bundles on devices running Junos OS managed by Junos
Scope.
To configure auto-installation of AI-Scripts bundles to devices, follow these steps:
1. Configure the credentials used to communicate with Junos Scope.
2. Import devices that are managed by Junos Scope.
3. Configure Script Bundles settings.
4. Associate imported devices with a device group.
5. Configure the Script Bundle of the device group and set the No-copy and Unlink installation attributes.
6. Add archive locations specifying the upload command password attributes. Use the archive location local directory for JMB files only.
7. Press the Save Changes button. AIM sends a message to Junos Scope to install the selected script bundle on the associated devices.
If you do not want to use AIM to install AI-Scripts bundles, you can manually configure and install AI-Script bundles to each device separately. To install AI-Scripts bundles manually, see “Manually Configuring and Installing AI-Scripts on Devices” on page 3.
Manually Configuring and Installing AI-Scripts on Devices
Within AIM, devices that are configured for AIS manually are automatically added to the device group that is associated with the AIM archive location to which the JMB was sent. When the AIM detects a JMB for a device that is not managed by Junos Scope Script Management, it will note it.
NOTE: If you are manually installing to a device that communicates with Junos
Space or Service Now, your login credentials must allow discovery of devices in
Junos Space. This procedure includes the configuration differences required for configuring the location for JMBs on a Junos Space device.
34
Copyright
©
2010, Juniper Networks, Inc.
Installing AI-Scripts
To manually configure and install AI-Scripts on devices, follow these steps:
1. Download AI-Scripts install packages. See “Downloading AI-Scripts Install Packages” on page 3.
2. Configure the device configuration as follows to activate AI-Scripts: a. Enter the device CLI configuration mode. Type the configure command or the edit command from the CLI operation mode. The CLI prompt changes from user@host> to
user@host# and a banner appears to indicate the hierarchy level. b. For non–Junos Space devices only: Configure an AIS destination under group juniper-
ais: user@host#set groups juniper-ais event-options destination juniper-aim {…}
This sets the AIS archive location where JMBs are deposited for a device. The group name juniper-ais is mandatory. The group destination name juniper-aim is mandatory. c. For Junos Space devices only: Set the local host address and configure an AIS destination under group juniper-ais: user@host#set groups juniper-ais interfaces lo0 unit 0 family inet address
127.0.0.1/32
This sets the local host address 127.0.0.1 to the device loopback address. It is used with the next command to ensure that JMBs can be sent to and retrieved from the local device. user@host#set groups juniper-ais event-options destination juniper-aim
archive-sites "scp://<user>@127.0.0.1://var/tmp" password <password for
user>
Configure this line exactly as shown, substituting <user> and <password for user> with the Service Now user name and password required for accessing the device. This configuration ensures the JMBs generated by AI-Scripts are sent to and from the
/var/tmp directory of the device, using the correct permissions for the device. The group name juniper-ais is mandatory. The group destination name juniper-aim is mandatory. d. Configure the commit script: user@host#set groups juniper-ais system scripts commit file jais-activate-
scripts.slax optional
The AI-Scripts installer creates this script to activate AI-Scripts on the device. The
optional setting is required to prevent the configuration from committing if the jais-
activate-scripts.slax file is not present. That file is not present until the scripts bundle is installed. user@host#set groups juniper-ais system scripts commit allow-transients
Transient changes are configuration changes made by commit scripts that do not appear in the configuration (except with a special command). user@host#set apply-groups juniper-ais user@host#set groups juniper-ais system scripts load-scripts-from-flash
Copyright
©
2010, Juniper Networks, Inc.
35
Advanced Insight Scripts (AI-Scripts) 2.5 Release Notes
NOTE: If you configure the load-scripts-from-flash option, the system reads AI-
Scripts from the /config/scripts/ directory; otherwise, the system reads AI-
Scripts from the /var/db/scripts/ directory. The /var/run/scripts directory will always point to the right scripts directory.
3. Verify that the syntax of a configuration is correct by using the configuration mode commit
check command:
[edit] user@host# commit check configuration check succeeds
4. Commit the configuration. To save software configuration changes to the configuration database and activate the configuration on the router, use the commit configuration mode command. You can issue the commit command from any hierarchy level.
[edit] user@host# commit commit complete
5. View the configuration:
Example Configuration for AIM
groups {
juniper-ais {
system {
scripts {
commit {
allow-transients;
file jais-activate-scripts.slax {
optional;
}
}
load-scripts-from-flash;
}
}
event-options {
destinations {
juniper-aim {
archive-sites {
"ftp://[email protected]/aimdemo";
}
. . .
Example Configuration for Junos Space
groups {
juniper-ais {
system {
scripts {
commit {
allow-transients;
file jais-activate-scripts.slax {
optional;
}
}
}
}
36
Copyright
©
2010, Juniper Networks, Inc.
Installing AI-Scripts
interfaces {
lo0 {
unit 0 {
family inet {
address 127.0.0.1/32;
}
}
}
}
event-options {
destinations {
juniper-aim {
archive-sites {
"scp://[email protected]://var/tmp" password " ... ";
}
}
}
}
}
}
6. If you have not moved the AI-Scripts to the device, do so now. See “Downloading AI-Scripts
Install Packages” on page 3.
7. Install the AI-Scripts package using the following command (see “AI-Scripts Commands” on page 3): user@host# request system scripts add <package-name>
8. Verify that the AI-Scripts are activated: user@host# show groups juniper-ais | display commit-scripts
system {
scripts {
commit {
allow-transients;
file jais-activate-scripts.slax {
optional;
}
}
}
}
event-options {
event-script {
file problem-event-pfecrash.slax;
file problem-event-dcrash.slax;
file intelligence-event-main.slax;
file SPD_EVLIB_CREATE_FAILURE.slax;
file SPD_DAEMONIZE_FAILED.slax;
file RPD_TASK_FORK.slax;
. . .}
destinations {
juniper-aim {
archive-sites {
"ftp://[email protected]/aidemo";
}
}
}
}
Copyright
©
2010, Juniper Networks, Inc.
37
Stáhnout
Reklama