Thomas Vachuska | 8ca75a2 | 2017-08-24 16:12:59 -0700 | [diff] [blame] | 1 | module openconfig-system-logging { |
| 2 | |
| 3 | yang-version "1"; |
| 4 | |
| 5 | // namespace |
| 6 | namespace "http://openconfig.net/yang/system/logging"; |
| 7 | |
| 8 | prefix "oc-log"; |
| 9 | |
| 10 | // import some basic types |
| 11 | import openconfig-extensions { prefix oc-ext; } |
| 12 | import ietf-inet-types { prefix inet; } |
| 13 | |
| 14 | |
| 15 | // meta |
| 16 | organization "OpenConfig working group"; |
| 17 | |
| 18 | contact |
| 19 | "OpenConfig working group |
| 20 | www.openconfig.net"; |
| 21 | |
| 22 | description |
| 23 | "This module defines configuration and operational state data |
| 24 | for common logging facilities on network systems."; |
| 25 | |
| 26 | oc-ext:openconfig-version "0.2.0"; |
| 27 | |
| 28 | revision "2017-07-06" { |
| 29 | description |
| 30 | "Move to oc-inet types, add IETF attribution, add RADIUS |
| 31 | counters, changed password leaf names to indicate hashed"; |
| 32 | reference "0.2.0"; |
| 33 | } |
| 34 | |
| 35 | revision "2017-01-29" { |
| 36 | description |
| 37 | "Initial public release"; |
| 38 | reference "0.1.0"; |
| 39 | } |
| 40 | |
| 41 | // extension statements |
| 42 | |
| 43 | // feature statements |
| 44 | |
| 45 | // identity statements |
| 46 | |
| 47 | identity SYSLOG_FACILITY { |
| 48 | description |
| 49 | "Base identity for Syslog message facilities."; |
| 50 | reference |
| 51 | "IETF RFC 5424 - The Syslog Protocol"; |
| 52 | } |
| 53 | |
| 54 | identity ALL { |
| 55 | base SYSLOG_FACILITY; |
| 56 | description |
| 57 | "All supported facilities"; |
| 58 | } |
| 59 | |
| 60 | identity KERNEL { |
| 61 | base SYSLOG_FACILITY; |
| 62 | description |
| 63 | "The facility for kernel messages"; |
| 64 | reference |
| 65 | "IETF RFC 5424 - The Syslog Protocol"; |
| 66 | } |
| 67 | |
| 68 | identity USER { |
| 69 | base SYSLOG_FACILITY; |
| 70 | description |
| 71 | "The facility for user-level messages."; |
| 72 | reference |
| 73 | "IETF RFC 5424 - The Syslog Protocol"; |
| 74 | } |
| 75 | |
| 76 | identity MAIL { |
| 77 | base SYSLOG_FACILITY; |
| 78 | description |
| 79 | "The facility for the mail system."; |
| 80 | reference |
| 81 | "IETF RFC 5424 - The Syslog Protocol"; |
| 82 | } |
| 83 | |
| 84 | identity SYSTEM_DAEMON { |
| 85 | base SYSLOG_FACILITY; |
| 86 | description |
| 87 | "The facility for the system daemons."; |
| 88 | reference |
| 89 | "IETF RFC 5424 - The Syslog Protocol"; |
| 90 | } |
| 91 | |
| 92 | identity AUTH { |
| 93 | base SYSLOG_FACILITY; |
| 94 | description |
| 95 | "The facility for security/authorization messages."; |
| 96 | reference |
| 97 | "IETF RFC 5424 - The Syslog Protocol"; |
| 98 | } |
| 99 | |
| 100 | identity SYSLOG { |
| 101 | base SYSLOG_FACILITY; |
| 102 | description |
| 103 | "The facility for messages generated internally by syslogd |
| 104 | facility."; |
| 105 | reference |
| 106 | "IETF RFC 5424 - The Syslog Protocol"; |
| 107 | } |
| 108 | |
| 109 | identity AUTHPRIV { |
| 110 | base SYSLOG_FACILITY; |
| 111 | description |
| 112 | "The facility for privileged security/authorization messages."; |
| 113 | reference |
| 114 | "IETF RFC 5424 - The Syslog Protocol"; |
| 115 | } |
| 116 | |
| 117 | |
| 118 | identity NTP { |
| 119 | base SYSLOG_FACILITY; |
| 120 | description |
| 121 | "The facility for the NTP subsystem."; |
| 122 | reference |
| 123 | "IETF RFC 5424 - The Syslog Protocol"; |
| 124 | } |
| 125 | |
| 126 | identity AUDIT { |
| 127 | base SYSLOG_FACILITY; |
| 128 | description |
| 129 | "The facility for log audit messages."; |
| 130 | reference |
| 131 | "IETF RFC 5424 - The Syslog Protocol"; |
| 132 | } |
| 133 | |
| 134 | identity CONSOLE { |
| 135 | base SYSLOG_FACILITY; |
| 136 | description |
| 137 | "The facility for log alert messages."; |
| 138 | reference |
| 139 | "IETF RFC 5424 - The Syslog Protocol"; |
| 140 | } |
| 141 | |
| 142 | identity LOCAL0 { |
| 143 | base SYSLOG_FACILITY; |
| 144 | description |
| 145 | "The facility for local use 0 messages."; |
| 146 | reference |
| 147 | "IETF RFC 5424 - The Syslog Protocol"; |
| 148 | } |
| 149 | |
| 150 | identity LOCAL1 { |
| 151 | base SYSLOG_FACILITY; |
| 152 | description |
| 153 | "The facility for local use 1 messages."; |
| 154 | reference |
| 155 | "IETF RFC 5424 - The Syslog Protocol"; |
| 156 | } |
| 157 | |
| 158 | identity LOCAL2 { |
| 159 | base SYSLOG_FACILITY; |
| 160 | description |
| 161 | "The facility for local use 2 messages."; |
| 162 | reference |
| 163 | "IETF RFC 5424 - The Syslog Protocol"; |
| 164 | } |
| 165 | |
| 166 | identity LOCAL3 { |
| 167 | base SYSLOG_FACILITY; |
| 168 | description |
| 169 | "The facility for local use 3 messages."; |
| 170 | reference |
| 171 | "IETF RFC 5424 - The Syslog Protocol"; |
| 172 | } |
| 173 | |
| 174 | identity LOCAL4 { |
| 175 | base SYSLOG_FACILITY; |
| 176 | description |
| 177 | "The facility for local use 4 messages."; |
| 178 | reference |
| 179 | "IETF RFC 5424 - The Syslog Protocol"; |
| 180 | } |
| 181 | |
| 182 | identity LOCAL5 { |
| 183 | base SYSLOG_FACILITY; |
| 184 | description |
| 185 | "The facility for local use 5 messages."; |
| 186 | reference |
| 187 | "IETF RFC 5424 - The Syslog Protocol"; |
| 188 | } |
| 189 | |
| 190 | identity LOCAL6 { |
| 191 | base SYSLOG_FACILITY; |
| 192 | description |
| 193 | "The facility for local use 6 messages."; |
| 194 | reference |
| 195 | "IETF RFC 5424 - The Syslog Protocol"; |
| 196 | } |
| 197 | |
| 198 | identity LOCAL7 { |
| 199 | base SYSLOG_FACILITY; |
| 200 | description |
| 201 | "The facility for local use 7 messages."; |
| 202 | reference |
| 203 | "IETF RFC 5424 - The Syslog Protocol"; |
| 204 | } |
| 205 | |
| 206 | identity LOG_DESTINATION_TYPE { |
| 207 | description |
| 208 | "Base identity for destination for logging messages"; |
| 209 | } |
| 210 | |
| 211 | identity DEST_CONSOLE { |
| 212 | base LOG_DESTINATION_TYPE; |
| 213 | description |
| 214 | "Directs log messages to the console"; |
| 215 | } |
| 216 | |
| 217 | identity DEST_BUFFER { |
| 218 | base LOG_DESTINATION_TYPE; |
| 219 | description |
| 220 | "Directs log messages to and in-memory circular buffer"; |
| 221 | } |
| 222 | |
| 223 | identity DEST_FILE { |
| 224 | base LOG_DESTINATION_TYPE; |
| 225 | description |
| 226 | "Directs log messages to a local file"; |
| 227 | } |
| 228 | |
| 229 | identity DEST_REMOTE { |
| 230 | base LOG_DESTINATION_TYPE; |
| 231 | description |
| 232 | "Directs log messages to a remote syslog server"; |
| 233 | } |
| 234 | |
| 235 | // typedef statements |
| 236 | |
| 237 | typedef syslog-severity { |
| 238 | type enumeration { |
| 239 | enum EMERGENCY { |
| 240 | description |
| 241 | "Emergency: system is unusable (0)"; |
| 242 | } |
| 243 | enum ALERT { |
| 244 | description |
| 245 | "Alert: action must be taken immediately (1)"; |
| 246 | } |
| 247 | enum CRITICAL { |
| 248 | description |
| 249 | "Critical: critical conditions (2)"; |
| 250 | } |
| 251 | enum ERROR { |
| 252 | description |
| 253 | "Error: error conditions (3)"; |
| 254 | } |
| 255 | enum WARNING { |
| 256 | description |
| 257 | "Warning: warning conditions (4)"; |
| 258 | } |
| 259 | enum NOTICE { |
| 260 | description |
| 261 | "Notice: normal but significant condition(5)"; |
| 262 | } |
| 263 | enum INFORMATIONAL { |
| 264 | description |
| 265 | "Informational: informational messages (6)"; |
| 266 | } |
| 267 | enum DEBUG { |
| 268 | description |
| 269 | "Debug: debug-level messages (7)"; |
| 270 | } |
| 271 | } |
| 272 | description |
| 273 | "Syslog message severities"; |
| 274 | reference |
| 275 | "IETF RFC 5424 - The Syslog Protocol"; |
| 276 | } |
| 277 | |
| 278 | // grouping statements |
| 279 | |
| 280 | grouping logging-selectors-config { |
| 281 | description |
| 282 | "Configuration data for logging selectors"; |
| 283 | |
| 284 | leaf facility { |
| 285 | type identityref { |
| 286 | base SYSLOG_FACILITY; |
| 287 | } |
| 288 | description |
| 289 | "Specifies the facility, or class of messages to log"; |
| 290 | } |
| 291 | |
| 292 | leaf severity { |
| 293 | type syslog-severity; |
| 294 | description |
| 295 | "Specifies that only messages of the given severity (or |
| 296 | greater severity) for the corresonding facility are logged"; |
| 297 | } |
| 298 | } |
| 299 | |
| 300 | grouping logging-selectors-state { |
| 301 | description |
| 302 | "Operational state data for logging selectors"; |
| 303 | } |
| 304 | |
| 305 | grouping logging-selectors-top { |
| 306 | description |
| 307 | "Top-level grouping for the logging selector list"; |
| 308 | |
| 309 | container selectors { |
| 310 | description |
| 311 | "Enclosing container "; |
| 312 | |
| 313 | list selector { |
| 314 | key "facility severity"; |
| 315 | description |
| 316 | "List of selectors for log messages"; |
| 317 | |
| 318 | leaf facility { |
| 319 | type leafref { |
| 320 | path "../config/facility"; |
| 321 | } |
| 322 | description |
| 323 | "Reference to facility list key"; |
| 324 | } |
| 325 | |
| 326 | leaf severity { |
| 327 | type leafref { |
| 328 | path "../config/severity"; |
| 329 | } |
| 330 | description |
| 331 | "Reference to severity list key"; |
| 332 | } |
| 333 | |
| 334 | container config { |
| 335 | description |
| 336 | "Configuration data "; |
| 337 | |
| 338 | uses logging-selectors-config; |
| 339 | } |
| 340 | |
| 341 | container state { |
| 342 | |
| 343 | config false; |
| 344 | |
| 345 | description |
| 346 | "Operational state data "; |
| 347 | |
| 348 | uses logging-selectors-config; |
| 349 | uses logging-selectors-state; |
| 350 | } |
| 351 | } |
| 352 | } |
| 353 | } |
| 354 | |
| 355 | grouping logging-console-config { |
| 356 | description |
| 357 | "Configuration data for console logging"; |
| 358 | } |
| 359 | |
| 360 | grouping logging-console-state { |
| 361 | description |
| 362 | "Operational state data for console logging"; |
| 363 | } |
| 364 | |
| 365 | grouping logging-console-top { |
| 366 | description |
| 367 | "Top-level grouping for console logging data"; |
| 368 | |
| 369 | container console { |
| 370 | description |
| 371 | "Top-level container for data related to console-based |
| 372 | logging"; |
| 373 | |
| 374 | container config { |
| 375 | description |
| 376 | "Configuration data for console logging"; |
| 377 | |
| 378 | uses logging-console-config; |
| 379 | } |
| 380 | |
| 381 | container state { |
| 382 | |
| 383 | config false; |
| 384 | |
| 385 | description |
| 386 | "Operational state data for console logging"; |
| 387 | |
| 388 | uses logging-console-config; |
| 389 | uses logging-console-state; |
| 390 | } |
| 391 | |
| 392 | uses logging-selectors-top; |
| 393 | } |
| 394 | } |
| 395 | |
| 396 | grouping logging-remote-config { |
| 397 | description |
| 398 | "Configuration data for remote log servers"; |
| 399 | |
| 400 | leaf host { |
| 401 | type inet:host; |
| 402 | description |
| 403 | "IP address or hostname of the remote log server"; |
| 404 | } |
| 405 | |
| 406 | leaf source-address { |
| 407 | type inet:ip-address; |
| 408 | description |
| 409 | "Source IP address for packets to the log server"; |
| 410 | } |
| 411 | |
| 412 | leaf remote-port { |
| 413 | type inet:port-number; |
| 414 | default 514; |
| 415 | description |
| 416 | "Sets the destination port number for syslog UDP messages to |
| 417 | the server. The default for syslog is 514."; |
| 418 | } |
| 419 | } |
| 420 | |
| 421 | grouping logging-remote-state { |
| 422 | description |
| 423 | "Operational state data for remote log servers"; |
| 424 | } |
| 425 | |
| 426 | grouping logging-remote-top { |
| 427 | description |
| 428 | "Top-level grouping for remote log servers"; |
| 429 | |
| 430 | container remote-servers { |
| 431 | description |
| 432 | "Enclosing container for the list of remote log servers"; |
| 433 | |
| 434 | list remote-server { |
| 435 | key "host"; |
| 436 | description |
| 437 | "List of remote log servers"; |
| 438 | |
| 439 | leaf host { |
| 440 | type leafref { |
| 441 | path "../config/host"; |
| 442 | } |
| 443 | description |
| 444 | "Reference to the host list key"; |
| 445 | } |
| 446 | |
| 447 | container config { |
| 448 | description |
| 449 | "Configuration data for remote log servers"; |
| 450 | |
| 451 | uses logging-remote-config; |
| 452 | } |
| 453 | |
| 454 | container state { |
| 455 | |
| 456 | config false; |
| 457 | |
| 458 | description |
| 459 | "Operational state data for remote log servers"; |
| 460 | |
| 461 | uses logging-remote-config; |
| 462 | uses logging-remote-state; |
| 463 | } |
| 464 | uses logging-selectors-top; |
| 465 | } |
| 466 | } |
| 467 | } |
| 468 | |
| 469 | grouping logging-top { |
| 470 | description |
| 471 | "Top-level grouping for logging data"; |
| 472 | |
| 473 | container logging { |
| 474 | description |
| 475 | "Top-level container for data related to logging / syslog"; |
| 476 | |
| 477 | uses logging-console-top; |
| 478 | uses logging-remote-top; |
| 479 | } |
| 480 | } |
| 481 | // data definition statements |
| 482 | |
| 483 | // augment statements |
| 484 | |
| 485 | |
| 486 | } |