Support Support Downloads Knowledge Base Case Manager My Juniper Community

Knowledge Base

Search our Knowledge Base sites to find answers to your questions.

Ask All Knowledge Base Sites All Knowledge Base Sites JunosE Defect (KA)Knowledge BaseSecurity AdvisoriesTechnical BulletinsTechnotes Sign in to display secure content and recently viewed articles

[EX] Usage of commit script to log errors when committing unsupported configuration statements

0

0

Article ID: KB23421 KB Last Updated: 04 Mar 2017Version: 2.0
Summary:
This article describes the issue of the usage of a script, which leads to commit errors when unsupported commands are typed and committed.


Symptoms:
  • When entering unsupported commands via the command line and committing them on EX switches, no commit error or warning is displayed; so the user does not know that the unsupported configuration is committed.

  • You can see only the Unsupported Platform error, when the show configuration command is used.

  • This leads to a sense of missing what exactly occurred, as the commit goes through.
Cause:

Solution:
Using a commit script to throw an error, when unsupported commands are used.

For example:
root@switch# set firewall family inet filter x term x from prefix-list x

root@switch2# commit
configuration check succeeds
commit complete
But you can see the error, when viewing the configuration:
root@switch2# show firewall
    family inet {
        filter x {
            term x {
                from {
                    ##
                    ## Warning: configuration block ignored: unsupported platform (ex3200-48t)
                    ##
                    prefix-list {
                        x; ## 'x' is not defined
                }
            }
        }
    }
}

Here, the unsupported.slax commit script is used. The script is in the following location. You can use methods, such as FTP, to get the script on the switch or use vi editor in the switch.
root@switch2:RE:0% cd /var/db/scripts/commit/
root@switch2:RE:0% ls
unsupported.slax
Contents of the script:
root@switch2:RE:0% cat unsupported.slax

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";

match configuration {
    var $rpc = <get-configuration database="candidate" unsupported="unsupported">;
    var $config = jcs:invoke($rpc);

    if ($config//@unsupported) {
        <xnm:error> {
            <message> "Please Remove Unsupported or Hidden Configuration";
        }
    }
}

Install the script, by using the following command :
[edit]
# set system scripts commit file unsupported.slax

The same commit is performed again and the following commit error is noticed:
[edit]
root@switch2# commit
error: Please Remove Unsupported or Hidden Configuration
error: 1 error reported by commit scripts
error: commit script failure
Comment on this article > Affected Products Browse the Knowledge Base for more articles related to these product categories. Select a category to begin.

Getting Up and Running with Junos

Getting Up and Running with Junos Security Alerts and Vulnerabilities Product Alerts and Software Release Notices Problem Report (PR) Search Tool EOL Notices and Bulletins JTAC User Guide Customer Care User Guide Pathfinder SRX High Availability Configurator SRX VPN Configurator Training Courses and Videos End User Licence Agreement Global Search