![]() set httpd port 2812įrom the above settings, monit will listen on 2812 admin user will able to access the web interface from any network. Look for httpd port 2812, uncomment the line. Monit also provides a web interface to monitor and manage the configured services, by default monit listens on 2812 port but it needs to be setup. Logs setting can be changed by using the following file. set mailserverĪlert templates can be found in the configuration file itself. ~]# vi /etc/nfĪlert cans be configured by. Monit conig file is /etc/nf, by default monit is set to check the services at interval of 2 min, this setting can be altered by changing. ~]# monit statusĭata collected Mon Jul 7 07:51:09 2014 Configure Monit: Start monit by using the following command. It logs to its own log file and notifies the user via customizable messages, this guide will help you to setup monit on CentOS / RHEL.Ĭonfigure EPEL repo to download the latest Monit package. It can also used for managing and monitoring of programs, files, directories, and devices for timestamps changes, checksum changes, or size changes not limited to perform various TCP/IP network checks, protocol checks, and can utilize SSL for such checks. Now it should all work once you have reloaded your monit config.Monit is an opensource process tool for Linux operating system which helps you to monitor system process using web browser and also when ever requires it automatically do the maintenance or repair of particular process in such a way that it can be brought back online. If failed port 22 protocol ssh then restart If 5 restarts within 5 cycles then timeoutĬheck file mysql_rc with path /etc/init.d/mysqlĪdd the following to your monit config check filesystem with path /dev/xvda1Īdd this to your monit config (change the port if yours is different) check process sshd with pidfile /var/run/sshd.pid If failed host 127.0.0.1 port 3306 protocol mysql then restart ![]() Start program = "/etc/init.d/mysql start" Then of course create the pid directory mkdir /var/run/tomcat/Ĭhown tomcat.tomcat /var/run/tomcat/ MySQLĪdd this to your my.cnf under pid-file=/var/run/mysqld/mysqld.pidĪnd this to your monit config check process mysql with pidfile /var/run/mysqld/mysqld.pid ![]() If failed port 8080 for 5 cycles then restartĬATALINA_PID to be /var/run/tomcat/tomcat.pid Stop program = "/usr/local/tomcat/bin/shutdown.sh" Start program = "/usr/local/tomcat/bin/startup.sh" Add a tomcat instance into your config for monit that looks like this (change gid/uid tomcat runs ) check process tomcat with pidfile "/var/run/tomcat/tomcat.pid" Which may then require manual intervention anyway. Use this method if you dont have a suitable http connector enabled for your tomcat instance, but be aware that pid files can be left in an inconsistent state in some cases. Start program = "/etc/init.d/tomcat restart" Typically monit prefers a bid file to monitor a service as described in method b, but this way works just as well so long as the http port connector is enabled.Įcho "check host tomcat with address localhost This method requires the least work and changes to configurations. ![]() ![]() Simply run the below snippet to enable monit monitoring of tomcat. Now for the tomcat part – this is based on tomcat being in /usr/local/tomcat where our typical setup script puts everything. and install from there.ĭo your basic config, and anything else you may need/want. Its very easy to configure and very customizable.ĭebian/Ubuntu based: apt-get install monit Centos: It handles everything from disk space, to memory, services, and other things. Monit is brilliant for monitoring and restarting services when they are down, it can alert you or just restart after 5 failed connects/attempts. Its not an overly hard task, in fact its pretty darned easy. We get asked a lot by customers to install and setup monit. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |