AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / user-272827

Alexander Sergeyev's questions

Martin Hope
Alexander Sergeyev
Asked: 2016-08-29 10:33:09 +0800 CST

syslog-ng:过滤未分类的消息

  • 0

我设置了一个配置,其中消息被分类并写入相应的文件(目的地)。我想知道 -是否可以将特定过滤器未捕获的文件消息记录到文件中?

例如,有dhcpd, dhclient, acpid,sshd消息的过滤器。我想要的是获取不属于上述所有 4 个类别的消息。

我看到tags可以作为内部的每消息结构使用。我试图为每个类别设置一个标记并像这样抓取未标记:

rewrite r_set_routed { set-tag('routed'); };
filter f_untagged { not tags('routed'); };
filter f_dhcpd_program { program('dhcpd'); };
<...>
log { source(s_local); rewrite(r_set_routed); filter(f_dhcpd_program); destination(d_dhcpd_file); };
<...>
log { source(s_local); filter(f_untagged); destination(d_unfiltered_file); };

但这不起作用(看起来r_set_routed重写一个log {}不会影响另一个log {})。我知道可以否定所有过滤器以产生不匹配的所有过滤器,但这是我想避免的容易出错和肮脏的方式。

syslog syslog-ng
  • 1 个回答
  • 592 Views
Martin Hope
Alexander Sergeyev
Asked: 2015-06-01 07:46:46 +0800 CST

Supermicro BMC 看门狗导致的重启

  • 7

我最近购买了一块 SuperMicro X10SLL-F 主板,它内置了 BMC(Aspeed AST2400 芯片)。我想在服务器上运行 linux 时使用内置的看门狗控制器(gentoo 加固)。

我在bios中启用了看门狗功能,然后将主板跳线从硬重置切换到NMI(看门狗超时操作,用于测试目的以避免重新启动)。关于软件——我安装并添加到默认运行级别看门狗程序(sys-apps/watchdog),该程序配置为每 10 秒 ping 一次看门狗设备(/dev/watchdog,存在)。看门狗超时设置为 250 秒。

程序显然会看到看门狗硬件(启用了 openipmi 的 ipmitool):

# ipmitool mc watchdog get
Watchdog Timer Use:     SMS/OS (0x44)
Watchdog Timer Is:      Started/Running
Watchdog Timer Actions: Hard Reset (0x01)
Pre-timeout interval:   0 seconds
Timer Expiration Flags: 0x10
Initial Countdown:      254 sec
Present Countdown:      253 sec

免费ipmi:

# bmc-watchdog --get
Timer Use:                   SMS/OS
Timer:                       Running
Logging:                     Enabled
Timeout Action:              Hard Reset
Pre-Timeout Interrupt:       None
Pre-Timeout Interval:        0 seconds
Timer Use BIOS FRB2 Flag:    Clear
Timer Use BIOS POST Flag:    Clear
Timer Use BIOS OS Load Flag: Clear
Timer Use BIOS SMS/OS Flag:  Set
Timer Use BIOS OEM Flag:     Clear
Initial Countdown:           254 seconds
Current Countdown:           253 seconds

但是,经过一段时间后,我得到了(上面的程序报告了良好的“当前倒计时”值):

[  294.107534] Uhhuh. NMI received for unknown reason 21 on CPU 0.
[  294.107998] Do you have a strange power saving mode enabled?
[  294.108437] Dazed and confused, but trying to continue

这是 NMI,显然是由看门狗超时引起的。机器硬重置发生后不到一分钟。

哪里有问题,应该往哪个方向去挖掘?

编辑:与 ipmi 相关的内核消息:

[    0.353090] ipmi message handler version 39.2
[    0.353353] ipmi device interface
[    0.353623] IPMI System Interface driver.
[    0.353898] ipmi_si: probing via ACPI
[    0.354172] ipmi_si 00:08: [io  0x0ca2] regsize 1 spacing 1 irq 0
[    0.354444] ipmi_si: Adding ACPI-specified kcs state machine
[    0.354790] ipmi_si: probing via SMBIOS
[    0.355051] ipmi_si: SMBIOS: io 0xca2 regsize 1 spacing 1 irq 0
[    0.355317] ipmi_si: Adding SMBIOS-specified kcs state machine duplicate interface
[    0.355836] ipmi_si: probing via SPMI
[    0.356095] ipmi_si: SPMI: io 0xca2 regsize 1 spacing 1 irq 0
[    0.356362] ipmi_si: Adding SPMI-specified kcs state machine duplicate interface
[    0.356906] ipmi_si: Trying ACPI-specified kcs state machine at i/o address 0xca2, slave address 0x0, irq 0
[    0.390536] ipmi_si: The BMC does not support clearing the recv irq bit, compensating, but the BMC needs to be fixed.
[    0.418476] ipmi_si 00:08: Found new BMC (man_id: 0x002a7c, prod_id: 0x0801, dev_id: 0x20)
[    0.419004] ipmi_si 00:08: IPMI kcs interface initialized
[    0.419272] IPMI SSIF Interface driver
[    0.420350] IPMI Watchdog: driver initialized
[    0.420635] Copyright (C) 2004 MontaVista Software - IPMI Powerdown via sys_reboot.
[    0.421444] IPMI poweroff: ATCA Detect mfg 0x2A7C prod 0x801
[    0.421710] IPMI poweroff: Found a chassis style poweroff function

编辑:我尝试使用配置为“-u 4 -p 2 -a 0 -F -P -L -O -i 300 -e 10”的 bmc-watchdog。所以只有 SMS/OS 时间在使用,预超时中断设置为 NMI,超时操作设置为 NONE:

# bmc-watchdog --get
Timer Use:                   SMS/OS
Timer:                       Running
Logging:                     Enabled
Timeout Action:              None
Pre-Timeout Interrupt:       NMI / Diagnostic Interrupt
Pre-Timeout Interval:        0 seconds
Timer Use BIOS FRB2 Flag:    Clear
Timer Use BIOS POST Flag:    Clear
Timer Use BIOS OS Load Flag: Clear
Timer Use BIOS SMS/OS Flag:  Set
Timer Use BIOS OEM Flag:     Clear
Initial Countdown:           300 seconds
Current Countdown:           290 seconds

但这根本没有改变。

编辑。此外,当我通过将 \0x00 回显到 /dev/watchdog 来触发看门狗计时器,然后将其保持不变时——系统在默认的 10 秒超时后正确重新启动。所以看门狗工作得很好,但在启动系统重新启动后正好 350 秒。

编辑。我检查了 BMC 系统事件日志 (SEL) 并在重新启动后发现:

Sensor #202 | Watchdog 2 | Assertion Event | Timer interrupt ; Timer use at expiration = SMS/OS ; Interrupt type = none
Sensor #202 | Watchdog 2 | Assertion Event | Timer expired, status only ; Timer use at expiration = SMS/OS ; Interrupt type = none

这里有趣的是——该事件被标记为“仅状态”。即便如此,系统也会重新启动。当我故意触发看门狗超时时,日志是不同的:

Sensor #202 | Watchdog 2 | Assertion Event | Timer interrupt ; Timer use at expiration = SMS/OS ; Interrupt type = none
Sensor #202 | Watchdog 2 | Assertion Event | Hard Reset ; Timer use at expiration = SMS/OS ; Interrupt type = none
ipmi
  • 1 个回答
  • 15604 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve