ラベル

Server (108) work (77) Idea (68) Car (31) PC (29) DAW (28) other (19) MakingWEBsite (18) 趣味 (18) health (13) CentOS (11) drupal (11) (9) android (4) スマホ (4) communication (3) drupal7 (3) hint (3) meno (3) モバイル (3) 歯医者 (3) 第二種電気工事士 (3) 英語 (3) PC Server (2) drupal8 (2) ms access (2) uwp C# (2) めし (2) 整備 (2) 音楽 (2) MIDI (1) diy (1) 会計 (1) 動画再生 (1) 生活 (1) 郵便 (1) 食べ物 (1)

2017年7月11日火曜日

logwatch 設定 logwatch.conf

logwatch送信時に自分で設定したコマンドの結果や自分のスクリプト結果も送れないかと思って調べてみた。

結果:できそうだけど、面倒そうなのでやめた。

logwatchはログ収集専門だろうけど、

hdd空容量表示に
df
を使っているのだろうから他のコマンドも使えるだろう。

参考にしようと思ってdfを扱っている部分を見てみると
/usr/share/logwatch/scripts/services/zz-disk_space.conf
(話は違うがオーバーライドさせたいなら、
/etc/logwatch/conf/services/zz-disk_space.conf
ここに書き込んどいたほうが安全。)
1行で簡単にすむと思ったらそうでもない。
違う方法の方がよさげ。
ログに結果を出してそれを読ませるとか・・・。

ちなみに
/usr/share/logwatch/scripts/services/
に並んでいるサービスのオン・オフ切り替えは、logwatch.confのServiceで設定できる。
---CentOS6のconf----------------------------------------
Service = All
# You can also disable certain services (when specifying all)
Service = "-zz-network"     # Prevents execution of zz-network service, which
                            # prints useful network configuration info.
Service = "-zz-sys"         # Prevents execution of zz-sys service, which
                            # prints useful system configuration info.
Service = "-eximstats"      # Prevents execution of eximstats service, which
                            # is a wrapper for the eximstats program.
-------------------------------------------
Allで全部をオンにしておいて、不必要なものに"-"をつけている。


logwatchの設定ファイル置き場。
優先順位は一番下が一番優先される。
/usr/share/logwatch/default.conf/logwatch.conf
/usr/share/logwatch/dist.conf/logwatch.conf
/etc/logwatch/conf/logwatch.conf
/etc/logwatch/conf/override.conf


実行するにはそのまま
logwatch



logwatch本体
/usr/share/logwatch/scripts/logwatch.pl

0 件のコメント:

コメントを投稿