Answers:
您可以使用以下send log
命令:
switch#send log Halfway through the script!
让我在装有IOS 12.2的Catalyst 3750上
May 31 16:36:18: %SYS-2-LOGMSG: Message from 1(name): Halfway through the script!
和IOS 15.0:
May 31 16:38:08: %SYS-7-USERLOG_DEBUG: Message from tty1(user id: name): Halfway through the script!
从Cisco设备发送测试系统日志的语法取决于软件版本。以下是我所见过的命令语法,包括(如果有的话)用于设置syslog严重性的选项:
大多数Cisco平台(如果运行IOS 12.2(58)或更高版本):
send log [severity] [text to send]
Eg:
send log
send log This message will go to my syslog server.
send log 5 This message will go to my syslog server.
大多数Cisco平台(如果运行IOS 12.2(52)或更低版本):
send log [text to send]
Eg:
send log
send log This message will go to my syslog server.
来自IOS 15.0(1)的运行IOS-XE 03.01.00的ASR1000:
send log [severity [text to send]]
Eg:
send log
send log 5 This message will go to my syslog server.
运行其他IOS-XE版本的ASR1000(包括IOS 12.2(33)中的02.04.03,IOS 15.1(3)中的03.04.04,IOS 15.5(1)中的03.14.00):
send log [severity] [text to send]
Eg:
send log
send log This message will go to my syslog server.
send log 5 This message will go to my syslog server.
运行IOS-XR 4.2.1和更高版本的ASR9000:
log <text to send>
Eg:
log This message will go to my syslog server.
运行IOS 12.2(18)的WS-C6513:无等效命令;您需要使用另一种方法来生成系统日志消息。例如,根据您的日志记录设置,以下应生成5个syslog(接口打开,线路协议打开,接口关闭,线路协议关闭和配置更改)。省略2个接口命令以仅生成一个由配置更改的通用syslog。
config t
interface loopback601
no interface loopback601
end