Log in to ask questions, share your expertise, or stay connected to content you value. Don’t have a login? Learn how to become a member.
The params macro turns a simplified interface configuration into a diverse configuration. The simplified configuration is expanded into a diverse set of configuration statements. Using configuration groups (such as 'interface-details' and 'cos-details' for example) with commit scripts can keep the details of any configuration expansions in the configuration database, where they can be more easily changed
Turn Simplified Interface Configuration into Diverse Configuration For SLAX version 1.0 and higher, you can use the params script to t urn simplified interface configuration into diverse configuration. We define an apply-macro for simplified interface configurations.These are expanded into a diverse set of configuration statements. You can use configuration groups (such as ' interface-details ' and ' cos-details ' in this example) with commit scripts to retain the details of any configuration expansions in the configuration database, where you can change them more easily
Correct Pre-Inheritance Configuration for Commit Scripts For SLAX version 1.0 and higher, at times, a commit script requires access to the pre-inheritance configuration rather than the post-inheritance configuration it receives by default. This is typically a straightforward operation: the commit script simply invokes the <get-configuration> RPC. However, the problem is that <get-configuration> only returns the normal candidate database, and private configuration sessions use a dedicated private candidate database, making it impossible to retrieve the actual pre-inheritance database when using "configure private". PR 517088, which was opened to resolve this, has now been fixed, so the pre-inheritance configuration can now be retrieved whether "configure private" is used or not
Prevent Typical Human Configuration Errors For SLAX version 1.0 and higher, you can use the protect-config script to check various parts of the configuration against typical human errors, such as loopback interface with family inet is present, forwarding-options section is not deleted, snmp 0/0 is not configured, and so on
Junos OS on-box Scripts and Including Transient Changes in Configuration Results Junos OS on-box scripts commonly use the <get-configuration> RPC to retrieve the current device configuration. However, the returned configuration might not be the actual configuration running on the device if commit scripts are deployed and they made transient configuration changes. This divergence is possible because, rather than being reflected in the committed configuration, transient configuration changes only affect the configuration that is provided to daemons. This means that when the <get-configuration> RPC pulls the committed configuration, it will not see the transient changes introduced by commit scripts because they never actually appear in that configuration
To commit a configuration on occurrence of an event, the following configuration can be used: 1 [edit] 2 user@host # show event-options 3 policy <policy-name> ( 4 events <event-name>; 5 then ( 6 change-configuration ( 7 commands ( 8 "set system login message hello" ; 9 ) 10 ) 11 ) 12 ) 13 14 [edit] 15 user@host # As per the above configuration, when a specified event occurs in the system, this policy get executed and a configuration statement defined in policy will be committed. A user can specify more that one configuration statement in a single policy
Overview Report missing configuration statements...Description This script detects missing configuration statements and reports them. Often devices fail because someone has deleted valuable configuration data that is vital to the device
Commit a Configuration Using an Event Policy To commit a configuration on occurrence of an event, you can use the following configuration: 1 [edit] 2 user@host# show event-options 3 policy <policy-name> ( 4 events <event-name>; 5 then ( 6 change-configuration ( 7 commands ( 8 "set system login message hello"; 9 ) 10 ) 11 ) 12 ) 13 14 [edit] 15 user@host# As shown in the configuration, when a specified event occurs in the system, the policy gets executed and a configuration statement defined in policy is committed. You can specify more that one configuration statement in a single policy
The ospf-interfaces commit-script ensures that all interfaces configured under protocols/ospf have family/mpls configured and are in protocols/mpls, protocols/ldp and protocols/rsvp. Read the document ospf-interfaces #ospf #commitscript #Slax #FAQ #MPLS
View the Post-Inheritance Configuration of a Commit Script To display the XML format of the post-inheritance configuration: 1 [edit] 2 user@host # show | display commit-scripts view To display all configuration group data, including script-generated changes to the groups: 1 [edit] 2 user@host # show groups | display commit-scripts To save the commit script input to a file, add the save command to the command line: 1 [edit] 2 user@host # show | display commit-scripts view | save filename.xml #ScriptingHow-To #xml #How-To #configlet #commitscript