Linux process Monitoring

Source: Internet
Author: User

Linux Process monitoring MonitMonit is a small open source tool to manage and monitor UNIX systems. Monit can automatically maintain the process, to avoid the process of abnormal exit and other problems arising.
    • System: Monit can monitor the problem, including process status, System CPU load, memory consumption, etc., such as when the Apache service CPU load and memory lock is too high, it will restart the Apache service.
    • Process: Monit can monitor daemon processes, including system processes. For example, when one is down, it automatically resumes restarting the process.
    • File system:Monit can monitor changes in local files, directories, and file systems, including timestamps, checksum values, and size changes. For example, you can monitor file SHA1 and MD5 values to monitor whether a file has changed.
    • Network:Monit can monitor network connections, support TCP, UDP, Unix domain sockets, and HTTP, SMTP, and so on.
    • Timed scripts:Monit can be used to test programs and scripts on a timed basis, obtaining output from the program to determine success or otherwise.
Installation:
sudo apt-get install Monit
To edit a configuration:
sudo vim/etc/monit/monitrc
Start, stop, restart:
sudo/etc/init.d//etc/init.d//etc/init.d/monit Restart
To set the page monitoring status:
and 0.0.0.0/0.0.0.0 allowlocalhost
Increased monitoring:

Note that there is a need to add start and stop, missing one is not possible

1. Monitoring according to the program name

" /home/yxd/test.py "  "xxxxx"

2. According to PID monitoring

Check process Apache with pidfile/var/run/"/etc/init.d/rcwebserver.sh start https"  "/etc/init.d/rcwebserver.sh stop https" if changed PID then Aler 
Reference: Monitoring system critical processes with Monit SupervisordSupervisor is a C/s system that allows users to monitor and control the number of background service processes in a UNIX-like operating system. It is written by Python and is often used for restart protection of process exception exits. Installation:
Pip Install Supervisor
To view the configuration file:
Echo_supervisord_conf
From the results of this command, you can see the configuration information for each module. To create a configuration file:
echo_supervisord_conf >/etc/supervisord.conf
To configure the app:
[Program:test]command=python/root/test_supervisor.pyprocess_name=%(program_name) sstdout_ LogFile=/root/test.logstderr_logfile=/root/test.log
Save, start:
/usr/bin/supervisord-c/etc/supervisord.conf
Reference: Managing Python processes with Supervisord

Linux process Monitoring

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.