Logwatch Introduction
①Install
# cat /usr/share/logwatch/default.conf/logwatch.conf >> /etc/logwatch/conf/logwatch.conf
# vi /etc/logwatch/conf/logwatch.conf
Insert "#" at the beginning of the "MailTo = root" line and set the email address you want to receive notifications to the line below it.
#MailTo = root
MailTo = [Email Address]
#Detail = Low
Detail = High
③Output Logwatch reports
################### Logwatch 7.6 (01/22/22) ####################
Processing Initiated: Fri May 13 09:41:46 2022
Date Range Processed: yesterday
( 2022-May-12 )
Period is day.
Detail Level of Output: 10
Type of Output/Format: stdout / text
Logfiles for Host: fedora
###########################################################
--------------------- Amavisd-new Begin ------------------------
<abbreviation>
-------------------- Disk Space Begin ------------------------
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/fedora_fedora-root 15G 4.4G 11G 30% /
/dev/nvme0n1p1 1014M 245M 770M 25% /boot
---------------------- Disk Space End -------------------------
###################### Logwatch End #########################
Installing DiCE
Whenever the global IP changes, which happens when the network is disconnected or the router is disconnected and rebooted, the dynamic DNS must be accessed to inform the user that the global IP has changed. DiCE does this automatically!
①Download and install Dice
# wget https://centos.rcg.jp/download/DiCE.tar.gz
# tar -xzvf DiCE.tar.gz
# cd ./DiCE
DiCE output characters are EUC and therefore garbled; install nkf to convert to UTF-8
# ./diced | nkf -uw
There is no English translation of DiCE, so it is written in Japanese
When the DNS service is VALUEDOMAIN
: add
DynamicDNSサービス名を入力してください
"?"で対応しているサービスを一覧表示します
(P)戻る
>VALUEDOMAIN
ドメイン名を入力してください
"?"でドメイン一覧を表示します
(P)戻る
><domain name>
ホスト名を入力してください
(P)戻る
><host name>
ログインユーザ名を入力してください
(P)戻る
><user name>
ログインパスワードを入力してください
(P)戻る
><passwd>
登録するIPアドレスを入力してください
空白にすると現在のIPアドレスを自動検出します
(P)戻る
>Enter
このイベントに題名を付けてください
(P)戻る
>xxxxxxxxx(Any name)
実行する頻度を指定してください (番号入力)
(0)1回のみ (1)1日1回 (2)1週間に1回 (3)1ヵ月に1回
(4)その他の周期 (5)IPアドレス変化時 (6)起動時
(P)戻る
>5 (any)
IPアドレスがあまり変化しない環境の場合、更新せずに一定期間を過ぎると
アカウントを削除されてしまうことがあります
IPアドレスの変化が無い時に実行する間隔を指定してください
(0)7日毎 (1)14日毎 (2)21日毎 (3)28日毎
(4)35日毎 (5)56日毎 (6)84日毎
(P)戻る
>0(any)
このイベントを有効にしますか? (Y/N)
(イベントの有効/無効は"EN/DIS"コマンドで切替えられます)
>y
イベントを保存しますか? (Y/N)
>y
Event Confirmation
list
(No.) (イベント名) (スケジュール) (次回予定)
0 * xxxxxxxxx IPアドレス変化時 (7日毎) 01/27 06:27ー
手動実行
:ex 0
+ 1/20 6:33 にddns_valuedomainが実行されました
IPアドレスを更新しました
:exit
Start the DiCE daemon
# /usr/local/bin/DiCE/diced -d -l
-=-=- DiCE DynamicDNS Client -=-=-=
Version 0.19 for Japanese
Copyright(c) 2001 sarad
DiCE Daemon Started !!
Check if it is running
root 11121 1.3 0.0 3960 132 ? Ss 10:47 0:00 /usr/local/bin/DiCE/diced -d -l
root 11124 0.0 0.0 4584 2200 pts/0 S+ 10:48 0:00 grep --color=auto diced
# vi /etc/rc.local
#!/bin/sh
/usr/sbin/ethtool -s eth1 wol g
※ eth1 is the name of their network interface (check with # ip addr)
# chmod 700 /etc/rc.local# vi /etc/rc.local
/usr/local/bin/DiCE/diced -d -l ← add