Monit

Discussion in 'Installation/Configuration' started by Pyanepsion, Sep 11, 2019.

  1. Pyanepsion

    Pyanepsion Member

    Hello,
    I asked an ISPConfig specialist to install Munin and Monit. Unfortunately, he used a simple script without even checking the proper functioning of the installation. Munim is correctly installed, but not Monit.
    Monit does not appear in the ISPConfig menu.
    monit-01.jpg monit-02.jpg
    The setting is the same as for Munim in System/Server config/Server.
    monit-02.jpg
    /etc/monit/monitrc on the other hand indicates a port 2812.
    Code:
    set daemon 60
    set logfile syslog facility log_daemon
    set mailserver localhost
    set mail-format { from: [email protected] }
    set alert [email protected]
    set httpd port 2812 and
     SSL ENABLE
     PEMFILE /var/certs/monit.pem
     allow admin:howtoforge
    
    check process sshd with pidfile /var/run/sshd.pid
     start program "/usr/sbin/service ssh start"
     stop program "/usr/sbin/service ssh stop"
     if failed port 22 protocol ssh then restart
     if 5 restarts within 5 cycles then timeout
    
    check process apache with pidfile /var/run/apache2/apache2.pid
     group www
     start program = "/usr/sbin/service apache2 start"
     stop program = "/usr/sbin/service apache2 stop"
     if failed host localhost port 80 protocol http
     and request "/monit/token" then restart
     if cpu is greater than 60% for 2 cycles then alert
     if cpu > 80% for 5 cycles then restart
     if totalmem > 500 MB for 5 cycles then restart
     if children > 250 then restart
     if loadavg(5min) greater than 10 for 8 cycles then stop
     if 3 restarts within 5 cycles then timeout
    In command line, it seems Monit seems very present.
    How to fix the provider's inadequacies to see Monit in the ISPConfig menu? Thank you for your help.
     
    Last edited: Sep 11, 2019
  2. Jesse Norell

    Jesse Norell Well-Known Member

    More accurately, the option to display Monit does show in the ISPConfig menu; it appears that the monit url in your server config does not work, which is the real issue. As for why, you'd need to check your nginx config.
     
    Pyanepsion likes this.
  3. Pyanepsion

    Pyanepsion Member

    What should I watch?
     
  4. nhybgtvfr

    nhybgtvfr Active Member

    Pyanepsion and ahrasis like this.
  5. ahrasis

    ahrasis Well-Known Member

    I thought that was a known but unfixed issue and is not anybody's fault. You may want to check the forum for related discussions. I find it kinda hard to search using my mobile phone. :cool:

    Edited: @nhybgtvfr could be right though.
     
    Pyanepsion likes this.
  6. Pyanepsion

    Pyanepsion Member

    :)Thank you to all of you. It seems that the provider used the tutorial of Debian 8.
    There were many mistakes.
    According to the file /etc/monit/monitrc it was necessary to indicate the user admin and the password howtoforge. The path should be: https://[SERVERNAME]:2812
    Of course, it was also necessary to restart Monit.
    Here is the result.
    monit-03.jpg
    systemctl list 131 services. What are the interesting services to add?
     
    Last edited: Sep 11, 2019
    ahrasis likes this.
  7. nhybgtvfr

    nhybgtvfr Active Member

    well, the obvious start points for monitoring:
    cpu load
    memory usage
    disk space

    then depending on what your using:

    apache/nginx
    mysql
    amavisd-new/rspamd
    postfix
    dovecot/courier
    redis/memcached
    php#
    php#-fpm
    pureftpd
    ntpd ( a lot of people won't consider this necessary, but in a multi-server environment, it's very helpful to be confident that all the timestamps across all the servers match up correctly )

    i'm sure other people will supply a few more services to keep an eye on. the important thing is to watch the services you rely on.
    don't just monitor everything you can just because you can, you'll get fed up with unnecessary alerts and start ignoring them, then an important alert will come through.....
     
    ahrasis and Pyanepsion like this.
  8. nhybgtvfr

    nhybgtvfr Active Member

    one other thing, in your monitrc file ( and the ispconfig server config page ), if you haven't already, change the admin username and password for monit.
    you don't want to leave the defaults there, especially if the port is accessible externally. having some stranger restart ( or even worse, unmonitor then stop ) random services can really ruin your day....
     

Share This Page