Better monitoring with Monit

interfasys

Verified User
Joined
Oct 31, 2003
Messages
1,821
Location
Switzerland
Directadmin includes a very basic and unflexible service monitor which only supports its own rc scripts, wouldn't it be better for everyone if it was displaying the information collected by monit in the control panel?

The screenshots will give you a better idea of the type of information we get through it
http://mmonit.com/monit/#screenshots

It can restart services, test scripts, test the mail server, monitor the filesystem, permissions, etc.

Example scripts
Automatically manage typical mail server problems
Code:
  check process exim with pidfile /var/run/exim.pid
    start program = "/usr/local/etc/rc.d/exim start"
    stop program  = "/usr/local/etc/rc.d/exim stop"
    if cpu > 60% for 2 cycles then alert
    if cpu > 80% for 5 cycles then restart
    if totalmem > 200.0 MB for 5 cycles then restart
    if children > 250 then restart
    if loadavg(5min) greater than 10 for 8 cycles then stop
    if failed host INSERT_THE_RELAY_HOST port 25 type tcp protocol smtp
       with timeout 15 seconds
      then alert
    if 3 restarts within 5 cycles then timeout

If Apache is stuck doing lookups
Code:
check process apache with pidfile /var/run/httpd.pid
       start "/usr/local/etc/rc.d/httpd start"
       stop  "/usr/local/etc/rc.d/httpd stop"
       if failed host www.example.co.uk port 80
          protocol apache-status dnslimit > 25% 
       then alert

It's available on Linux and BSD
 
Last edited:
Looks interesting.
Just the other day I was thinking it would be nice to have a bit more active information like CPU-load and say Mem-use, constantly visible in the right blue column for instance in the DA-enhanced skin.
 
It can restart services, test scripts, test the mail server, monitor the filesystem, permissions, etc.

It's available on Linux and BSD
This is only my opinion...
I have a separate VPS with zabbix installed to monitor all kind of servers and services. It requires only an agent installed on the server you need to monitor.
Currently with a 512MB ram vps I monitor around 25 dedicated and vps servers.

I can imagine that having the information displayed inside directadmin would be great, but still, I wouldn't change zabbix...
Nice graphs for everything you can imagine and proactive monitoring is what makes the difference.

I hope I see you at the zabbix conference this September in Riga, Latvia...
 
That's not the same thing. The idea is not to use SNMP to monitor a network of machines, but to automate tasks on a server, just like DA can restart processes it thinks are down.
It's more of a sysadmin than a network engineer tool.

Thanks for the information. As I understand Monit is only for the localhost? If you have Monit on server 1 and on server 2, server 1 can not restart httpd on server 2?
 
That would be nice if it works. In that case I will use Observium for all graphics and alerting and Monit for pro-active monitoring & restarting services when down.
 
Hey, and what about License?

Monit is free software; you can redistribute it and/or modify it under the terms of the GNU Affero General Public License (AGPL). The license only applies if you plan to distribute Monit to third parties. In that case, our hope and the reason we use AGPL is that any modification done to Monit can be contributed back so others can benefit. Otherwise, you can do whatever you want with Monit without any restrictions.

I'm not quite sure what it means.
 
Neither DA nor us would be negatively affected by the terms of the license. We would just be using the software, not modifying it.
And even if we were to make modification, all it means is that we HAVE to send the modifications to them, which is not a bad thing.
 
What about Nagios and Munin?

Regards
Again, those apps only take care of the monitoring and give you nice graphs which help you understand where your bottlenecks are, etc.

Monit can act as a powerful replacement for DA's service monitoring system which not only tells you if your service is up, but also restarts it.
 
Well actually you can make scripts to manage action when a service fail and DA actually also manage the service restart if they fail.

What am i missing?

Regards
 
Well actually you can make scripts to manage action when a service fail and DA actually also manage the service restart if they fail.

What am i missing?

Regards
Something like Monit is more flexible and powerful than the system in DA, that's the reason I think it should replace that part of DA.
Regarding scripts, you mean in Nagios?
 
I've added a couple of scripts in the OP to try and describe how easy it is to add some actions based on events as opposed to the on/off we currently have.
 
Again, those apps only take care of the monitoring and give you nice graphs which help you understand where your bottlenecks are, etc.

Monit can act as a powerful replacement for DA's service monitoring system which not only tells you if your service is up, but also restarts it.

Nagios is a widely used and reliable monitoring system. With the right scripts called "Event Handlers" you can automatically restart services when Nagios detects there is a problem. Badly enough I did not have the time to configure those event_handlers.
 
I've installed monit besides nagios.

And i must say i enjoy the use of Monit.

It gives a nice overview of all CPU and Memory consumption of the server processes.
When the server load get's higher it will send you an email with all the info about the proces that's taking to much mem/cpu

For example. When my load get's higher (Because of httpd) and httpd process get's harder to access monit will check it 2 more times and when it's still getting higher or is over a amount you specified it will restart the process. Not only when it's crashed or not running.

You can automate it with example. Cronjobs and bash scripts. But i think it's nice to have it all under one roof.
 
At this point i only have ROOTFS monitoring.

rootfs monitors the Permission on rootfs, total free space, total inodes

But you can easily add other files for monitoring.
 
Back
Top