Skip to content

Commit

Permalink
Merge pull request #274 from bigpick/develop
Browse files Browse the repository at this point in the history
Added messages for user enter,  exit, and writing from config mode.
  • Loading branch information
luke-orden committed Oct 23, 2018
2 parents 6b93369 + 51d4bb7 commit c81efbf
Show file tree
Hide file tree
Showing 9 changed files with 144 additions and 0 deletions.
15 changes: 15 additions & 0 deletions napalm_logs/config/eos/USER_ENTER_CONFIG_MODE.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
messages:
# 'error' should be unique and vendor agnostic.
- error: USER_ENTER_CONFIG_MODE
tag: SYS-5-CONFIG_E
values:
user: (\w+)
vterm: (\w+)
ip4: ([\w\d:\.]+)
line: ': Enter configuration mode from console by {user} on {vterm} ({ip4})'
model: NO_MODEL
mapping:
variables: {}
static:
users//user//{user}//action//enter_config_mode: True

16 changes: 16 additions & 0 deletions napalm_logs/config/eos/USER_EXITED_CONFIG_MODE.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
messages:
# 'error' should be unique and vendor agnostic.
- error: USER_EXIT_CONFIG_MODE
tag: SYS-5-CONFIG_I
values:
source: (\w+)
user: (\w+)
vterm: (\w+)
ip4: ([\w\d:\.]+)
line: 'Configured from {source} by {user} on {vterm} ({ip4})'
model: NO_MODEL
mapping:
variables: {}
static:
users//user//{user}//action//exit_config_mode: True

14 changes: 14 additions & 0 deletions napalm_logs/config/eos/USER_WRITE_CONFIG.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
messages:
- error: USER_WRITE_CONFIG
tag: SYS-5-CONFIG_STARTUP
values:
user: (\w+)
vterm: (\w+)
ip: ([\w\d:\.]+)
path: ([\w\:\-\/]+)
line: 'Startup config saved from {path} by {user} on {vterm} ({ip})'
model: NO_MODEL
mapping:
variables: {}
static:
users//user//{user}//action//write_config: True
1 change: 1 addition & 0 deletions tests/config/eos/USER_ENTER_CONFIG_MODE/default/syslog.msg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<165>Oct 23 12:20:55 GeorgeSwitch ConfigAgent: %SYS-5-CONFIG_E: Enter configuration mode from console by admin on vty3 (127.0.0.1)
32 changes: 32 additions & 0 deletions tests/config/eos/USER_ENTER_CONFIG_MODE/default/yang.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"host": "GeorgeSwitch",
"yang_message": {
"users": {
"user": {
"admin": {
"action": {
"enter_config_mode": true
}
}
}
}
},
"message_details": {
"facility": 20,
"pri": "165",
"processName": "ConfigAgent",
"host": "GeorgeSwitch",
"tag": "SYS-5-CONFIG_E",
"time": "12:20:55",
"date": "Oct 23",
"message": ": Enter configuration mode from console by admin on vty3 (127.0.0.1)",
"severity": 5
},
"timestamp": 1540297255,
"error": "USER_ENTER_CONFIG_MODE",
"ip": "127.0.0.1",
"facility": 20,
"os": "eos",
"yang_model": "NO_MODEL",
"severity": 5
}
1 change: 1 addition & 0 deletions tests/config/eos/USER_EXIT_CONFIG_MODE/default/syslog.msg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<165>Oct 23 12:23:41 GeorgeSwitch ConfigAgent: %SYS-5-CONFIG_I: Configured from console by admin on vty3 (127.0.0.1)
32 changes: 32 additions & 0 deletions tests/config/eos/USER_EXIT_CONFIG_MODE/default/yang.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"host": "GeorgeSwitch",
"yang_message": {
"users": {
"user": {
"admin": {
"action": {
"exit_config_mode": true
}
}
}
}
},
"message_details": {
"facility": 20,
"pri": "165",
"processName": "ConfigAgent",
"host": "GeorgeSwitch",
"tag": "SYS-5-CONFIG_I",
"time": "12:23:41",
"date": "Oct 23",
"message": ": Configured from console by admin on vty3 (127.0.0.1)",
"severity": 5
},
"timestamp": 1540297421,
"error": "USER_EXIT_CONFIG_MODE",
"ip": "127.0.0.1",
"facility": 20,
"os": "eos",
"yang_model": "NO_MODEL",
"severity": 5
}
1 change: 1 addition & 0 deletions tests/config/eos/USER_WRITE_CONFIG/default/syslog.msg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<165>Oct 23 12:22:50 GeorgeSwitch ConfigAgent: %SYS-5-CONFIG_STARTUP: Startup config saved from system:/running-config by admin on vty3 (127.0.0.1).
32 changes: 32 additions & 0 deletions tests/config/eos/USER_WRITE_CONFIG/default/yang.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"host": "GeorgeSwitch",
"yang_message": {
"users": {
"user": {
"admin": {
"action": {
"write_config": true
}
}
}
}
},
"message_details": {
"facility": 20,
"pri": "165",
"processName": "ConfigAgent",
"host": "GeorgeSwitch",
"tag": "SYS-5-CONFIG_STARTUP",
"time": "12:22:50",
"date": "Oct 23",
"message": ": Startup config saved from system:/running-config by admin on vty3 (127.0.0.1).",
"severity": 5
},
"timestamp": 1540297370,
"error": "USER_WRITE_CONFIG",
"ip": "127.0.0.1",
"facility": 20,
"os": "eos",
"yang_model": "NO_MODEL",
"severity": 5
}

0 comments on commit c81efbf

Please sign in to comment.