業務用エアコン関連の技術情報、エラーコード、環境問題対策に関する別サイト「エアコンの安全な修理・適切なフロン回収」

Ubuntu22.04 Server : Logwatch , Disk usage check

1. Introduce disk usage check script

1.1 Create Script

Contents of disk_capacity_check.sh

1.2 Execution check

①Check current utilization

The following appears

②Create a dummy file (in the example, it is called "dummyfile" and is about 4G) so that the utilization is 80% or more.

③Reaffirmation
Run it and make sure it is above 80%.

④Run disk space check script

You will receive an e-mail to the e-mail address you have set up with the body of the message as "Disk usage alert : 95%".

⑤Delete the "dummyfile" you created.

⑥Periodic Execution Setting

2. Log analysis tool logwatch installed

2.1 Install

2.2 Edit logwatch configuration file

①Copy the default configuration file

②Change the destination of your email, etc.

2.3 Creating Directories

There is no directory used by the cache, so create one.

2.4 operation check

When logwatch is installed, cron is registered by default, so daily report emails are sent
If you want to check it immediately, do the following

Copied title and URL