Dampen Script Execution
You can create commit, op, event, and SNMP scripts to automate Junos devices. These scripts can be CPU-intensive, potentially impacting other critical software processes such as the routing protocol process (rpd). You can configure the device to dampen or slow down the execution of SLAX and XSLT commit, op, and event scripts. Although the scripts are processed more slowly, enabling script dampening helps to ensure that the other critical software processes can function normally.
Script dampening is only supported for SLAX and XSLT scripts. Junos devices do not support script dampening for Python automation scripts.
You can configure the dampen
and dampen-options statements at the hierarchy level for the type of script
you want to dampen. You can apply dampening to specific scripts or all scripts of a
given type. To dampen a script, you configure the dampen
statement.
To modify the behavior of the script dampening feature, you can configure the
following dampening options.
-
cpu-factor—Initiate script dampening when CPU use exceeds the specified value.
-
line-interval—Specify the number of script lines to execute before pausing.
-
time-interval—Specify the time that script execution is paused.
If you configure the dampen
statement but you do not configure
dampen-options
values, the default values are used. If you
configure the dampen-options
statements at both a global hierarchy
level for a given script type as well as for a specific script of that type, the
individual script configuration takes precedence.
The script dampening feature does not work for certain CPU-intensive RPCs, including the following:
-
The cscript process might consume numerous CPU cycles for the
get-configuration
RPC, which involves parsing the XML configuration returned by the mgd process. Since a single line in the script triggers the processing, the device cannot dampen the operation.var $config = jcs:invoke("get-configuration");
Executing the
show snmp mib walk
command might cause the software process to consume numerous CPU cycles. This operation is outside the control of the cscript process and up to the software process to optimize.var $cmd = <command> "show snmp mib walk .1"; var $out = jcs:invoke($cmd);
To enable script dampening: