![install monit install monit](https://4.bp.blogspot.com/-PhwD7ZHVkrI/TwcbN8_a2OI/AAAAAAAAAKU/10LOcHPVTMQ/s1600/monit-ntop-process.png)
Install Monit in CentOS Linux for Monitoring.To understand Monit config file better follow this link : You can verify that monit is started from /var/log/monit.log log ~]# tail -f /var/log/monit.log Type the following command to start ~]# /etc/init.d/monit start
#Install monit password
Set mailserver, port 25 username "superman" password "binpip" using tlsv1, localhost with timeout 15 seconds MySQL server restart configuration directivesĬheck process mysqld with pidfile /var/run/mysqld/mysqld.pid group mysql start program = "/etc/init.d/mysqld start" stop program = "/etc/init.d/mysqld stop" if failed host 127.0.0.1 port 3306 then restart if 5 restarts within 5 cycles then timeoutĬheck process sshd with pidfile /var/run/sshd.pid start program "/etc/init.d/sshd start" stop program "/etc/init.d/sshd stop" if failed host 127.0.0.1 port 22 protocol ssh then restart if 5 restarts within 5 cycles then timeout Now to monitor Apache, create a file /etc/monit.d/httpd, ~]# vi /etc/monit.d/httpdĬheck process httpd with pidfile /var/run/httpd.pid group apache start program = "/etc/init.d/httpd start" stop program = "/etc/init.d/httpd stop" if failed host 127.0.0.1 port 80 protocol http then restart if 5 restarts within 5 cycles then timeout Set daemon 60 set logfile /var/log/monit.log set mailserver localhost set mail-format set alert include /etc/monit.d/* Type the following command to ~]# vi /etc/nf The configuration file of monit in Centos or RedHat is /etc/nf. Turn on monit when system start ~]# chkconfig -levels 235 monit on To install monit, type the following ~]# yum install monit name=Extra Packages for Enterprise Linux 5 - $basearch mirrorlist= repo=epel-5&arch=$basearch failovermethod=priority enabled=1 gpgcheck=0 Login as root and type the following ~]# vi /etc//epel.repoĪdd or uncomment the following content at end of the file The first, you need to enable EPEL (Extra Packages for Enterprise Linux) to install monit package. For more infop on monit you can visit their official site Monit logs to syslog or to its own log file and notifies you about error conditions and recovery status via customizable alert. Monit is controlled via an easy to use control file based on a free-format, token-oriented syntax. You can also monitor remote hosts Monit can ping a remote host and can check TCP/IP port connections and server protocols. You can use Monit to monitor files, directories and filesystems for changes, such as timestamp changes, checksum changes or size changes. Monit can start a process if it does not run, restart a process if it does not respond and stop a process if it uses too much resources.
#Install monit how to
We will discuss here how to install and configure a basic monit installation in Centos or Redhat Linux. However, you are the master and monit would only do what you define in the config file for it to do. Monit conducts automatic maintenance and repair and can execute meaningful causal actions in error situations. Monit is an open source utility for managing and monitoring, processes, files, directories and filesystems on a UNIX system.