Support Support Downloads Knowledge Base Juniper Support Portal 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



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

  • 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.

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
Contents of the script:
root@switch2:RE:0% cat unsupported.slax

version 1.0;
ns junos = "*/junos";
ns xnm = "";
ns jcs = "";
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 :
# set system scripts commit file unsupported.slax

The same commit is performed again and the following commit error is noticed:
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