Get the App
SLTechnology News&Howtos  ›  Servers  › 

Monitoring the use of software monit

Shulou Source: shulou.com Published: 2022-06-03 06:18:31 11月06日 Update

Installation: sudo apt-get install monit

Configuration file: sudo vim /etc/monit/monitrc

The main configuration options are as follows:

SMTP server for outgoing mail, here using AWS Simple Mail Service

set mailserver email-smtp.us-west-xx.amazonaws.com port 587

username "AKIAJxxxxxxxxxxxxxxxx" password "Axxxxxxxxxxxxxxxxxxxxxxxxxxx"

using tlsv1

with timeout 30 seconds

collectors

#email address which will receive monit alerts

set alert sim@abc.com

If you don't need monit, email yourself every time you reload

set alert sim@abc.com not {instance}

message format

set mail-format {

from: sim@abc.com

subject: XXX alert -- $EVENT $SERVICE

message: $EVENT Service $SERVICE

Date: $DATE

Action: $ACTION

Host: XXX Server

Description: $DESCRIPTION

Monitor System

}

enable http

Enable httpd: set httpd port 2812

#Then: sudo monit reload

#Then: localhost:2812

This profile already contains a number of monitoring options that can be configured on demand

Start monit: sudo monit

Other common commands

sudo monit status

sudo service monit status

sudo monit reload = sudo service monit restart

Check log:

sudo tail -f /var/log/monit.log

grep sshd /var/log/monit.log

Check syntax:

sudo monit -t

If you need to customize your own monitoring project, you can save the configuration file here: /etc/monit/conf.d/Monitoring disk space remaining alarm

sudo vim /etc/monit/conf.d/storagespace

check filesystem Media with path /dev/sdb1df

if space usage > 90% then alert

Monitor mounted external folders

check filesystem Compal-NAS-Croissant with path /test/ABC

if changed fsflags then alert

- Monitoring network connections

check host WWW with address 192.20.1.40

if failed ping then alert

Tags: Monitoring files configuration mail commands commonly used folders servers formats disks space networks requirements projects remaining alarms services monitoring software software Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Redmi Docker vpn Xiaomi MariaDB