ę„­å‹™ē”Øć‚Øć‚¢ć‚³ćƒ³é–¢é€£ć®ęŠ€č”“ęƒ…å ±ć€ć‚Øćƒ©ćƒ¼ć‚³ćƒ¼ćƒ‰ć€ē’°å¢ƒå•é”Œåƾē­–ć«é–¢ć™ć‚‹åˆ„ć‚µć‚¤ćƒˆć€Œć‚Øć‚¢ć‚³ćƒ³ć®å®‰å…ØćŖäæ®ē†ļ½„適切ćŖćƒ•ćƒ­ćƒ³å›žåŽć€

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