[Contents] [Prev] [Next] [Index] [Report an Error]

Restarting an FPC

This example simply restarts a Flexible PIC Concentrator (FPC) and slightly modifies the output of the request chassis fpc command to include the FPC number that is restarting.

There is no JUNOS Extensible Markup Language (XML) equivalent for the request chassis commands. Therefore, this script uses the request chassis fpc command directly rather that using a remote procedure call (RPC). For more information, see Using RPCs and Operational Mode Commands.

XSLT Syntax

<?xml version="1.0" standalone="yes"?>
<xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:junos="http://xml.juniper.net/junos/*/junos"
    xmlns:xnm="http://xml.juniper.net/xnm/1.1/xnm"
    xmlns:jcs="http://xml.juniper.net/junos/commit-scripts/1.0">

    <xsl:import href="../import/junos.xsl"/>

    <xsl:variable name="arguments">
        <argument>
            <name>slot</name>
            <description>Slot number of the FPC</description>
        </argument>
    </xsl:variable>

    <xsl:param name="slot"/>

    <xsl:template match="/">
        <op-script-results>
            <xsl:variable name="restart">
                <command>
                    <xsl:value-of select="concat('request chassis fpc slot ', $slot,'                                                                                                        restart')"/>
                </command>
            </xsl:variable>

            <xsl:variable name="result" select="jcs:invoke($restart)"/>

            <output>
                <xsl:text>Restarting the FPC in slot </xsl:text>
                <xsl:value-of select="$slot"/>
                <xsl:text>. </xsl:text>
                <xsl:text>To verify, issue the "show chassis fpc" command.</xsl:text>
            </output>
        </op-script-results>
    </xsl:template>
</xsl:stylesheet>

SLAX Syntax

version 1.0;

ns junos = "http://xml.juniper.net/junos/*/junos";
ns xnm = "http://xml.juniper.net/xnm/1.1/xnm";
ns jcs = "http://xml.juniper.net/junos/commit-scripts/1.0";

import "../import/junos.xsl";

var $arguments = {
    <argument> {
        <name> "slot";
        <description> "Slot number of the FPC";
    }
}
param $slot;

match / {
    <op-script-results> {
        var $restart = {
            <command> 'request chassis fpc slot ' _ $slot _ ' restart';
        }
        var $result = jcs:invoke($restart);
        <output> {
            expr "Restarting the FPC in slot ";
            expr $slot;
            expr ". ";
            expr "To verify, issue the \"show chassis fpc\" command.";
        }
    }
}

[Contents] [Prev] [Next] [Index] [Report an Error]