Skip to content
Browse files

Compile monit from source

  • Loading branch information...
NEMS Linux
NEMS Linux committed Jun 30, 2019
1 parent 8b1719d commit 953861766471dc0b4762e8cda92b8e7fc5380770
Showing with 46 additions and 15 deletions.
  1. +46 −15 build/175-monit
@@ -1,18 +1,49 @@

# Version to install corresponding to the tar.gz file from their

# stop it if it is already running from a previous apt task
systemctl stop monit.service

echo $0 > /var/www/html/userfiles/nems-build.cur

# Fix the cert bug in 5.20
# It seems this has been patched upstream, so can comment this out - but leaving until confirmed
#apt -y install automake
#cd /tmp
#mkdir patch-monit
#cd patch-monit
#tar -xzf master.tar.gz
#cd tildeslash*

cp -f /root/nems/nems-migrator/data/1.4/monit/conf.d/nems.conf /etc/monit/conf.d/
systemctl restart monit
yes | apt install libssl-dev libpam0g-dev gcc make

tmpdir=`mktemp -d -p /tmp/`
wget -O $tmpdir/monit.tar.gz$ver.tar.gz
cd $tmpdir
tar xvzf monit.tar.gz
cd monit-$ver
./configure --prefix=/usr/local/bin --bindir=/usr/local/bin --sysconfdir=/etc/monit/
make && make install &&

echo "[Unit]
Description=Pro-active monitoring utility for unix systems
ExecStart=/usr/local/bin/monit -I
ExecStop=/usr/local/bin/monit quit
ExecReload=/usr/local/bin/monit reload
Restart = on-abnormal
[Install]" > /lib/systemd/system/monit.service

cp -Rf /root/nems/nems-migrator/data/1.4/monit /etc/
chmod 600 /etc/monit/monitrc
# Don't need this folder, but makes it backward compatible with 1.4 confs
if [[ ! -d /etc/monit/conf-enabled ]]; then
mkdir -p /etc/monit/conf-enabled
if [[ ! -d /var/lib/monit ]]; then
mkdir -m 0750 -p /var/lib/monit

systemctl enable monit.service
systemctl start monit.service

0 comments on commit 9538617

Please sign in to comment.
You can’t perform that action at this time.