• 产品与解决方案
  • 行业解决方案
  • 服务
  • 支持
  • 合作伙伴
  • 新华三人才研学中心
  • 关于我们

04-系统管理命令参考

04-日志命令

本章节下载 04-日志命令  (180.12 KB)

docurl=/cn/Service/Document_Software/Document_Center/IP_Security/ACG/H3C_SecPath_ACG1000/Command/Command_Manual/H3C_ACG1000_CR(E6411_R6609)-800/04/202112/1510264_30005_0.htm

04-日志命令


1 日志命令参考

1.1  日志命令

1.1.1  log facility

log facility命令用来设置日志的facility值。

【命令】

log { system_state | operate | mail | im | social_log | search_engine | file_transfer | relax_stock | command_log | web_access | other_app | security_ipmac | security_scan | security_flood | security_abnormal_pkt } facility facility-value

【缺省情况】

缺省情况下,日志的facility值为0。

【视图】

系统视图

【参数】

system_state:事件日志。

operate:操作日志。

im: IM聊天软件日志。

social_log:社区日志。

search_engine:搜索引擎日志。

mail:邮件日志。

file_transfer:文件传输日志。

relax_stock:娱乐、股票日志。

command_log:命令日志。

other_app:其它应用日志。

web_access:网站访问日志。

security_ipmacIP-MAC日志。

security_scan扫描攻击防御日志。

security_floodFlood攻击防御日志。

security_abnormal_pkt异常报文攻击日志。

facility-value:日志的facility值,取舍范围为0~65535。

【举例】

# 设置NAT日志的facility值为1024。

host# system-view

host(config)# log nat facility 1024

【相关命令】

·     display log config

1.1.2  log local

log local命令用来配置系统的日志是否记录在本地。

【命令】

log { system_state | operate | mail | im | social_log | search_engine | file_transfer | relax_stock | command_log | web_access | other_app | security_ipmac | security_scan | security_flood | security_abnormal_pkt } local { enable | disable }

【缺省情况】

缺省情况下,本地不记录会话日志和NAT,其余类型的日志本地会记录。

【视图】

系统视图

【参数】

system_state:事件日志。

operate:操作日志。

im:IM聊天软件日志。

social_log:社区日志。

search_engine:搜索引擎日志。

mail:邮件日志。

file_transfer:文件传输日志。

relax_stock:娱乐、股票日志。

command_log:命令日志。

other_app:其它应用日志。

web_access:网站访问日志。

security_ipmacIP-MAC日志。

security_scan扫描攻击防御日志。

security_floodFlood攻击防御日志。

security_abnormal_pkt异常报文攻击日志。

enable:记录日志在本地。

disable:不记录日志在本地。

【举例】

# 配置其它应用日志不记录在本地。

host# system-view

host(config)# log other_app local disable

【相关命令】

·     display log config

1.1.3  log server addr

log server addr命令用来配置日志服务器的IP地址。

【命令】

log server addr ip-address

【视图】

系统视图

【参数】

ip-address:日志服务器的IP地址。

【举例】

# 配置日志服务器的地址为192.168.1.100。

host# system-view

host(config)# log server addr 192.168.1.10

【相关命令】

·     local server enable

·     local server port

·     log server crypt

·     display log config

1.1.4  log server crypt

log server crypt命令用来启用日志内容的加密。

no log server crypt命令用来取消日志内容的加密。

【命令】

log server crypt

no log server crypt

【缺省情况】

缺省情况下,日志内容不加密。

【视图】

系统视图

【使用指导】

当启用日志内容加密之后,发送给日志服务器的日志内容会加密。只有外置数据中心可以解密日志的内容,保证日志在传输过程中的安全。

对于标准的日志服务器,不要使用日志加密选项,否则标准的日志服务器无法正确的解密日志。

【举例】

# 启用日志内容的加密。

host# system-view

host(config)# log server crypt

【相关命令】

·     local server enable

·     local server addr

·     local server port

·     display log config

1.1.5  log server enable

log server enable命令用来启用远端日志服务器。

log server disable命令用来禁用远端日志服务器。

【命令】

log server enable

log server disable

【视图】

系统视图

【使用指导】

在使用log server enable命令启用日志服务器之前,确保之前已经使用log server addr命令配置了日志服务器地址。

【举例】

# 启用日志服务器。

host# system-view

host(config)# log server enable

【相关命令】

·     local server addr

·     local server port

·     log server crypt

·     display log config

1.1.6  log server port

log server port命令用来配置日志服务器的端口。

【命令】

log server port port-num

【缺省情况】

缺省情况下,日志服务器的端口为514。

【视图】

系统视图

【参数】

port-num:日志服务器的UDP端口号。

【举例】

# 设置日志服务器的端口号为514。

host# system-view

host(config)# log server port 514

【相关命令】

·     local server enable

·     local server addr

·     display log config

1.1.7  log server second

log server second命令用来设置第二个日志服务器。

no log server second命令用来取消第二个日志服务器的配置。

【命令】

log server second { addr ip-address | port port-num | crypt }

no log server second { addr | port | crypt }

【缺省情况】

