https://www.cnblogs.com/jiyanfeng/p/17606513.html
https://www.cnblogs.com/daynote/p/8996160.html
1. 华为交换机配置
# 更改时区
clock timezone BeiJing add 08:00:00
(or clock timezone cst add 8)
# 时间同步
ntp-service unicast-server 203.107.6.88
# 日志中心
info-center enable
info-center timestamp log format-date precision-time second
info-center loghost 192.168.2.96 facility local6 # 指定设备类型local6
info-center loghost source Vlanif1 # 指定日志消息本地发送接口
# 调试
display clock
display ntp-service status
display info-center
display channel 2
2. 服务器rsyslog配置
/etc/rsyslog.conf
# 日志格式模板
$template CustomFormat, "%timegenerated:1:23:date-rfc3339% | %syslogfacility-text% | %fromhost-ip% | %syslogseverity-text%
| %msg%\n"
# 日志文件模板
$template RemoteLog, "/var/log/rsyslog/%fromhost-ip%.log"
# 不写入本地日志
:fromhost-ip, !isequal, "127.0.0.1" ?RemoteLog;CustomFormat
3. 防火墙安全策略
untrust -> trust any to any 514 : permit
local -> trust any to any 514 : permit
4. 删除无需处理的log日志
2020-5-8 21:48:31+08:00 Huawei %%01NTP/4/PACKET_LENGTH_WRONG(l)[42]:The received NTP packet is longer than or shorter than a valid packet. (RcvLen=5)
提示含义:接收到的NTP报文长度超过合法报文的最大长度或者小于合法报文的最小长度。
处理步骤:正常运行信息,无需处理。
解决方法: info-center filter-id bymodule-alias ntp PACKET_LENGTH_WRONG //此处只需写对应的告警前缀即可,执行该命令后,设备不会继续反馈这种无需处理的告警log日志。
参考资料:https://support.huawei.com/enterprise/zh/knowledge/EKB1001995724
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 【译】Visual Studio 中新的强大生产力特性
· 【设计模式】告别冗长if-else语句:使用策略模式优化代码结构
· AI与.NET技术实操系列(六):基于图像分类模型对图像进行分类