2
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

rsyslogのアクション指定'*'について

Posted at

経緯

仕事でちょくちょくサーバ構築を行っているが、rsyslogの設定の一部に(多分RHEL7.4系から?)警告(warn)が出るようになっていたのでメモ

環境

  • OSはRHEL7.4系

事象

rsyslogの設定について、「とりあえずpriority='emerg'ならオンラインの全ユーザに通知する」を設定するため、以下を/etc/rsyslog.confに記述したところ、変な警告が出てきた。

/etc/rsyslog.conf
## <facility名>.<priority>  <action> のフォーマットで記述する
*.emerg   *

出てきた警告は以下。

console画面
# systemctl status rsyslog -l
● rsyslog.service - System Logging Service
   Loaded: loaded (/usr/lib/systemd/system/rsyslog.service; enabled; vendor preset: enabled)
   Active: active (running) since 金 2017-12-22 01:04:58 JST; 32s ago
     Docs: man:rsyslogd(8)
           http://www.rsyslog.com/doc/
 Main PID: 2593 (rsyslogd)
   CGroup: /system.slice/rsyslog.service
           mq2593 /usr/sbin/rsyslogd -n

12月 22 01:04:58 [host名] systemd[1]: Starting System Logging Service...
12月 22 01:04:58 [host名] rsyslogd[2593]:  [origin software="rsyslogd" swVersion="8.24.0" x-pid="2593" x-info="http://www.rsyslog.com"] start
12月 22 01:04:58 [host名] rsyslogd[2593]: action '*' treated as ':omusrmsg:*' - please use ':omusrmsg:*' syntax instead, '*' will not be supported in the future [v8.24.0 try http://www.rsyslog.com/e/2184 ]
12月 22 01:04:58 [host名] systemd[1]: Started System Logging Service.
12月 22 01:04:58 [host名] rsyslogd[2593]: error during parsing file /etc/rsyslog.conf, on or before line 57: warnings occured in file '/etc/rsyslog.conf' around line 57 [v8.24.0 try http://www.rsyslog.com/e/2207 ]

なんか最後の行見ると構文エラーちっくな事が書いてあるな…と思いふと上数行を見ると、気になる一文が。

action '*' treated as ':omusrmsg:*' - please use ':omusrmsg:*' syntax instead, '*' will not be supported in the future

actionに'*'を使うのは将来未サポートになるから'omusrmsg:*'という記述にしてくれ、とのこと。

対応

素直に言われたとおりにaction部分の'*'を'omusrmsg:*'に変更したところ、警告が出なくなった。あっさり。

omusrmsgとは?

「User Message Output Module」の略(多分)で、ログイン中ユーザのコンソールに通知を行うためのビルトインモジュールらしい。
ユーザを指定するactionを定義する場合は、omusrmsg:の後にユーザ名を指定するかアスタリスクを指定する必要がある。

# root,user1,user2のコンソール画面に出力する
:omusrmsg:root,user1,user2   

補足

いつからこの仕様になったのかは正直良く調べていないが今のところは'*'のままでも警告が出るだけで動きはする

  • 上記の出力結果でも一応active(running)となっており、rsyslog自体は動いているっぽい

参考

RHEL7.1 を rsyslog サーバとして動かす方法!
User Message Output Module

2
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?