Click here for "Safe Air Conditioner Repair and Proper Freon Recovery".(Japanese Version)

Debian11.3 : Disk Usage Check、Logwatch

1. Introduce disk usage check script

1.1 Scripting

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 14G) 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 : 98%".

⑤Delete the "dummyfile" you created.

⑥Periodic Execution Setting

2. Log analysis tool logwatch installed

2.1 Install logwatch

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