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

Rocky Linux10.0 : Chkrootkit , Logwatch , Disk Usage Check Script

Chkrootkit

Download and install chkrootkit

Create /root/bin directory and move chkrootkit command to that directory

Check chkrootkit.

If nothing is displayed, no problem.

Create chkrootkit periodic execution script and change permissions
Create chkrootkit execution script in a directory where it is automatically executed daily

Scheduled Script Contents

Add execution permission to chkrootkit execution script

Backup commands used by chkrootkit
If the commands used by chkrootkit are tampered with, rootkit will not be detected.
Back up these commands.
If necessary, run chkrootkit with the backed up command

Run chkrootkit on the copied command

If nothing is displayed, no problem.

Compresses backed up commands

Send chkrootkit use command (compressed version) to root by e-mail

Download and save chkrootkit_cmd.tar.gz file to Windows

Delete commands on the backed up server

Logwatch

Install

Edit configuration file

Output Logwatch reports

It will appear as follows

Test to see if the report arrives at the address you set. Check if you receive a log report email like the one above.

Introduce disk usage check script

1. Script Creation

Contents of disk_capacity_check.sh

2. Execution Confirmation

①Check current usage rates

It appears as follows

②Create a dummy file to achieve at least 80% utilization(In the example, the name is dummyfile and it is about 60G.)

③check again

Run it and make sure it is above 80%.

④Run check scripts

You will receive an email to the email address you have set up, stating something like "Disk usage alert: 96 %".

⑤Delete "dummyfile"

⑥Periodic Execution Setting

Copied title and URL