Monit Installation and Configuration

Source: Internet
Author: User
Tags system log

Http://blog.chinaunix.net/uid-21516619-id-1825022.html

Some time ago in the Linux, need to use Monit to monitor Tomcat, studied the Monit, now will install and configure the process to write down, maybe later forget to use,

monit Installation and configuration

I. INTRODUCTION

Monit is a software used to monitor processes, files, directories, and devices under a Unix-like platform to repair programs that stop operating or operate abnormally, and to handle software errors that are caused by a variety of reasons.

Second, the installation

Assume that the following installation and configuration are performed under root status.

Installation is very simple, download Monit source code (now the latest version is 4.10.1) monit-4.10.1.tar.gz, put it in the appropriate directory, and then extract, configure (the default settings can), Make,make install. Use the following command specifically in the terminal:

Tar–xzf monit-4.10.1.tar.gz

CD monit-4.10.1

./configure

Make

Make install

It will be ready for installation soon.

Third, the configuration

After installation, copy the Monit configuration file monitrc to the/etc directory in the Monit source directory, using the command:

CP Monitrc/etc

Note/ETC/MONITRC access to this file cannot be greater than 0700, so you may also need to modify its access rights:

chmod 600/ETC/MONITRC

Then open/etc/monitrc This file for configuration, Monit has been most of the configuration of the example in the inside, most of the configuration can only be configured in front of the # (note) removed and then modify it accordingly. We primarily use Monit to monitor Tomcat servers, so the configuration is as follows:

Set Daemon 120 # setting Monit to run as a daemon and monitor once every 2 minutes

# 2 minutes is the default time interval, with examples of multiple configurations seen from the Web

# See the time interval is also 2 minutes, should be more reasonable

Set Logfile/var/log/monit.log # Sets the location of the log file, and if you want to write to the system log, you can

# set LogFile Syslog

Set httpd port 2812 and # Monit built-in one for viewing monitored services

# Status of HTTP server, note open in firewall

# This port ' 1 ', otherwise non-localhost inaccessible

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.