|
From: | Harish Chouhan |
Subject: | RE: How to Install Monit on CentOS/Cloud Linux |
Date: | Mon, 31 Oct 2011 03:15:14 +0530 |
Hello Martin, Well everything is installed in the general way, However except system monitoring the other monitoring does not work. The code I am using to monitor, Apache, SSH & MySQL is: ## Securecentos.com DirectAdmin.conf for Monit (Updated 12082009) check 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 localhost port 80 protocol http and request "/" then alert if cpu is greater than 60% for 2 cycles then alert if cpu > 80% for 5 cycles then restart if children > 250 then restart if loadavg(5min) greater than 10 for 8 cycles then alert if 3 restarts within 5 cycles then timeout ## SSHD monit config , http://www.securecentos.com ## Modified 25/7-2008 check process sshd with pidfile /var/run/sshd.pid start program "/etc/init.d/sshd start" stop program "/etc/init.d/sshd stop" if failed port 2222 protocol ssh then restart if 5 restarts within 5 cycles then timeout ## Securecentos.com mysql.cfg for Monit (Updated 12082009) check process mysql with pidfile /var/run/mysqld/mysqld.pid group mysql start program = "/etc/init.d/mysql start" stop program = "/etc/init.d/mysql stop" if failed host 127.0.0.1 port 3306 protocol mysql then restart if 5 restarts within 5 cycles then timeout if failed unixsocket /var/run/mysqld/mysqld.sock protocol mysql then alert Now the monitoring starts, and after 5 failed attempts it just steps. I have gone to the “/var/run/” folder but did not find the sshd.pid file. Any other folder where this file may be present so I can modify and test? Regards, Harish Chouhan Visit me at - www.harishchouhan.com From: Martin Pala [mailto:address@hidden The rpm spec file is part of monit distribution (contrib/packages/redhat/monit.spec), the rpmbuild picks it up, so as mentioned, you can build the rpm from the tar.gz source code like this: rpmbuild -tb monit-5.3.1.tar.gz On Oct 30, 2011, at 9:53 PM, Harish Chouhan wrote: Hello, Can you please share where we can read about RPM builds? Awaiting your reply! Regards, Harish Chouhan Visit me at - www.harishchouhan.com From: Artyom Aleksandrov [mailto:address@hidden Oh, guys, don`t use "make; make install" commands on production systems, itsn`t true way! Take about one hour and read about rpmbuild and spec files.
On Sun, Oct 30, 2011 at 8:09 PM, Harish Chouhan <address@hidden> wrote: Hello, I finally think I have been able to properly install Monit. I was trying things from too many different articles. As after everything I got this message: “monit daemon at 975310 awakened” I for now know for sure that Monit is working. I tested it with “monit status” command. I am unable to open it yet from a web browser. I get a not found error. I have even tried to add the 2812 port in the allow list of my ConfigServer Firewall, but yet no luck. The details in my monitrc file are: set httpd port 2812 and use address localhost # only accept connection from localhost allow localhost # allow localhost to connect to the server and allow admin:monit # require user 'admin' with password 'monit' allow @monit # allow users of group 'monit' to connect (rw) allow @users readonly # allow users of group 'users' to connect readonly Can anyone help with this. Regards, Harish From: Martin Pala [mailto:address@hidden]
The example of simple configuration file which will work without modifications: 1.) save this as /etc/monitrc: --8<-- set daemon 5 # note: check every 60 seconds set httpd port 2812 and allow monit:123456 # note: monit can be access for example via http://127.0.0.1:2812/ with username "monit" and password "123456" check system mymachine --8<-- 2.) chmod 600 /etc/monitrc 3.) to start monit and the path to the binary (for example /usr/local/bin/monit) … monit will start in background, read the /etc/monitrc: /usr/local/bin/monit If you have further problems, please specify *exactly* what the problem is (i.e. does monit start? if not, what error is reported? if it did start, what the problem is - doesn't it monitor what you think it should monitor? or does it report some check error?). Saying just "having hard time to install monit" is the same as "having hard time to drive a car" (bunch of possible problems such as: do you have a car? didn't you lost the keys? does the car have fuel? can you drive? is the car broken? etc.) => please ask specific questions and describe the problem in detail On Oct 30, 2011, at 2:02 PM, Harish Chouhan wrote: Hello Martin, Thank you for the quick reply. I have been able to install. The steps I followed are from this article: http://www.securecentos.com/monitoring/install-monit/ But after that I have no idea how to make it work. I had setup the port number and userid/pass to access it through a browser but even that does not work. Regards, Harish Chouhan From: Martin Pala [mailto:address@hidden] Hello, what exactly the problem is and what doesn't work for you? The installation should be easy - you can either build the RPM package from the source code and then install the rpmbuild product: rpmbuild -tb monit-5.3.1.tar.gz or you can use binary build from here (either 32-bit or 64-bit version - depends on your system): The configuration is easy - the monitrc contains examples which you can uncomment and modify, another examples are here: http://mmonit.com/wiki/Monit/ConfigurationExamples. Please read monit manual for more details: Regards, Martin On Oct 30, 2011, at 1:53 PM, Harish Chouhan wrote: Hello, I am having a hard time installing Monit on CloudLinux/CentOS server. I have gone through all the articles and other sites found from Google, but nothing has worked for me. I have been able to install but then still trying to know if it’s working correctly and how to use it. Can anyone please help. Awaiting your reply! Regards, Harish Chouhan --
-- |
[Prev in Thread] | Current Thread | [Next in Thread] |