Solved

Monit problem

Posted on 2008-06-23
9
518 Views
Last Modified: 2010-05-18
I am a newbie in monit. I am not able to receive alerts as well as cannot access web to monitor the failures after installing monit.

Steps that i followed:

1.Installed monit
2 Edited the monitrc as follows

----------------------------------------------------------------------------------------------------
set daemon  120
set logfile syslog facility log_daemon
set mailserver localhost port 25 with timeout 15 seconds  
set mail-format { from: monit@adea-alert.com }
set alert jaisonshereen@gmail.com        
set alert jaisonshereen@gmail.com  only on { timeout }  
set httpd port 2812 and
use address localhost
allow 172.XX.78.99        # allow localhost to connect to the server and
allow admin:monit
check host server1 with address 74.86.138.7
if failed port 80 protocol http then alert

----------------------------------------------------------------------------------------------------


3. save the monitrc
4 Fired the commands : /opt/monit/monit-4.8.1/monit -c /opt/monit/monit-4.8.1/monitrc
5  monit stop all
6  monit start all

I am not getting any alerts in my inbox as well as i not able to access web for monit from http://172.XX.78.99:2812 


Kindly help me how i need to proceed with this?


My doubts:

1.Is there any webserver i need to configure apart from monit?

2. Does my entries in monitrc :

This:
------------------------------
set httpd port 2812 and
use address localhost
allow 172.XX.78.99
------------------------

and

This:
-------------------------------------------------
check host server1 with address 74.86.138.7
if failed port 80 protocol http then alert
---------------------------------------------------
are right?


0
Comment
Question by:jaisonshereen
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
9 Comments
 
LVL 14

Expert Comment

by:agriesser
ID: 21853501
use address localhost

means that monit only acceppts connections from localhost, so you have to start a webbrowser on this machine to be able to connect to monit.
If that's not what you want, you should change that line to:

use address 172.XX.78.99

The next thing that got messed up is the access list.
You did only allow the host with it's outside IP to connect to monit whereas you should allow the IP of the client from which you're attempting the connection.

f.ex. if your client has 172.XX.78.100, you should allow it like this:

allow 172.XX.78.100

You can even specify subnets in here, f.ex. to allow all computers in the 172.XX.78 network, use:

allow 172.XX.78.0/255.255.255.0
0
 
LVL 14

Expert Comment

by:agriesser
ID: 21853506
Forgot to mention: You can check what interface monit is listening on with the help of `lsof`:

lsof -n -i :2812
0
 

Author Comment

by:jaisonshereen
ID: 21853934
alert problem is resolved when i fired the command:

sudo monit reload


also,

172.XX.78.99 this is my windows machine where i am trying to connect to the linux server where my monit is running. I hope above what i give is right...

and i will change the address " use address 172.XX.78.99"



0
Get Actionable Data from Your Monitoring Solution

Your communication platform is only as good as the relevance of the information you send. Ensure your alerts get to the right people every time with actionable responses. Create escalation rules that ensure everyone follows the process and nothing is left to chance.

 
LVL 14

Expert Comment

by:agriesser
ID: 21853976
If .99 is your windows machine, you can't use "use address .99" on the linux machine. If your linux machine f.ex. has 172.XX.78.100, then you should use:

use address 172.XX.78.100
allow 172.XX.78.99
0
 

Author Comment

by:jaisonshereen
ID: 21854481
hmm...so "use address localhost"

is not wrong ..right?
0
 
LVL 14

Accepted Solution

by:
agriesser earned 500 total points
ID: 21855144
If you want to bind it to localhost only, no.
But as I said, if it's bound to localhost only, you can only access the webinterface on the localhost.
0
 

Author Comment

by:jaisonshereen
ID: 21858416
yeeeesssssssssssssss its worked ... thanks a ton!!
0
 

Author Closing Comment

by:jaisonshereen
ID: 31470012
Thanks a million TON !! :-)
0
 
LVL 14

Expert Comment

by:agriesser
ID: 21858443
You're welcome :) Good to hear that it works now for you.
0

Featured Post

Secure Your WordPress Site: 5 Essential Approaches

WordPress is the web's most popular CMS, but its dominance also makes it a target for attackers. Our eBook will show you how to:

Prevent costly exploits of core and plugin vulnerabilities
Repel automated attacks
Lock down your dashboard, secure your code, and protect your users

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are many situations when we need to display the data in sorted order. For example: Student details by name or by rank or by total marks etc. If you are working on data driven based projects then you will use sorting techniques very frequently.…
If you've heard about htaccess and it sounds like it does what you want, but you're not sure how it works... well, you're in the right place. Read on. Some Basics #1. It's a file and its filename is .htaccess (yes, with a dot in the front). #…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

717 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question