Navigation
Guide That Contains This Content
[+] Expand All
[-] Collapse All

    Example: Configuring Limits on Executed Event Policies and Memory Allocation for Scripts

    This example configures a maximum value for the number of event polices that the device can execute concurrently and a maximum memory limit for executed commit, event, and op scripts.

    Requirements

    A device running Junos OS Release 12.3 or later.

    Overview

    This example configures a device running Junos OS to limit the number of event policies that can run simultaneously on that device to a maximum of 12 policies. Additionally, the example configures each script type with a maximum amount of memory that the system can allocate to the data segment portion of a script of that type. The device is configured to allocate 192 MB for each executed commit script and event script and 100 MB for each executed op script.

    Configuration

    CLI Quick Configuration

    To quickly configure this example, copy the following commands, paste them in a text file, remove any line breaks, change any details necessary to match your network configuration, and then copy and paste the commands into the CLI at the [edit] hierarchy level:

    set system scripts commit max-datasize 192mset system scripts op max-datasize 100mset event-options max-policies 12set event-options event-script max-datasize 192m

    Step-by-Step Procedure

    1. Configure the maximum number of event policies that can execute concurrently.

      [edit]user@host# set event-options max-policies 12
    2. Configure the maximum memory allocated for the data segment for each executed commit script.

      [edit]user@host# set system scripts commit max-datasize 192m
    3. Configure the maximum memory allocated for the data segment for each executed op script.

      [edit]user@host# set system scripts op max-datasize 100m
    4. Configure the maximum memory allocated for the data segment for each executed event script.

      [edit]user@host# set event-options event-script max-datasize 192m
    5. Commit the configuration.

      [edit]user@host# commit

    Results

    [edit]
    event-options {event-script {max-datasize 192m;}max-policies 12;}
    system {scripts {commit {max-datasize 192m;}op {max-datasize 100m;}}}

    Verification

    Confirm that the configuration is working properly.

    Verifying the Limit on Concurrently Executing Event Policies

    Purpose

    If the system is running the maximum number of event policies, the system ignores any triggered event policy until such time that another policy finishes. The system logs the EVENTD_POLICY_LIMIT_EXCEEDED messsage for any triggered event policies that were not executed. By default, system log messages are recorded in the messages log file.

    Action

    Review the configured log file to verify whether any policies were barred from execution, because the maximum limit was reached. You can narrow the output to include only the relevant error messages by appending | match EVENTD_POLICY_LIMIT_EXCEEDED.

    user@R1> show log messages | match EVENTD_POLICY_LIMIT_EXCEEDED
    Jun 11 17:02:42  R1 eventd[1177]: EVENTD_POLICY_LIMIT_EXCEEDED: Unable to execute policy 'raise-trap' because current number of policies (12) exceeds system limit (12)
    [output omitted]
    

    Published: 2013-07-26