缺省情况下,第二日志服务器的端口是UDP 514,日志内容不加密。

【视图】

系统视图

【参数】

ip-address:第二个日志服务器的IP地址。

port-num:第二个日志服务器的端口号。

crypt:日志内容加密。

【使用指导】

如果一个日志服务器不够的用的话,可以使用log server second命令指定第二个日志服务器。

当启用日志内容加密之后,发送给日志服务器的日志内容会加密。只有外置数据中心可以解密日志的内容,保证日志在传输过程中的安全。

对于标准的日志服务器,不要使用日志加密选项,否则标准的日志服务器无法正确的解密日志。

【举例】

# 配置第二个日志服务器的地址为192.168.1.20,端口为514,日志内容不加密。

host# system-view

host(config)# log server second addr 192.168.1.20

host(config)# log server port 514

host(config)# no log server crypt

【相关命令】

·     display log config

1.1.8  log server third

log server third命令用来设置第三个日志服务器。

no log server third命令用来取消第三个日志服务器的配置。

【命令】

log server third { addr ip-address | port port-num | crypt }

no log server third { addr | port | crypt }

【缺省情况】

缺省情况下,第三日志服务器的端口是UDP 514,日志不加密。

【视图】

系统视图

【参数】

ip-address:第三个日志服务器的IP地址。

port-num:第三个日志服务器的端口号。

crypt:日志内容加密。

【使用指导】

如果二个日志服务器不够的用的话,可以使用log server third命令指定第三个日志服务器。

当启用日志内容的加密之后,发送给日志服务器的日志内容会进行加密。只有外置数据中心可以解密日志的内容,保证日志在传输过程中的安全。

对于标准的日志服务器,不要使用日志加密选项,否则标准的日志服务器无法正确的解密日志。

【举例】

# 配置第三个日志服务器的地址为192.168.1.20,端口为514,日志内容不加密。

host# system-view

host(config)# log server third addr 192.168.1.20

host(config)# log server port 514

host(config)# no log server crypt

【相关命令】

·     display log config

1.1.9  log server upto

log server upto命令用来过滤发送到日志服务器的日志的级别。

【命令】

log { system_state | operate | mail | im | social_log | search_engine | file_transfer | relax_stock | command_log | web_access | other_app | security_ipmac | security_scan | security_flood | security_abnormal_pkt } server { disable | enable | upto { alerts | critical | emergencies | errors | informational | notifications | warnings } }

【缺省情况】

缺省情况下,对发送到远端的日志不做过滤,所有日志发送到远端日志服务器。

【视图】

系统视图

【参数】

system_state:事件日志。

operate:操作日志。

im: IM聊天软件日志。

social_log:社区日志。

search_engine:搜索引擎日志。

mail:邮件日志。

file_transfer:文件传输日志。

relax_stock:娱乐、股票日志。

command_log:命令日志。

other_app:其它应用日志。

web_access:网站访问日志。

security_ipmacIP-MAC日志。

security_scan扫描攻击防御日志。

security_floodFlood攻击防御日志。

security_abnormal_pkt异常报文攻击日志。

enable所有日志发送给远端服务器。

disable所有日志不发送给远端服务器。

alerts告警及以上级别的日志发送到日志服务器。

critical严重及以上级别的日志发送到日志服务器。

emergencies:紧急及以上的级别的日志发送到日志服务器。

errors:错误及以上级别的日志发送到日志服务器。

informational:信息及以上级别的日志发送到日志服务器。

notifications:通知以及以上级别的日志发送到日志服务器。

warnings:警告及以及以上级别的日志发送到日志服务器

【举例】

# 将警告以上级别的邮件日志发送到日志服务器。

host# system-view

host(config)# log mail server upto warnings

#将所有邮件日志发送到日志服务器。

host# system-view

host(config)# log mail server enable

# 将所有邮件日志不发送到日志服务器。

host# system-view

host(config)# log mail server disable

【相关命令】

·     display log config

1.1.10  log source addr

log source addr命令用来设置设备发送的日志的源地址。

no log source addr命令用来删除设备发送日志的源地址,系统会根据系统路由的配置情况,使用接口的IP地址做为syslog的源IP地址。

【命令】

log source addr ip-address

no log source addr

【视图】

系统视图

【参数】

ip-address:日志的源IP地址。

【使用指导】

如果没有特殊需求,建议不要配置日志的源IP,让系统自动选择。

【举例】

# 配置日志的源IP为192.168.1.10。

host# system-view

host(config)# log source addr 192.168.1.10

【相关命令】

·     display log config

1.1.11  display log config

display log config命令用来显示日志的配置。

【命令】

display log config

【视图】

任意视图

【举例】

# 显示日志的配置。

host# display log config

log command_log server disable

log server addr 1.1.1.1

log server enable

!

set dplog time disable

set dplog send time 23

display log config命令显示日志模块的配置,具体的含义参见各个命令的介绍。

不同款型规格的资料略有差异, 详细信息请向具体销售和400咨询。H3C保留在没有任何通知或提示的情况下对资料内容进行修改的权利!

新华三官网
联系我们