Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 
 

Example: Restart an FPC Using an Op Script

This example uses an op script to restart a Flexible PIC Concentrator (FPC).

Requirements

This example uses a device running Junos OS that contains a Flexible PIC Concentrator (FPC) or equivalent component.

Overview and Op Script

The following script, which is shown in both XSLT and SLAX formats, restarts an FPC given the slot number in which the FPC resides. The user provides the slot number in the command-line interface (CLI) when the script is invoked. The script stores the slot number as the value of the parameter slot and constructs the request chassis fpc command string to include the slot number of the FPC to restart. There is no Junos Extensible Markup Language (XML) equivalent for the request chassis commands. Therefore, this script invokes the request chassis fpc command directly rather that using a remote procedure call (RPC).

XSLT Syntax

SLAX Syntax

Configuration

Procedure

Step-by-Step Procedure

To download, enable, and test the script:

  1. Copy the XSLT or SLAX script into a text file, name the file restart-fpc.xsl or restart-fpc.slax as appropriate, and download it to the /var/db/scripts/op/ directory on the device.

    Only users who belong to the Junos OS super-user login class can access and edit files in this directory.

  2. In configuration mode, include the file statement at the [edit system scripts op] hierarchy level and restart-fpc.xsl or restart-fpc.slax as appropriate.

  3. Issue the commit and-quit command to commit the configuration and to return to operational mode.

  4. Execute the op script by issuing the op restart-fpc slot slot-number operational mode command.

Verification

Verifying Op Script Execution

Purpose

Verify that the FPC has been restarted and is currently online.

Action

Execute the op script by issuing the op filename operational mode command. Supply the slot number of the FPC as an argument.

When you execute the script, you should see output similar to the following:

Issue the show chassis fpc detail fpc-slot operational mode command.

Meaning

The show chassis fpc detail command output displays the state, start time, uptime, and characteristics for the FPC. Verify that the FPC was restarted by checking the start time and uptime of the FPC. Verify the status of the restarted FPC by checking the state. If the status is Present, the FPC is coming up but is not yet online. If the status is Online, the FPC is online and running.