This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
регистрация_событий_в_linux [2026/08/02 09:43] val [Изменение формата сообщений] |
регистрация_событий_в_linux [2026/08/08 17:47] (current) val [Журнал важных сообщений] |
||
|---|---|---|---|
| Line 35: | Line 35: | ||
| ==== Настройка на обработку сообщений типа local0 ==== | ==== Настройка на обработку сообщений типа local0 ==== | ||
| + | |||
| + | * [[Сервис ротации журналов]] | ||
| + | |||
| <code> | <code> | ||
| root@server:~# cat /etc/rsyslog.d/30-cisco.conf | root@server:~# cat /etc/rsyslog.d/30-cisco.conf | ||
| Line 81: | Line 84: | ||
| Facility="local0") | Facility="local0") | ||
| - | #:msg, contains, "adduser" ~ | + | #:msg, contains, "adduser" stop |
| - | #:msg, contains, "edituser" ~ | + | #:msg, contains, "edituser" stop |
| #*.* @server.corpX.un:8514 | #*.* @server.corpX.un:8514 | ||
| Line 88: | Line 91: | ||
| </code> | </code> | ||
| - | ==== Изменение формата сообщений ==== | + | ==== Журнал важных сообщений ==== |
| - | + | ||
| - | Добавление уровня важности | + | |
| <code> | <code> | ||
| # cat /etc/rsyslog.d/40-syslog-high.conf | # cat /etc/rsyslog.d/40-syslog-high.conf | ||
| </code><code> | </code><code> | ||
| - | template(name="WithSeverity" type="string" string="%TIMESTAMP% %HOSTNAME% [%syslogseverity-text%] %syslogtag%%msg%\n") | + | template(name="WithSeverityFacility" type="string" string="%TIMESTAMP% %HOSTNAME% [%syslogfacility-text%.%syslogseverity-text%] %syslogtag%%msg%\n") |
| + | |||
| + | #$ActionFileDefaultTemplate WithSeverityFacility | ||
| - | #$ActionFileDefaultTemplate WithSeverity | + | #*.* -/var/log/syslog.high;WithSeverityFacility |
| + | *.warning -/var/log/syslog.high;WithSeverityFacility | ||
| - | #*.* -/var/log/syslog.high;WithSeverity | + | #if (not ($msg contains "PNP0A03") and |
| - | *.warning -/var/log/syslog.high;WithSeverity | + | # not ($msg contains "LPM") and |
| + | # not ($msg contains "vmwgfx") and | ||
| + | # not ($msg contains "ehci_hcd")) then { | ||
| + | # *.warning;local3.none -/var/log/syslog.high;WithSeverityFacility | ||
| + | # local3.crit -/var/log/syslog.high;WithSeverityFacility | ||
| + | #} | ||
| </code> | </code> | ||
| * [[#Настройка на обработку сообщений типа local0]] | * [[#Настройка на обработку сообщений типа local0]] | ||