Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Monitoring the use of software monit

2025-03-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/03 Report--

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

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report