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

Debian11.11 : logwatch , Disk Usage Check Script

1. Introduce disk usage check script

1.1 Script Creation

Contents of disk_capacity_check.sh
Configured to notify when disk usage exceeds 80%.

1.2 Execution check

Check current usage

It appears as follows

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

Re-confirmation

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 : 96%".

Delete the "dummyfile" you created.

Periodic Execution Setting

2.Log analysis tool logwatch installed

2.1 logwatch 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