info-center source SYSLOG loghost level notification这条命令正确吗,全局限制只发送syslog l5及以上的日志吗。请问有没有完整的配置案例
(0)
最佳答案
可以的
level notification 表示允许输出 notification 级别及以上(即更严重)的日志。
允许输出的日志级别:emergency (0)、alert (1)、critical (2)、error (3)、warning (4)、notification (5)
被过滤的日志级别:informational (6)、debugging (7)
emergency (最高) > alert > critical > error > warning > notification > informational > debugging (最低)
(0)
您好,参考
一.首先保证日志主机和设备能够路由可达。
#在SW1上创建vlan 10并配置虚接口IP地址
<SW1> system-view
[SW1]vlan 10
[SW1-vlan10]interface vlan 10
[SW1-Vlan-interface10]ip address 10.88.14.209 24
[SW1-Vlan-interface10]quit
二.配置日志主机
#开启信息中心
[SW1]info-center enable
#配置发送日志信息到IP地址为10.88.14.160的日志主机
[SW1]info-center loghost 10.88.14.160
#配置输出规则:允许DEFAULT所有应用模块、等级高于等于debug的日志信息输出到日志主机。
[SW1]info-center source default loghost level debug
(0)
暂无评论
`info-center source SYSLOG loghost level notification` 这条命令是正确的,其作用是配置信息中心将 **SYSLOG** 模块产生的日志中,**优先级为 notification(6)及以上**(即数值更小的优先级,如 warning(4)、error(3) 等)的日志发送到日志主机(loghost)。
但需注意:
该命令**仅限制 SYSLOG 模块**的日志发送级别,并非“全局限制只发送 syslog l5 及以上”。H3C设备的日志系统中,`info-center source <module> loghost level <level>` 是按 **模块(如 SYSLOG、DEFAULT、ARP、INTERFACE 等)** 分别控制日志发送级别的。因此:
- 该命令只影响 **SYSLOG 模块**;
- 其他模块仍可能发送更高级别或更低级别的日志,除非也显式配置;
- 若想实现“全局只发送 level 5(notification)及以上”,需对所有相关模块统一配置为 `level notification` 或更高(即数值更小)。
---
### ✅ 完整配置案例(H3C交换机配置syslog发送至日志服务器):
```bash
<H3C> system-view
# 配置日志主机地址(IPv4示例)
[H3C] info-center loghost 192.168.15.200 transport udp port 514
# 指定发送syslog报文的源接口(推荐使用管理VLAN接口)
[H3C] info-center loghost source Vlan-interface1
# 配置SYSLOG模块的日志发送级别为notification及以上
[H3C] info-center source SYSLOG loghost level notification
# (可选)限制其他关键模块的发送级别,实现“类全局”控制
[H3C] info-center source DEFAULT loghost level warning
[H3C] info-center source SNMP loghost level error
# 启用信息中心功能(通常默认开启)
[H3C] info-center enable
# (可选)配置本地缓冲日志级别
[H3C] info-center logbuffer level notification
```
---
### 🔍 补充说明:
- **日志级别(从高到低)**:
0 emergencies
1 alerts
2 critical
3 errors
4 warnings
5 notifications
6 informational
7 debugging
`level notification` 表示发送 level 0~5 的日志。
- **channel 与 source 的关系**:
`info-center source` 命令中的 `channel` 是指日志输出通道。`loghost` 通常是 **channel 2**,因此有时也看到配置:
```bash
info-center source SYSLOG channel 2 log level notification
```
与 `info-center source SYSLOG loghost level notification` 效果一致。
- **确保网络可达性**:
Vlan-interface1 的 IP(如 192.168.15.100)必须能与日志服务器(如 192.168.15.200)通信,且防火墙/ACL允许 UDP 514 端口流量。
---
### ✅ 总结:
- ✅ `info-center source SYSLOG loghost level notification` 命令**正确**;
- ❌ 它**不是全局限制**,只作用于 SYSLOG 模块;
- ✅ 推荐对多个关键模块统一配置发送级别以实现全局控制;
- ✅ 提供了完整配置案例供参考。
(0)
暂无评论
亲~登录后才可以操作哦!
确定你的邮箱还未认证,请认证邮箱或绑定手机后进行当前操作
举报
×
侵犯我的权益
×
侵犯了我企业的权益
×
抄袭了我的内容
×
原文链接或出处
诽谤我
×
对根叔社区有害的内容
×
不规范转载
×
举报说明
暂无评论