Hello,

 

Thank you very much Martin. This has worked like a charm. I know thank you
is a small word for your time. If you ever require any web design service,
please feel free to let me know and I would do the best I can for no
charges.

I am pasting contents of my other email. It would be great if you could have
a look.

 

++

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 -  <http://www.harishchouhan.com/> www.harishchouhan.com 
Phone: +91-9833661410 | Email:  <mailto:[email protected]>
[email protected] |  <mailto:[email protected]>
[email protected]  

 

From: Martin Pala [mailto:[email protected]] 
Sent: 31 October 2011 03:46
To: [email protected]
Cc: 'This is the general mailing list for monit'
Subject: Re: How to Install Monit on CentOS/Cloud Linux

 

Please read the monit manual.

 

1.) the "address" option is optional and makes monit listen to specific
interface => if you'll remove it, monit will listen on all interfaces on the
machine

 

2.) the "allow" option sets access restrictions - you can combine multiple
"allow" options to require username/password and/or allow only access from
specific IP addresses.

 

 

 

On Oct 30, 2011, at 11:06 PM, Harish Chouhan wrote:





Hello Martin,

 

So do you mean if I add "allow my.ip.address" I could then access Monit with
a link such as "http://server-ip:2812?

 

Awaiting your reply!

 

Regards,

Harish Chouhan

 

Visit me at -  <http://www.harishchouhan.com/> www.harishchouhan.com 
Phone: +91-9833661410 | Email:  <mailto:[email protected]>
[email protected] |  <mailto:[email protected]>
[email protected]  

 

From: Martin Pala [mailto:[email protected]] 
Sent: 31 October 2011 03:29
To: [email protected]
Cc: 'This is the general mailing list for monit'
Subject: Re: How to Install Monit on CentOS/Cloud Linux

 

The "allow" options which are also included in your configuration protect
the access with usrname+password. You can also limit the access to specific
IP addresses (in addition to username/password) for example like this:
"allow 1.2.3.4"

 

 

On Oct 30, 2011, at 10:43 PM, Harish Chouhan wrote:






Hello Martin,

 

Thank you for that. It works now. Just one question, is this safe? Or there
any other way for me to access this without allowing other users to even see
the login page?

 

 

 

Regards,

Harish Chouhan

 

Visit me at -  <http://www.harishchouhan.com/> www.harishchouhan.com 
Phone: +91-9833661410 | Email:  <mailto:[email protected]>
[email protected] |  <mailto:[email protected]>
[email protected]  

 

From: Martin Pala [mailto:[email protected]] 
Sent: 31 October 2011 03:02
To: [email protected]
Cc: 'This is the general mailing list for monit'
Subject: Re: How to Install Monit on CentOS/Cloud Linux

 

The "use address localhost" option makes monit listen only on 127.0.0.1
(loopback) => it will be accessible via http://127.0.0.1:2812 on the same
host where monit is running, but not from other hosts. If you want to access
it from other hosts, remove this option.

 

Regards,

Martin

 

 

On Oct 30, 2011, at 5:09 PM, Harish Chouhan wrote:

 

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

 

 

 

--
To unsubscribe:
https://lists.nongnu.org/mailman/listinfo/monit-general

Reply via email to