Logwatch Introduction
①Install
1 |
# dnf install logwatch |
②Edit configuration file
1 |
# cat /usr/share/logwatch/default.conf/logwatch.conf >> /etc/logwatch/conf/logwatch.conf |
1 2 3 4 5 6 7 8 9 10 |
# vi /etc/logwatch/conf/logwatch.conf ●Per line 53 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] ●Set the level of detail for log notifications per line 86 #Detail = Low Detail = High |
③Output Logwatch reports
1 |
# logwatch --output stdout |
You will get the following message
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
################### 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 ######################### |
④Test to see if the report arrives at the address you set. Check if you receive a log report email like the one above.
1 |
# /etc/cron.daily/0logwatch |
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
1 2 3 4 |
# cd /usr/local/bin # wget http://www.hi-ho.ne.jp/yoshihiro_e/dice/diced01914.tar.gz # tar -xzvf diced01914.tar.gz # cd /usr/local/bin/DiCE |
②DiCE Settings
DiCE output characters are EUC and therefore garbled; install nkf to convert to UTF-8
DiCE output characters are EUC and therefore garbled; install nkf to convert to UTF-8
1 |
# dnf install nkf |
Installed the following to run 32-bit software Dice on 64-bit OS
1 |
# dnf install glibc.i686 |
③Launch DiCE
1 2 |
# cd /usr/local/bin/DiCE # ./diced | nkf -uw |
④Add Event
There is no English translation of DiCE, so it is written in Japanese
When the DNS service is VALUEDOMAIN
There is no English translation of DiCE, so it is written in Japanese
When the DNS service is VALUEDOMAIN
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
# ./diced | nkf -uw : 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ー Manual Execution :ex 0 + 1/20 6:33 にddns_valuedomainが実行されました IPアドレスを更新しました :exit |
⑤Automatic Dice Execution
Start the DiCE daemon
1 2 3 4 5 6 7 8 |
# /usr/local/bin/DiCE/diced -d -l -=-=- DiCE DynamicDNS Client -=-=-= Version 0.19 for Japanese Copyright(c) 2001 sarad DiCE Daemon Started !! |
1 2 3 |
# ps aux | grep diced 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 |
Set to start automatically
1 2 3 4 5 6 7 8 |
Create new /etc/rc.local # 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 |