Junos event-options configuration module
Version: 2019-01-01
module junos-es-conf-event-options { yang-version 1; namespace "http://yang.juniper.net/junos-es/conf/event-options"; prefix jc-event-options; import junos-common-ddl-extensions { prefix junos; revision-date "2019-01-01"; } import junos-common-types { prefix jt; revision-date "2019-01-01"; } import junos-es-conf-root { prefix jc; revision-date "2019-01-01"; } organization "Juniper Networks, Inc."; contact "yang-support@juniper.net"; description "Junos event-options configuration module"; revision "2019-01-01" { description "Junos: 21.3R1.9"; } augment /jc:configuration { uses event-options-group; } augment /jc:configuration/jc:groups { uses event-options-group; } grouping event-options-group { container event-options { description "Event processing configuration"; uses apply-advanced; leaf max-policies { type union { type string { pattern "<.*>|$.*"; } type uint32 { range "0 .. 20"; } } default "15"; description "Number of policies that can be executed simultaneously"; } list generate-event { key "name"; max-elements 10; ordered-by user; description "Generate an internal event"; leaf name { type string { length "1 .. 63"; } description "Name of the event to be generated"; } choice time_choice { leaf time-of-day { type jt:time-of-day; description "Time of day at which to generate event (hh:mm:ss)"; } leaf time-interval { type union { type string { pattern "<.*>|$.*"; } type uint32 { range "60 .. 2592000"; } } units "seconds"; description "Frequency for generating the event"; } } // choice time_choice leaf start-time { junos:must "((!(".. time-of-day") && ".. time-interval"))"; junos:must-message "'time-interval' is mandatory for 'start-time' configuration"; type jt:time; description "Start-time to generate event (yyyy-mm-dd.hh:mm)"; } leaf no-drift { type empty; description "Avoid event generation delay propagating to next event"; } } // list generate-event list policy { key "name"; ordered-by user; description "Event policy for event policy manager"; leaf name { type string { length "1 .. 63"; } description "Name of policy"; } uses apply-advanced; leaf-list events { type string; ordered-by user; description "List of events that trigger this policy"; } list within { key "name"; ordered-by user; description "List of events correlated with trigering events"; leaf name { type union { type string { pattern "<.*>|$.*"; } type uint32 { range "1 .. 604800"; } } units "seconds"; description "Time within which correlated events must occur (or not)"; } uses apply-advanced; container trigger { description "Correlate events based on the number of occurrences"; choice when { leaf until { type empty; description "Trigger when occurrences of triggering event < 'count'"; } leaf on { type empty; description "Trigger when occurrences of triggering event = 'count'"; } leaf after { type empty; description "Trigger when occurrences of triggering event > 'count'"; } } // choice when leaf count { type union { type uint32; type string { pattern "<.*>|$.*"; } } description "Number of occurrences of triggering event"; } } // container trigger leaf-list events { type string; ordered-by user; description "List of events that must occur within time interval"; } container not { description "Events must not occur within time interval"; leaf-list events { type string; ordered-by user; description "List of events that must not occur within time interval"; } } // container not } // list within list attributes-match { key "from-event-attribute condition to-event-attribute-value"; ordered-by user; description "List of attributes to compare for two events"; leaf from-event-attribute { type string { junos:posix-pattern "^([[:alnum:]]([[:alnum:]_-])*[.][[:alnum:]]([[:alnum:]_-])*)|(\{[$]([[:alnum:]]([[:alnum:]_-])*|[$])[.][[:alnum:]]([[:alnum:]_-])*})$"; junos:pattern-message "Must be either in event.attribute or {$$.attribute} or {$event.attribute} format where event and attribute start with an alphanumeric character and can consist of alphanumerics, underscores, or hyphens"; } description "First attribute to compare"; } leaf condition { type enumeration { enum "equals" { junos:must "(".. .. within")"; junos:must-message "within clause must be configured"; value 0; description "Attributes match"; } enum "starts-with" { junos:must "(".. .. within")"; junos:must-message "within clause must be configured"; value 1; description "Second attribute starts with first attribute value"; } enum "matches" { value 2; description "Regular expression matching the first attribute value"; } } description "Relationship that must hold between attributes"; } leaf to-event-attribute-value { type string; description "Second attribute or value to compare"; } } // list attributes-match container then { description "List of actions to perform when policy matches"; uses apply-advanced; leaf ignore { junos:must "(!((".. upload" || (".. execute-commands" || (".. raise-trap" || (".. event-script" || ".. priority-override"))))))"; junos:must-message "'ignore' must be specified as an action alone"; type empty; description "Do not log event or perform any other action"; } container priority-override { description "Change syslog priority value"; uses apply-advanced; leaf facility { type enumeration { enum "authorization" { value 0; description "Authorization system"; } enum "daemon" { value 1; description "Various system processes"; } enum "ftp" { value 2; description "FTP process"; } enum "ntp" { value 3; description "NTP process"; } enum "security" { value 4; description "Security related"; } enum "kernel" { value 5; description "Kernel"; } enum "user" { value 6; description "User processes"; } enum "dfc" { value 7; description "Dynamic flow capture"; } enum "external" { value 8; description "Local external applications"; } enum "firewall" { value 9; description "Firewall filtering system"; } enum "pfe" { value 10; description "Packet Forwarding Engine"; } enum "conflict-log" { value 11; description "Configuration conflict log"; } enum "change-log" { value 12; description "Configuration change log"; } enum "interactive-commands" { value 13; description "Commands executed by the UI"; } } description "Facility type"; } leaf severity { type enumeration { enum "emergency" { value 0; description "Panic conditions"; } enum "alert" { value 1; description "Conditions that should be corrected immediately"; } enum "critical" { value 2; description "Critical conditions"; } enum "error" { value 3; description "Error conditions"; } enum "warning" { value 4; description "Warning messages"; } enum "notice" { value 5; description "Conditions that should be handled specially"; } enum "info" { value 6; description "Informational messages"; } } description "Severity type"; } } // container priority-override list upload { key "filename destination"; ordered-by user; description "Upload file to specified destination"; leaf filename { type string; description "Name of file to upload"; } leaf destination { junos:must "("event-options destinations $$")"; junos:must-message "Destination is not defined"; type string; description "Location to which to output file"; } uses apply-advanced; leaf user-name { junos:must "("system login user $$")"; junos:must-message "User is not defined"; type string; description "User under whose privileges upload action will execute"; } leaf transfer-delay { type union { type uint32; type string { pattern "<.*>|$.*"; } } units "seconds"; description "Delay before uploading file to the destination"; } container retry-count { description "Upload output-filename retry attempt count"; leaf retry { type union { type string { pattern "<.*>|$.*"; } type uint8 { range "0 .. 10"; } } description "Number of retry attempts"; } leaf retry-interval { type union { type uint32; type string { pattern "<.*>|$.*"; } } units "seconds"; description "Time interval between each retry"; } } // container retry-count } // list upload container change-configuration { description "Change configuration"; uses apply-advanced; container retry { description "Change configuration retry attempt count"; leaf count { type union { type string { pattern "<.*>|$.*"; } type uint8 { range "0 .. 10"; } } description "Number of retry attempts"; } leaf interval { type union { type uint32; type string { pattern "<.*>|$.*"; } } units "seconds"; description "Time interval between each retry"; } } // container retry list commands { key "name"; ordered-by user; description "List of configuration commands"; leaf name { type string; description "Configuration command to issue"; } uses apply-advanced; } // list commands leaf user-name { junos:must "("system login user $$")"; junos:must-message "User is not defined"; type string; description "User under whose privileges configuration should be changed"; } container commit-options { description "List of commit options"; uses apply-advanced; container check { presence "enable check"; description "Check correctness of syntax; do not apply changes"; uses apply-advanced; leaf synchronize { type empty; description "Synchronize commit on both Routing Engines"; } } // container check leaf synchronize { junos:must "(!(".. check"))"; junos:must-message "check clause must not be configured"; type empty; description "Synchronize commit on both Routing Engines"; } leaf force { junos:must "(!(".. check"))"; junos:must-message "check clause must not be configured"; type empty; description "Force commit on other Routing Engine (ignore warnings)"; } leaf log { junos:must "(!(".. check"))"; junos:must-message "check clause must not be configured"; type string { length "1 .. 512"; } description "Message to write to commit log"; } } // container commit-options } // container change-configuration container execute-commands { description "Issue one or more CLI commands"; uses apply-advanced; list commands { key "name"; ordered-by user; description "List of CLI commands to issue"; leaf name { type string; description "CLI command to issue"; } uses apply-advanced; } // list commands leaf user-name { junos:must "("system login user $$")"; junos:must-message "User is not defined"; type string; description "User under whose privileges command will execute"; } leaf output-filename { junos:must "(".. destination")"; junos:must-message "'destination' statement must also be included"; type string { junos:posix-pattern "![/ %]"; junos:pattern-message "Must not contain '/', % or a space"; } description "Name of file in which to write command output"; } list destination { key "name"; max-elements 1; ordered-by user; description "Location to which to upload command output"; leaf name { junos:must "(".. .. output-filename")"; junos:must-message "'output-filename' statement must also be included"; junos:must "("event-options destinations $$")"; junos:must-message "Destination is not defined"; type string; description "Location to which to upload command output"; } uses apply-advanced; leaf transfer-delay { type union { type uint32; type string { pattern "<.*>|$.*"; } } units "seconds"; description "Delay before uploading file to the destination"; } container retry-count { description "Upload output-filename retry attempt count"; leaf retry { type union { type string { pattern "<.*>|$.*"; } type uint8 { range "0 .. 10"; } } description "Number of retry attempts"; } leaf retry-interval { type union { type uint32; type string { pattern "<.*>|$.*"; } } units "seconds"; description "Time interval between each retry"; } } // container retry-count } // list destination leaf output-format { type enumeration { enum "text" { value 0; description "Formatted ASCII text"; } enum "xml" { value 1; description "JUNOS XML tags"; } } default "xml"; description "Format of output from CLI commands"; } } // container execute-commands list event-script { key "name"; ordered-by user; description "Invoke event scripts"; leaf name { type string { junos:posix-pattern "!/"; junos:pattern-message "File name cannot contain a '/'"; length "1 .. 254"; } description "Local filename of the script file"; } uses apply-advanced; list arguments { key "name"; ordered-by user; description "Command line argument to the script"; leaf name { type string { length "1 .. 254"; } description "Name of the argument"; } leaf value { type string; description "Value of the argument"; } } // list arguments leaf user-name { junos:must "("system login user $$")"; junos:must-message "User is not defined"; type string; description "User under whose privileges event script will execute"; } leaf output-filename { junos:must "(".. destination")"; junos:must-message "'destination' statement must also be included"; type string { junos:posix-pattern "![/ %]"; junos:pattern-message "Must not contain '/', % or a space"; } description "Name of file in which to write event script output"; } list destination { key "name"; max-elements 1; ordered-by user; description "Location to which to upload event script output"; leaf name { junos:must "("event-options destinations $$")"; junos:must-message "Destination is not defined"; type string; description "Location to which to upload event script output"; } uses apply-advanced; leaf transfer-delay { type union { type uint32; type string { pattern "<.*>|$.*"; } } units "seconds"; description "Delay before uploading files"; } container retry-count { description "Upload output-filename retry attempt count"; leaf retry { type union { type string { pattern "<.*>|$.*"; } type uint8 { range "0 .. 10"; } } description "Number of retry attempts"; } leaf retry-interval { type union { type uint32; type string { pattern "<.*>|$.*"; } } units "seconds"; description "Time interval between each retry"; } } // container retry-count } // list destination leaf output-format { type enumeration { enum "text" { value 0; description "Formatted ASCII text"; } enum "xml" { value 1; description "JUNOS XML tags"; } } description "Format of output from event-script"; } } // list event-script leaf raise-trap { type empty; description "Raise SNMP trap"; } } // container then } // list policy container event-script { description "Configure event-scripts"; uses apply-advanced; leaf optional { type empty; description "Allow commit to succeed if the script is missing"; } leaf max-datasize { type string; units "bytes"; description "Maximum data segment size for scripts execution"; } container dampen { presence "enable dampen"; description "Run event scripts in dampen mode"; uses apply-advanced; container dampen-options { description "Dampen options for event scripts"; uses apply-advanced; leaf cpu-factor { type union { type string { pattern "<.*>|$.*"; } type uint32 { range "1 .. 100"; } } description "CPU factor at which to pause"; } leaf line-interval { type union { type string { pattern "<.*>|$.*"; } type uint32 { range "1 .. 4294967295"; } } description "Line interval at which to pause"; } leaf time-interval { type union { type string { pattern "<.*>|$.*"; } type uint32 { range "1 .. 4294967295"; } } units "microseconds"; description "Time to pause"; } } // container dampen-options } // container dampen container traceoptions { description "Trace options for event scripts"; uses apply-advanced; leaf no-remote-trace { junos:must "("system tracing")"; junos:must-message "'no-remote-trace' is valid only when [system tracing] is configured"; type empty; description "Disable remote tracing"; } container file { description "Trace file information"; leaf filename { type string { junos:posix-pattern "![/ %]"; junos:pattern-message "Must not contain '/', % or a space"; length "1 .. 1024"; } description "Name of file in which to write trace information"; } leaf size { type string; description "Maximum trace file size"; } leaf files { type union { type string { pattern "<.*>|$.*"; } type uint32 { range "2 .. 1000"; } } default "3"; description "Maximum number of trace files"; } choice world-readable-choice { leaf world-readable { type empty; description "Allow any user to read the log file"; } leaf no-world-readable { type empty; description "Don't allow any user to read the log file"; } } // choice world-readable-choice } // container file list flag { key "name"; description "Tracing parameters"; leaf name { type enumeration { enum "events" { value 0; description "Trace important events"; } enum "input" { value 1; description "Trace script input data"; } enum "offline" { value 2; description "Generate data for offline development"; } enum "output" { value 3; description "Trace script output data"; } enum "rpc" { value 4; description "Trace script RPCs"; } enum "xslt" { value 5; description "Trace the XSLT library"; } enum "all" { value 6; description "Trace all operations"; } } } } // list flag } // container traceoptions list file { key "name"; ordered-by user; description "File name for event script"; leaf name { type string { junos:posix-pattern "!/"; junos:pattern-message "File name cannot contain a '/'"; length "1 .. 254"; } description "Local filename of the script file"; } uses apply-advanced; leaf source { type string { length "1 .. 254"; } description "URL of source for this script"; } leaf cert-file { junos:must "(".. source")"; junos:must-message "source must be defined"; type string; description "Specify the certificate file name"; } leaf python-script-user { junos:must "("system login user $$")"; junos:must-message "User is not defined"; type string; description "Run the python event script with privileges of user"; } container dampen { presence "enable dampen"; description "Run script in dampen mode"; uses apply-advanced; container dampen-options { description "Dampen options for the script"; uses apply-advanced; leaf cpu-factor { type union { type string { pattern "<.*>|$.*"; } type uint32 { range "1 .. 100"; } } description "CPU factor at which to pause"; } leaf line-interval { type union { type string { pattern "<.*>|$.*"; } type uint32 { range "1 .. 4294967295"; } } description "Line interval at which to pause"; } leaf time-interval { type union { type string { pattern "<.*>|$.*"; } type uint32 { range "1 .. 4294967295"; } } units "microseconds"; description "Time to pause"; } } // container dampen-options } // container dampen leaf routing-instance { junos:must "("routing-instances $$")"; junos:must-message "Referenced routing instance must be defined under [edit routing-instances] hierarchy level"; type string { junos:posix-pattern "!^((__.*__)|(all)|(.*[ ].*)|("")|(.{129,}))$"; junos:pattern-message "Must be a non-reserved string of 128 characters or less with no spaces."; } description "Routing instance"; } leaf refresh { type empty; description "Refresh all operation scripts from their source"; } leaf refresh-from { type string { length "1 .. 254"; } description "Refresh all operation scripts from a given base URL"; } container checksum { description "Checksum of this script"; uses apply-advanced; leaf sha-256 { type string { length "1 .. 254"; } description "SHA-256 checksum of this script"; } } // container checksum list remote-execution { key "name"; ordered-by user; description "Remote login username and password details for script"; leaf name { type string { junos:posix-pattern "^[[:alnum:]._-]+$"; junos:pattern-message "Must be a string of alphanumericals, dashes or underscores"; length "1 .. 255"; } description "Remote hostname"; } uses apply-advanced; leaf username { type string { junos:posix-pattern "^[[:alnum:]_]{1,}[.]{0,1}[[:alnum:]_-]{0,}[.]{0,1}[[:alnum:]_-]{0,}$"; junos:pattern-message "Must contain characters (alphanumerics, underscores or hyphens) beginning with an alphanumeric or an underscore character."; } description "SSH username for login into the remote host"; } leaf passphrase { type jt:unreadable; description "SSH passphrase for login into the remote host"; } } // list remote-execution } // list file leaf refresh { type empty; description "Refresh all operation scripts from their source"; } leaf refresh-from { type string { length "1 .. 254"; } description "Refresh all operation scripts from a given base URL"; } } // container event-script list destinations { key "name"; ordered-by user; description "List of destinations referred to in 'then' clause"; leaf name { type string; description "Destination name"; } uses apply-advanced; leaf transfer-delay { type union { type uint32; type string { pattern "<.*>|$.*"; } } units "seconds"; default "0"; description "Delay before transferring files"; } list archive-sites { key "name"; ordered-by user; description "List of archive destinations"; leaf name { type string; description "URL of destination for file"; } leaf password { type jt:unreadable; description "Password for login into the archive site"; } } // list archive-sites } // list destinations container traceoptions { description "Trace options for the event processing daemon"; uses apply-advanced; leaf no-remote-trace { junos:must "("system tracing")"; junos:must-message "'no-remote-trace' is valid only when [system tracing] is configured"; type empty; description "Disable remote tracing"; } container file { description "Trace file information"; leaf filename { type string { junos:posix-pattern "![/ %]"; junos:pattern-message "Must not contain '/', % or a space"; length "1 .. 1024"; } description "Name of file in which to write trace information"; } leaf size { type string; description "Maximum trace file size"; } leaf files { type union { type string { pattern "<.*>|$.*"; } type uint32 { range "2 .. 1000"; } } default "3"; description "Maximum number of trace files"; } choice world-readable-choice { leaf world-readable { type empty; description "Allow any user to read the log file"; } leaf no-world-readable { type empty; description "Don't allow any user to read the log file"; } } // choice world-readable-choice leaf match { type jt:regular-expression; description "Regular expression for lines to be logged"; } } // container file list flag { key "name"; ordered-by user; description "List of event types to include in trace"; leaf name { type enumeration { enum "server" { value 0; description "Communication with processes that are generating events"; } enum "configuration" { value 1; description "Reading of configuration"; } enum "events" { value 2; description "Event processing"; } enum "timer-events" { value 3; description "Internally generated events"; } enum "database" { value 4; description "Events involving storage and retrieval in events database"; } enum "policy" { value 5; description "Policy processing"; } enum "registration" { value 6; description "Event registration"; } enum "syslogd" { value 7; description "Syslog related traces"; } enum "all" { value 8; description "Everything"; } } } } // list flag } // container traceoptions list redundancy-event { key "name"; ordered-by user; description "Events for policies to take action on"; uses srd-events-object; } // list redundancy-event } // container event-options } // grouping event-options-group grouping apply-advanced { description "Apply advanced configuration logic"; leaf-list apply-groups { type string; ordered-by user; description "Groups from which to inherit configuration data"; } leaf-list apply-groups-except { type string; ordered-by user; description "Don't inherit configuration data from these groups"; } list apply-macro { key "name"; ordered-by user; description "Macro and parameters for commit script expansion"; uses apply-macro-type; } // list apply-macro } // grouping apply-advanced grouping apply-macro-type { description "Macro data for commit-script expansion"; leaf name { type string; description "Name of the macro to be expanded"; } list data { key "name"; uses macro-data-type; } // list data } // grouping apply-macro-type grouping macro-data-type { leaf name { type string; description "Keyword part of the keyword-value pair"; } leaf value { type string; description "Value part of the keyword-value pair"; } } // grouping macro-data-type grouping srd-events-object { description "Events for policies to take action on"; leaf name { type string { length "1 .. 63"; } description "Redundancy event name"; } uses apply-advanced; container monitor { description "Interfaces to be tracked"; uses apply-advanced; list link-down { key "name"; description "Interfaces to be monitored for link-down events"; leaf name { type string; description "Name of the interface for monitoring link-down events"; } uses apply-advanced; } // list link-down container process { description "Processes related events"; uses apply-advanced; container routing { description "Routing process related events"; uses apply-advanced; leaf restart { type empty; description "Routing protocol restart event"; } leaf abort { type empty; description "Routing protocol abort event"; } } // container routing } // container process container peer { description "Events from remote peers"; uses apply-advanced; leaf event { type enumeration { enum "mastership-release" { value 0; description "Received mastership-release message from peer"; } enum "mastership-acquire" { value 1; description "Received mastership-acquire message from peer"; } } description "Peer Events"; } } // container peer } // container monitor } // grouping srd-events-object } // module junos-es-conf-event-options
© 2023 YumaWorks, Inc. All rights reserved.