User Tools

Site Tools


регистрация_событий_в_linux

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
регистрация_событий_в_linux [2026/07/31 16:38]
val [Использование утилиты logger]
регистрация_событий_в_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/​00-default-template.conf+# cat /​etc/​rsyslog.d/​40-syslog-high.conf
 </​code><​code>​ </​code><​code>​
-template(name="​CustomFileFormat" 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 ​CustomFileFormat +#$ActionFileDefaultTemplate ​WithSeverityFacility 
-</​code><​code>​ + 
-# cat /​var/​log/​syslog | egrep -v '​\[emerg\]|\[alert\]|\[crit\]|\[err\]|\[warning\]|\[notice\]|\[info\]|\[debug\]'​+#*.* -/​var/​log/​syslog.high;​WithSeverityFacility 
 +*.warning -/​var/​log/​syslog.high;​WithSeverityFacility 
 + 
 +#if (not ($msg contains "​PNP0A03"​) and 
 +#    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>​ 
 +  * [[#​Настройка на обработку сообщений типа local0]] 
 +<​code>​ 
 +# cat /​var/​log/​syslog.high | egrep -v '​\[emerg\]|\[alert\]|\[crit\]|\[err\]|\[warning\]|\[notice\]|\[info\]|\[debug\]'​
 </​code>​ </​code>​
 ==== Передача сообщений на STDIN программы ==== ==== Передача сообщений на STDIN программы ====
регистрация_событий_в_linux.1785505114.txt.gz · Last modified: 2026/07/31 16:38 by val