ON THIS PAGE
检查用户输入的命令
用途
您可以查看的一组通用操作是用户登录到路由器和发出的 CLI 命令。
要检查用户输入的命令,请按照以下步骤操作:
配置日志文件以跟踪 CLI 命令
操作
要配置日志文件以跟踪 CLI 命令,请按照以下步骤操作:
在配置模式下,转至以下层次结构级别:
[edit]user@host# edit system syslog配置日志文件:
[edit system syslog]user@host# edit file filename例如:
[edit system syslog]user@host# edit file cli-commands配置交互式命令设备和严重性级别:
[edit system syslog filename]user@host# set interactive-commands info验证配置:
[edit system syslog]user@host# showfile cli-commands {interactive-commands info;}提交配置:
user@host# commit
含义
该配置示例显示日志文件 cli 命令 配置了 交互式命令设备, 信息严重性级别。表 1列出并描述了严重级别。
表 1: 严重性级别
严重性级别 | Description |
---|---|
信息 | 记录所有顶级 CLI 命令,包括configure命令和所有配置模式命令。 |
恕 | 记录配置模式命令 复原及 commit. |
警告 | 任何软件进程重新启动时记录。 |
显示配置的日志文件
用途
要在配置模式下显示日志文件,请输入以下命令:
操作
[edit system syslog]
user@host# run show log filename
例如:
[edit system syslog]
user@host# run show log cli-commands
示例输出
[edit system syslog] user@host# run show log cli-commands Sep 16 11:24:25 nut mgd[3442]: UI_COMMIT_PROGRESS: commit: signaling 'Syslog daemon', pid 2457, signal 1, status 0 Sep 16 11:24:25 nut mgd[3442]: UI_COMMIT_PROGRESS: commit: signaling 'SNMP daemon', pid 2592, signal 31, status 0 Sep 16 11:28:36 nut mgd[3442]: UI_CMDLINE_READ_LINE: User 'user', command 'run show log cli-commands ' Sep 16 11:30:39 nut mgd[3442]: UI_CMDLINE_READ_LINE: User 'user', command 'run show log security ' Sep 16 11:31:26 nut mgd[3442]: UI_CMDLINE_READ_LINE: User 'user', command 'run show log messages ' Sep 16 11:41:21 nut mgd[3442]: UI_CMDLINE_READ_LINE: User 'user', command 'edit file cli-commands ' Sep 16 11:41:25 nut mgd[3442]: UI_CMDLINE_READ_LINE: User 'user', command 'show ' Sep 16 11:44:57 nut mgd[3442]: UI_CMDLINE_READ_LINE: User 'user', command 'set interactive-commands info ' Sep 16 14:32:15 nut mgd[3442]: UI_CMDLINE_READ_LINE: User 'user', command 'run show log cli-commands '
含义
示例输出显示了自配置日志文件以来输入的 CLI 命令。