1

I did sudo apt-get install monit but it only installs version 5.9 and the current version is 5.17.1. So I did wget https://mmonit.com/monit/dist/binary/5.17.1/monit-5.17.1-linux-x64.tar.gz to download the precompiled binaries and now I have these files:

monit-5.17.1/bin/monit
monit-5.17.1/conf/monitrc
monit-5.17.1/man/man1/monit.1

I checked where MONIT is installed with dpkg -S monit | sort:

monit: /etc/default/monit
monit: /etc/init.d/monit
monit: /etc/logrotate.d/monit
monit: /etc/monit
monit: /etc/monit/conf.d
monit: /etc/monit/monitrc
monit: /etc/monit/monitrc.d
monit: /etc/monit/monitrc.d/acpid
monit: /etc/monit/monitrc.d/apache2
monit: /etc/monit/monitrc.d/at
monit: /etc/monit/monitrc.d/cron
monit: /etc/monit/monitrc.d/mdadm
monit: /etc/monit/monitrc.d/memcached
monit: /etc/monit/monitrc.d/mysql
monit: /etc/monit/monitrc.d/nginx
monit: /etc/monit/monitrc.d/openntpd
monit: /etc/monit/monitrc.d/openssh-server
monit: /etc/monit/monitrc.d/pdns-recursor
monit: /etc/monit/monitrc.d/postfix
monit: /etc/monit/monitrc.d/rsyslog
monit: /etc/monit/monitrc.d/smartmontools
monit: /etc/monit/monitrc.d/snmpd
monit: /etc/monit/templates
monit: /etc/monit/templates/rootbin
monit: /etc/monit/templates/rootrc
monit: /etc/monit/templates/rootstrict
monit: /etc/pam.d/monit
monit: /usr/bin/monit
monit: /usr/share/bug/monit
monit: /usr/share/doc/monit
monit: /usr/share/doc/monit/changelog.Debian.gz
monit: /usr/share/doc/monit/CONTRIBUTORS
monit: /usr/share/doc/monit/copyright
monit: /usr/share/doc/monit/examples
monit: /usr/share/doc/monit/examples/monit.service
monit: /usr/share/doc/monit/examples/monit.upstart
monit: /usr/share/doc/monit/NEWS.Debian.gz
monit: /usr/share/doc/monit/README.Debian
monit: /usr/share/doc/monit/README.gz
monit: /usr/share/lintian/overrides/monit
monit: /usr/share/man/man1/monit.1.gz
monit: /var/lib/monit
monit: /var/lib/monit/events

I know how to handle the conf-file monitrc but I don't know in which paths I have to replace the file monit (only at /usr/bin/monit or somewhere else?) and if this the correct way to upgrade at all.

John Doof
  • 169
  • 3
  • 9

3 Answers3

2

You should almost never try mixing and matching a package installed via apt with packages you manually install form a tar.gz or some other 3rd party package format.

Debian basically freezes it he version of packages when it releases, and will not release any new versions. Security, and critical bugs will be backported as needed, but mostly the version of the package you get at release is stable and will be that same version of the package for the life of that release.

If you want to use a 3rd party package, first you should uninstall the Debian version of the package. Then install the 3rd party package. Then you will have to figure out how to integrate it as far as startup scripts, log rotation, etc. Almost none of this happens automatically for 3rd party stuff. You also need to come up with an upgrade plan to monitor the package for security issues.

You could also try and backport the package, but that is also a lot of work, and you must maintain any security updates yourself.

Anyway, when it comes to Debian 99% of the time, you will want to avoid trying to use the latest/greatest and just stick with the released version.

Zoredache
  • 128,755
  • 40
  • 271
  • 413
  • Ok, that's not what I expectet. Well, there are some bugfixes since 5.9 so I thought it would be great to have the up to date version. But I already tried to install it by compiling the source code, which worked, but I failed on getting MONIT running. I also didn't find any usable tutorial which explains how to install MONIT from scratch (compiled). – John Doof Mar 29 '16 at 20:48
  • Well the instructions (in the script form) would be part of the Debian source package for monit. You could see exactly what is being done to build the binary packages. – Zoredache Mar 29 '16 at 20:50
  • I would, too, really like to update to [5.14 or newer](https://mmonit.com/monit/changes/) since one of the last warnings I keep getting from MariaDB is monit connecting anonymously to MySQL/MariaDB. In 5.9 you can't specify username/password (monit will refuse to start). But I'm very reluctant to resort to 3rd party packages / solutions exactly because of the above given anwer; I don't want to create a [frankendebian](https://wiki.debian.org/DontBreakDebian#Don.27t_make_a_FrankenDebian) situation. – RobIII May 18 '16 at 13:57
1

I did create a hybrid installation since I really needed the new version. Still I tried to separate the two installs:

wget https://mmonit.com/monit/dist/binary/5.22.0/monit-5.22.0-linux-x64.tar.gz
tar zxvf monit-5.22.0-linux-x64.tar.gz
sudo cp -a monit-5.22.0 /usr/local/

cd /usr/bin/
sudo mv monit monit.bak
sudo ln -s /usr/local/monit-5.22.0/bin/monit

cd /usr/share/man/man1/
sudo mv monit.1 monit.1.bak
sudo mv monit.1.gz monit.1.gz.bak
sudo ln -s /usr/local/monit-5.22.0/man/man1/monit.1
Karl Forner
  • 111
  • 3
0

On Ubuntu what I usually do is to the get the .deb file from a newer release and install it with

dpkg -i updated-monit.deb

Like http://packages.ubuntu.com/trusty/admin/monit or http://packages.ubuntu.com/xenial/admin/monit

Be aware this method is not handling dependencies as apt/aptitude would do. Also at some version of monit, dependency to libssl was updated and it could not work with your current version.

user1623521
  • 348
  • 1
  • 3
  • 13
DevOps
  • 720
  • 3
  • 15