Monit does not work

Discussion in 'Linux Beginners' started by pecka33, Mar 31, 2022.

  1. pecka33

    pecka33 Member

    Hello,

    i did install Munit via this tutorial https://www.howtoforge.com/tutorial/how-to-install-and-configure-monit-on-debian-9/

    I end with step 4. IP of my server is myip, for example to ispconfig i access via https://myip:8080/index.php But after i install munit, i tried to go to https://myip:2812, but does not work for me. http://192.168.0.227:2812/ does not work too.

    Just get ERR_CONNECTION_TIMED_OUT

    But munit running, i tried it via
    Code:
    [email protected]:~# netstat -ant | grep :2812
    tcp        0      0 0.0.0.0:2812            0.0.0.0:*               LISTEN
    tcp6       0      0 :::2812                 :::*                    LISTEN
    [email protected]:~# monit status
    Monit 5.27.2 uptime: 0m
    
    Code:
    [email protected]:~# monit status
    Monit 5.27.2 uptime: 0m
    
    System 'host.myserver.cz'
      status                       OK
      monitoring status            Monitored
      monitoring mode              active
      on reboot                    start
      load average                 [0.01] [0.02] [0.00]
      cpu                          0.0%usr 0.0%sys 0.0%nice 0.0%iowait 0.0%hardirq 0.0%softirq 0.0%steal 0.0%guest 0.0%guestnice
      memory usage                 3.8 GB [12.3%]
      swap usage                   0 B [0.0%]
      uptime                       4h 29m
      boot time                    Thu, 31 Mar 2022 11:08:43
      filedescriptors              7264 [0.0% of 9223372036854775807 limit]
      data collected               Thu, 31 Mar 2022 15:37:36
    
    Any idea please?
     
  2. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    Are you trying to use httpS in url? Try with plain http:// unless you really have made certificate for munin.
     
  3. pecka33

    pecka33 Member

    Yes, i tried it with https and without it, but nothing works. Just timed out error.
     
  4. pecka33

    pecka33 Member

    I have another question. I tried to remove monit apt-get remove monit
    Monit was installed, did reboot of server but in my services i can still monit active. Why? I used
    systemctl status monit and there is monit active, but i remove in via command i wrote. Why? Any idea?
     
  5. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    What show commands
    Code:
    dpkg --list | grep -i monit
    apt policy monit
    cat /etc/debian_version 
    
    My guess is problem is caused by monit being a virtual package, so installing monit caused installation of some other packages which are the real monit.
     
  6. braithock

    braithock New Member

    I have the same problem and feel completely overwhelmed with linux.
     
  7. ahrasis

    ahrasis Well-Known Member HowtoForge Supporter

    The latest tutorial on how to install and configure monit is this one I think (https://www.howtoforge.com/tutorial/server-monitoring-with-munin-and-monit-on-debian/amp/) so other might be older.

    However, installing it on ISPConfig I think might require one to run ISPConfig force update, reconfiguring services, etc.

    I not sure whether one need to choose to create ssl during that update process since ispserver.pem may be used in monit and if so it definitely need to be set in the monitrc (ssl header part).

    Lastly I am using ISPConfig to view monit status but many seemed to fail in doing so based on some threads including some latest one this year, so viewing it directly in the set port should work if monit is set correctly.

    Just make sure that port is open which means if one is using ISPConfig, add it using its GUI, and if not, one need to open it manually.

    One may also need to port forward to that port if you are behind a nat router that requires as such.
     
  8. pecka33

    pecka33 Member

    Thank you. I used this command and get
    Code:
    >
    [email protected]:~# dpkg --list | grep -i monit
    apt policy monit
    cat /etc/debian_version
    rc  monit                              1:5.27.2-1                                                                 amd64        utility for monitoring and managing daemons or similar programs
    monit:
      Installed: (none)
      Candidate: 1:5.27.2-1
      Version table:
         1:5.27.2-1 500
            500 http://deb.debian.org/debian bullseye/main amd64 Packages
            500 http://httpredir.debian.org/debian stable/main amd64 Packages
            100 /var/lib/dpkg/status
    11.3
    
    I am not sure what should i do to completely remove monit. Any idea please which package or files? I deleted completely folder with monit in etc/ after i did remvoe of monit via command.
     
    Last edited: Apr 1, 2022
  9. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    You should not have done that.
    The output in #8 would be easier to read if you had issued the commands one at a time.
    dpkg --list seem to say monit is removed but configured. apt policy says no version of monit is installed.
    Remove this line from you apt configurations:
    Code:
    http://httpredir.debian.org/debian stable/main amd64 Packages
    It refers to stable distribution, that confuses your system when next debian release comes.
    Purge may not work anymore after you removed the files from /etc, but try anyway:
    Code:
    apt purge monit
    
    apt autoremove
     
  10. pecka33

    pecka33 Member

    Thank you. I back monit from backup to etc folder and tried your command to remove it. I get

    Code:
    [email protected]:~# apt purge monit
    
    apt autoremove
    Reading package lists... Done
    Building dependency tree... Done
    Reading state information... Done
    The following packages will be REMOVED:
      monit*
    0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
    After this operation, 0 B of additional disk space will be used.
    Do you want to continue? [Y/n] Y
    (Reading database ... 65650 files and directories currently installed.)
    Purging configuration files for monit (1:5.27.2-1) ...
    dpkg: warning: while removing monit, directory '/etc/monit/conf-enabled' not empty so not removed
    Reading package lists... Done
    Building dependency tree... Done
    Reading state information... Done
    0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
    
    When i tried it again get
    Code:
    [email protected]:~# apt purge monit
    Reading package lists... Done
    Building dependency tree... Done
    Reading state information... Done
    Package 'monit' is not installed, so not removed
    0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
    
    I check it with
    Code:
    service --status-all
    
    and monit is not here as before. But seems still active

    Code:
    [email protected]:~# systemctl status monit
    ● monit.service
         Loaded: not-found (Reason: Unit monit.service not found.)
         Active: active (exited) since Thu 2022-03-31 16:30:43 CEST; 16h ago
            CPU: 0
         CGroup: /monit.service
    
    Mar 31 16:30:43 host.xx.cz systemd[1]: Starting LSB: service and resou>
    Mar 31 16:30:43 host.xx.cz systemd[1]: Started LSB: service and resour>
    To your second reply, in my source list a can not see
    Code:
    http://httpredir.debian.org/debian stable/main amd64 Packages
    
    I got there
    Code:
    #
    
    # deb cdrom:[Debian GNU/Linux 8.0.0 _Jessie_ - Official amd64 NETINST Binary-1 20150425-12:50]/ buster main contrib non-free
    
    # deb cdrom:[Debian GNU/Linux 8.0.0 _Jessie_ - Official amd64 NETINST Binary-1 20150425-12:50]/ buster main contrib non-free
    
    # deb http://ftp.cz.debian.org/debian/ buster main contrib non-free
    # deb-src http://ftp.cz.debian.org/debian/ buster main contrib non-free
    
    # deb http://security.debian.org/ buster/updates main contrib non-free
    # deb-src http://security.debian.org/ buster/updates main contrib non-free
    
    # stretch-updates, previously known as 'volatile'
    # deb http://ftp.cz.debian.org/debian/ buster-updates main contrib non-free
    # deb-src http://ftp.cz.debian.org/debian/ buster-updates main contrib non-free
    
    # stretch-backports, previously on backports.debian.org
    # deb http://http.debian.net/debian/ buster-backports main contrib non-free
    # deb-src http://http.debian.net/debian/ buster-backports main contrib non-free
    
    deb http://deb.debian.org/debian bullseye main contrib non-free
    deb-src http://deb.debian.org/debian bullseye main contrib non-free
    
    deb http://deb.debian.org/debian-security/ bullseye-security main contrib non-free
    deb-src http://deb.debian.org/debian-security/ bullseye-security main contrib non-free
    
    deb http://deb.debian.org/debian bullseye-updates main contrib non-free
    deb-src http://deb.debian.org/debian bullseye-updates main contrib non-free
    
    deb http://httpredir.debian.org/debian stable main contrib
    
     
  11. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    Can you not issue commands one at a time? Do not copy and paste the whole code block at once. Copy and paste one line at a time.
    Remove the last line from the file, it has the stable distribution mentioned.
    To turn of monit, do
    Code:
    systemctl stop monit
    Then do
    Code:
    systemctl disable monit
     
  12. pecka33

    pecka33 Member

    Thank you so much. I am sorry, i will do it in the future.
    I did it and monit looks disable. I hope that this solved it. But i am not sure about remove line you wrote. Can i do it? Not sure if i get after did all stable and security updates.
     

Share This Page