Monitor and Manage your services with Monit on CentOS 6 / RHEL 6 Rumi, September 6, 2019 Install Monit For Debian/Ubuntu Monit is easiest to install through apt-get: sudo apt-get install monit For RHEL: Configure EPEL repo to download the latest Monit package. [root@server ~]# rpm -Uvh http://epel.mirror.net.in/epel/6/i386/epel-release-6-8.noarch.rpm [root@server ~]# yum -y install monit Once monit downloads, you can add programs and processes to the configuration file: sudo nano /etc/monit/monitrc Monit can be started up with a command that then keeps it running in the background monit Typing monit status displays monit’s details: The Monit daemon 5.3.2 uptime: 1h 25m System 'myhost.mydomain.tld' status Running monitoring status Monitored load average [0.03] [0.14] [0.20] cpu 3.5%us 5.9%sy 0.0%wa memory usage 26100 kB [10.4%] swap usage 0 kB [0.0%] data collected Thu, 30 Aug 2012 18:35:0 Configure Monit Monit is very easy to use nearly out of the box. By default, it is set up to check that services are running every 2 minutes and stores its log file in “/var/log/monit.log”. These settings can be altered at the beginning of the configuration file in the set daemon and set logfile lines respectively. Web Service Monit comes with it’s own web server running on port 2812. To configure the web interface, find and uncomment the section that begins with set httpd port 2812. Once the section is uncommented, write in your server’s IP or domain name as the address, allow anyone to connect, and then create a monit user and password set httpd port 2812 use address 12.34.56.789 # only accept connection from localhost allow 0.0.0.0/0.0.0.0 # allow localhost to connect to the server and allow admin:monit # require user 'admin' with password 'monit' Once this is configured, monit should reload and reread the configuration file, and the web interface will be available: monit reload You will then be able to access the monit web interface by going to “example.com:2812” Login with your chosen username and password. Your screen should look something like this. Configuring Programs Self-Monitoring Once the web services are set up, you can begin to input the programs that you want monitored and protected into the “/etc/monit/monitrc” configuration file. To simply ensure that programs stay online, you can use the /etc/init.d commands to stop or start a program. Here are some example configurations: Apache: check process apache with pidfile /run/apache2.pid start program = "/etc/init.d/apache2 start" with timeout 60 seconds stop program = "/etc/init.d/apache2 stop" MySQL check process mysqld with pidfile /var/run/mysqld/mysqld.pid start program = "/etc/init.d/mysql start" stop program = "/etc/init.d/mysql stop" Nginx check process nginx with pidfile /var/run/nginx.pid start program = "/etc/init.d/nginx start" stop program = "/etc/init.d/nginx stop" Finish Up Once you have configured all of the programs that you want to run, they will be automatically tracked and restarted should they turn off. You can control the programs through both the web interface or the command line. Once you have set up the configuration, check the syntax: monit -t After resolving any possible syntax errors, you can start running all of the monitored programs. monit start all Src: https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-monit https://www.itzgeek.com/how-tos/linux/centos-how-tos/monitor-and-manage-your-services-with-monit-on-centos-6-rhel-6.html Related Administrations Configurations (Linux) Monit
Installing a Comodo SSL on Zimbra using CLI April 14, 2019April 14, 2019 1. Get the bundle from Comodo in crt format, or sometimes like a zip file. 2. Place the bundle on your Zimbra mailbox server. You should receive, or download, the next files: AddTrustExternalCARoot.crt COMODORSAAddTrustCA.crt COMODORSADomainValidationSecureServerCA.crt my_domain_com.crt or since comodo is acquired by Sectigo, the updated zip might appear as below:… Read More
DNS Slave Using Virtualmin July 19, 2019 DNS Slave Auto-Configuration Quickstart A quick guide to assist administrators who want to use Virtualmin’s automatic DNS slave configuration features. This allows for DNS server redundancy. Introduction Virtualmin can automatically manage any number of DNS slave servers for you. Once configured, it will create slave zones on other servers and… Read More
Proxmox GUI webpage stuck on loading January 8, 2023 Connection time out!!!! So boring nah? I can’t figure out where the problem is. It works and then couple of hours later I’d come back and it keeps on loading forever. SSH works fine, can SSH into containers as well. Just the GUI doesn’t work. Tried full upgrade. Checked for… Read More