<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>monit &amp;mdash; Simple Engineering</title>
    <link>https://getsimple.works/tag:monit</link>
    <description></description>
    <pubDate>Tue, 28 Apr 2026 16:03:42 +0000</pubDate>
    <item>
      <title>How to install monit</title>
      <link>https://getsimple.works/how-to-install-monit?pk_campaign=rss-feed</link>
      <description>&lt;![CDATA[This article revisits essentials on how to install monit monitoring system on production servers.&#xA;&#xA;  This article has complementary materials to the Testing nodejs Applications book. However, the article is designed to help both those who already bought the book, as well as the wide audience of software developers  to setup working environment.  Testing Nodejs Applications Book Cover&#xA;You can grab a copy of this book on this link&#xA;&#xA;There are a plethora of monitoring and logging solutions around the internet. This article will not focus on any of those, rather provide alternatives using tools already available in Linux/UNIX environments, that may achieve near same capabilities as any of those solutions. &#xA;&#xA;In this article you will learn about: &#xA;&#xA;--&#xA;&#xA;Difference between logging and monitoring&#xA;Tools available for logging &#xA;Tools available for monitoring &#xA;How to install monitoring and logging tools &#xA;How to connect end-to-end reporting for faster response times. &#xA;&#xA;Installing monit on Linux &#xA;&#xA;It is always a good idea to update the system before start working. There is no exception, even when a daily task updates automatically binaries. That can be achieved on Ubuntu and Aptitude enabled systems as following:&#xA;&#xA;$ apt-get update # Fetch list of available updates&#xA;$ apt-get upgrade # Upgrades current packages&#xA;$ apt-get dist-upgrade # Installs only new updates&#xA;Example: updating aptitude binaries&#xA;&#xA;At this point most of packages should be installed or upgraded. Except Packages whose PPA have been removed or not available in the registry. Installing software can be done by installing binaries, or using Ubuntu package manager.&#xA;&#xA;Installing a monit on Linux using apt&#xA;Installing monit on macOS &#xA;&#xA;In case homebrew is not already available on your mac, this is how to get one up and running. On its own, homebrew depends on ruby runtime to be available. &#xA;&#xA;  homebrew is a package manager and software installation tool that makes most developer tools installation a breeze. &#xA;&#xA;$ /usr/bin/ruby -e &#34;$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)&#34;&#xA;Example: installation instruction as provided by brew.sh&#xA;&#xA;Generally speaking, this is how to install/uninstall things with brew &#xA;&#xA;$ brew install wget &#xA;$ brew uninstall wget &#xA;Example: installing/uninstalling wget binaries using homebrew&#xA;&#xA;  We have to to stress on the fact that Homebrew installs packages to their own directory and then symlinks their files into /usr/local.&#xA;&#xA;It is always a good idea to update the system before start working. And that, even when we have a daily task that automatically updates the system for us. macOS  can use homebrew package manager on maintenance matters. To update/upgrade or check outdated packages, following commands would help. &#xA;&#xA;$ brew outdated                   # lists all outdated packages&#xA;$ brew cleanup -n                 # visualize the list of things are going to be cleaned up.&#xA;&#xA;$ brew upgrade                    # Upgrades all things on the system&#xA;$ brew update                     # Updates all outdated + brew itself&#xA;$ brew update formula           # Updates one formula&#xA;&#xA;$ brew install formula@version    # Installs formula at a particular version.&#xA;$ brew tap formular@version/brew  # Installs formular from third party repository&#xA;&#xA;untap/re-tap a repo when previous installation failed&#xA;$ brew untap formular &amp;&amp; brew tap formula   &#xA;$ brew services start formular@version&#xA;Example: key commands to work with homebrew cli&#xA;&#xA;  For more informations, visit: Homebrew ~ FAQ.&#xA;&#xA;Installing a monit on a macOS  using homebrew&#xA;&#xA;It is hard to deny the supremacy of monit on NIX systems, and that doesn&#39;t exclude macOS systems. Installation of monit on macOS using homebrew aligns with homebrew installation guidelines. From above templates, the next example displays how easy it is to have monit up and running. &#xA;&#xA;$ brew install monit        # Installation of latest monit&#xA;$ brew services start monit # Starting latest monit as a service &#xA;Example: installing monit using homebrew&#xA;&#xA;Installing monit on a Windows machine&#xA;&#xA;Whereas macOS  systems and Linux are quite relax when it comes to interacting with processes, Windows is a beast on its own way. monit was built for nix systems but  there is no equivalent on Windows systems: Service Control Manager. It basically has the same ability to check and restart processes that are failing. &#xA;&#xA;Automated upgrades &#xA;&#xA;Following the SemVer ~ aka Semantic Versioning standard, it is not recommended to consider minor/major versions for automated upgrades. One of the reasons being that these versions are subject to introducing breaking changes or incompatibility between two versions.  On the other hand, patches are less susceptible to introduce breaking changes, whence ideal candidates for automated upgrades. Another among other reasons, being that security fixes are released as patches to a minor version.  &#xA;&#xA;In case of a critical infrastructure piece that is monitoring, we expect breaking changes when a new version introduces a configuration setting is added, or dropped between two successive versions. Monit is a well thought software that provides backward compatibility, so chances for breaking changes between two minor versions is really minimal.  &#xA;&#xA;  We should highlight that it is always better to upgrade at deployment time. The process is even easier in containerized context. We should also automate only patches, to avoid to miss security patches. &#xA;&#xA;In the context of Linux, we will use the unattended-upgrades package to do the work. &#xA;&#xA;$ apt-get install unattended-upgrades apticron&#xA;Example: install unattended-upgrades&#xA;&#xA;Two things to fine-tune to make this solution work are: to enable a blacklist of packages we do not to automatically update, and two, to enable particular packages we would love to update on a periodical basis. That is compiled in the following shell scripts.&#xA;&#xA;Unattended-Upgrade::Allowed-Origins {&#xA;//  &#34;${distroid}:${distrocodename}&#34;;&#xA;    &#34;${distroid}:${distrocodename}-security&#34;; # upgrading security patches only &#xA;//   &#34;${distroid}:${distrocodename}-updates&#34;;  &#xA;//  &#34;${distroid}:${distrocodename}-proposed&#34;;&#xA;//  &#34;${distroid}:${distrocodename}-backports&#34;;&#xA;};&#xA;&#xA;Unattended-Upgrade::Package-Blacklist {&#xA;    &#34;vim&#34;;&#xA;};&#xA;Example: fine-tune the blacklist and whitelist in /etc/apt/apt.conf.d/50unattended-upgrades&#xA;&#xA;The next step is necessary to make sure  unattended-upgrades download, install and cleanups tasks have a default period: once, twice a day or a week. &#xA;&#xA;APT::Periodic::Update-Package-Lists &#34;1&#34;;            # Updates package list once a day&#xA;APT::Periodic::Download-Upgradeable-Packages &#34;1&#34;;   # download upgrade candidates once a day&#xA;APT::Periodic::AutocleanInterval &#34;7&#34;;               # clean week worth of unused packages once a week&#xA;APT::Periodic::Unattended-Upgrade &#34;1&#34;;              # install downloaded packages once a day&#xA;Example: tuning the tasks parameter /etc/apt/apt.conf.d/20auto-upgrades&#xA;&#xA;This approach works on Linux(Ubuntu), especially deployed in production, but not Windows nor macOS. The last issue, is to be able to report problems when an update fails, so that a human can intervene whenever possible. That is where the second tool apticron in first paragraph intervenes. To make it work, we will specify which email to send messages to, and that will be all. &#xA;&#xA;EMAIL=&#34;email@host.tld&#34;&#xA;Example: tuning reporting tasks email parameter /etc/apticron/apticron.conf&#xA;&#xA;Conclusion&#xA;&#xA;In this article we revisited ways to install monit on various platforms. Even though configuration was beyond the scope of this article, we managed to get everyday quick refreshers out.&#xA;&#xA;Reading list and References&#xA;&#xA;upstart tutorial&#xA;Uptime&#xA;An A-Z Index of the Apple macOS command line (macOS bash) and the Apple macOS How-to guides and examples&#xA; Configuring nodejs applications&#xA;&#xA;#nodejs #homebrew #UnattendedUpgrades #monit #y2020 ,#Jan2020 #HowTo #ConfiguringNodejsApplications #tdd #TestingNodejsApplications]]&gt;</description>
      <content:encoded><![CDATA[<p>This article revisits essentials on how to install <code>monit</code> monitoring system on production servers.</p>

<blockquote><p>This article has complementary materials to the <strong><em><a href="http://bit.ly/2ZFJytb">Testing <code>nodejs</code> Applications book</a></em></strong>. However, the article is designed to help both those who already bought the book, as well as the wide audience of software developers  to setup working environment.  <a href="http://bit.ly/2ZFJytb"><img src="https://snap.as/a/42OS2vs.png" alt="Testing Nodejs Applications Book Cover"/></a>
<strong><em><a href="http://bit.ly/2ZFJytb">You can grab a copy of this book on this link</a></em></strong></p></blockquote>

<p>There are a plethora of monitoring and logging solutions around the internet. This article will not focus on any of those, rather provide alternatives using tools already available in Linux/UNIX environments, that may achieve near same capabilities as any of those solutions.</p>

<p><strong>In this article you will learn about:</strong></p>

<p><strong>—</strong></p>
<ul><li>Difference between logging and monitoring</li>
<li>Tools available for logging</li>
<li>Tools available for monitoring</li>
<li>How to install monitoring and logging tools</li>
<li>How to connect end-to-end reporting for faster response times.</li></ul>

<h2 id="installing-monit-on-linux" id="installing-monit-on-linux">Installing <code>monit</code> on Linux</h2>

<p>It is always a good idea to update the system before start working. There is no exception, even when a daily task updates automatically binaries. That can be achieved on Ubuntu and Aptitude enabled systems as following:</p>

<pre><code class="language-shell">$ apt-get update # Fetch list of available updates
$ apt-get upgrade # Upgrades current packages
$ apt-get dist-upgrade # Installs only new updates
</code></pre>

<p><em><em>Example</em>: updating aptitude binaries</em></p>

<p>At this point most of packages should be installed or upgraded. Except Packages whose PPA have been removed or not available in the registry. Installing software can be done by installing binaries, or using Ubuntu package manager.</p>

<h3 id="installing-a-monit-on-linux-using-apt" id="installing-a-monit-on-linux-using-apt">Installing a <code>monit</code> on Linux using <code>apt</code></h3>

<h2 id="installing-monit-on-macos" id="installing-monit-on-macos">Installing <code>monit</code> on macOS</h2>

<p>In case <code>homebrew</code> is not already available on your mac, this is how to get one up and running. On its own, <code>homebrew</code> depends on ruby runtime to be available.</p>

<blockquote><p><code>homebrew</code> is a package manager and software installation tool that makes most developer tools installation a breeze.</p></blockquote>

<pre><code class="language-shell">$ /usr/bin/ruby -e &#34;$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)&#34;
</code></pre>

<p><em><em>Example:</em> installation instruction as provided by <a href="https://brew.sh/">brew.sh</a></em></p>

<p>Generally speaking, this is how to install/uninstall things with <code>brew</code></p>

<pre><code class="language-shell">$ brew install wget 
$ brew uninstall wget 
</code></pre>

<p><em><em>Example</em>: installing/uninstalling <code>wget</code> binaries using homebrew</em></p>

<blockquote><p>We have to to stress on the fact that <a href="https://brew.sh/">Homebrew</a> installs packages to their own directory and then symlinks their files into <code>/usr/local</code>.</p></blockquote>

<p>It is always a good idea to update the system before start working. And that, even when we have a daily task that automatically updates the system for us. macOS  can use <code>homebrew</code> package manager on maintenance matters. To update/upgrade or check outdated packages, following commands would help.</p>

<pre><code class="language-shell">$ brew outdated                   # lists all outdated packages
$ brew cleanup -n                 # visualize the list of things are going to be cleaned up.

$ brew upgrade                    # Upgrades all things on the system
$ brew update                     # Updates all outdated + brew itself
$ brew update &lt;formula&gt;           # Updates one formula

$ brew install &lt;formula@version&gt;    # Installs &lt;formula&gt; at a particular version.
$ brew tap &lt;formular@version&gt;/brew  # Installs &lt;formular&gt; from third party repository

# untap/re-tap a repo when previous installation failed
$ brew untap &lt;formular&gt; &amp;&amp; brew tap &lt;formula&gt;   
$ brew services start &lt;formular&gt;@&lt;version&gt;
</code></pre>

<p><em><em>Example</em>: key commands to work with <code>homebrew</code> cli</em></p>

<blockquote><p>For more informations, visit: <a href="https://docs.brew.sh/FAQ">Homebrew ~ FAQ</a>.</p></blockquote>

<h3 id="installing-a-monit-on-a-macos-using-homebrew" id="installing-a-monit-on-a-macos-using-homebrew">Installing a <code>monit</code> on a macOS  using <code>homebrew</code></h3>

<p>It is hard to deny the supremacy of <code>monit</code> on *NIX systems, and that doesn&#39;t exclude macOS systems. Installation of <code>monit</code> on macOS using <code>homebrew</code> aligns with <code>homebrew</code> installation guidelines. From above templates, the next example displays how easy it is to have <code>monit</code> up and running.</p>

<pre><code class="language-shell">$ brew install monit        # Installation of latest monit
$ brew services start monit # Starting latest monit as a service 
</code></pre>

<p><em><em>Example</em>: installing <code>monit</code> using <code>homebrew</code></em></p>

<h2 id="installing-monit-on-a-windows-machine" id="installing-monit-on-a-windows-machine">Installing <code>monit</code> on a Windows machine</h2>

<p>Whereas macOS  systems and Linux are quite relax when it comes to interacting with processes, Windows is a beast on its own way. <code>monit</code> was built for <code>*nix</code> systems but  there is no equivalent on Windows systems: Service Control Manager. It basically has the same ability to check and restart processes that are failing.</p>

<h2 id="automated-upgrades" id="automated-upgrades">Automated upgrades</h2>

<p>Following the <a href="https://semver.org/">SemVer ~ <em>aka Semantic Versioning</em></a> standard, it is not recommended to consider <strong><em>minor</em></strong>/<strong><em>major</em></strong> versions for automated upgrades. One of the reasons being that these versions are subject to introducing breaking changes or incompatibility between two versions.  On the other hand, patches are less susceptible to introduce breaking changes, whence ideal candidates for automated upgrades. Another among other reasons, being that security fixes are released as patches to a minor version.</p>

<p>In case of a critical infrastructure piece that is monitoring, we expect breaking changes when a new version introduces a configuration setting is added, or dropped between two successive versions. Monit is a well thought software that provides backward compatibility, so chances for breaking changes between two minor versions is really minimal.</p>

<blockquote><p>We should highlight that it is always better to upgrade at deployment time. The process is even easier in containerized context. We should also automate only patches, to avoid to miss security patches.</p></blockquote>

<p>In the context of Linux, we will use the <strong><em>unattended-upgrades</em></strong> package to do the work.</p>

<pre><code class="language-shell">$ apt-get install unattended-upgrades apticron
</code></pre>

<p><em><em>Example</em>: install unattended-upgrades</em></p>

<p>Two things to fine-tune to make this solution work are: to enable a blacklist of packages we do not to automatically update, and two, to enable particular packages we would love to update on a periodical basis. That is compiled in the following shell scripts.</p>

<pre><code class="language-shell">Unattended-Upgrade::Allowed-Origins {
//  &#34;${distro_id}:${distro_codename}&#34;;
    &#34;${distro_id}:${distro_codename}-security&#34;; # upgrading security patches only 
//   &#34;${distro_id}:${distro_codename}-updates&#34;;  
//  &#34;${distro_id}:${distro_codename}-proposed&#34;;
//  &#34;${distro_id}:${distro_codename}-backports&#34;;
};

Unattended-Upgrade::Package-Blacklist {
    &#34;vim&#34;;
};
</code></pre>

<p><em><em>Example</em>: fine-tune the blacklist and whitelist in <code>/etc/apt/apt.conf.d/50unattended-upgrades</code></em></p>

<p>The next step is necessary to make sure  <strong><em>unattended-upgrades</em></strong> download, install and cleanups tasks have a default period: once, twice a day or a week.</p>

<pre><code class="language-shell">APT::Periodic::Update-Package-Lists &#34;1&#34;;            # Updates package list once a day
APT::Periodic::Download-Upgradeable-Packages &#34;1&#34;;   # download upgrade candidates once a day
APT::Periodic::AutocleanInterval &#34;7&#34;;               # clean week worth of unused packages once a week
APT::Periodic::Unattended-Upgrade &#34;1&#34;;              # install downloaded packages once a day
</code></pre>

<p><em><em>Example</em>: tuning the tasks parameter <code>/etc/apt/apt.conf.d/20auto-upgrades</code></em></p>

<p>This approach works on Linux(Ubuntu), especially deployed in production, but not Windows nor macOS. The last issue, is to be able to report problems when an update fails, so that a human can intervene whenever possible. That is where the second tool <code>apticron</code> in first paragraph intervenes. To make it work, we will specify which email to send messages to, and that will be all.</p>

<pre><code class="language-shell">EMAIL=&#34;&lt;email&gt;@&lt;host.tld&gt;&#34;
</code></pre>

<p><em><em>Example</em>: tuning reporting tasks email parameter <code>/etc/apticron/apticron.conf</code></em></p>

<h2 id="conclusion" id="conclusion">Conclusion</h2>

<p>In this article we revisited ways to install <code>monit</code> on various platforms. Even though <strong><em><a href="https://getsimple.works/how-to-configure-nodejs-applications#configure-monit-to-monitor-nodejs-application">configuration was beyond the scope of this article</a></em></strong>, we managed to get everyday quick refreshers out.</p>

<h2 id="reading-list-and-references" id="reading-list-and-references">Reading list and References</h2>
<ul><li><a href="http://howtonode.org/deploying-node-upstart-monit">upstart tutorial</a></li>
<li><a href="https://github.com/fzaninotto/uptime">Uptime</a></li>
<li><em><a href="https://ss64.com/osx/">An A-Z Index of the Apple macOS command line (macOS bash)</a></em> and the <em><a href="https://ss64.com/osx/syntax.html">Apple macOS How-to guides and examples</a></em>
<ul><li><a href="https://getsimple.works/how-to-configure-nodejs-applications">Configuring <code>nodejs</code> applications</a></li></ul></li></ul>

<p><a href="https://getsimple.works/tag:nodejs" class="hashtag"><span>#</span><span class="p-category">nodejs</span></a> <a href="https://getsimple.works/tag:homebrew" class="hashtag"><span>#</span><span class="p-category">homebrew</span></a> <a href="https://getsimple.works/tag:UnattendedUpgrades" class="hashtag"><span>#</span><span class="p-category">UnattendedUpgrades</span></a> <a href="https://getsimple.works/tag:monit" class="hashtag"><span>#</span><span class="p-category">monit</span></a> <a href="https://getsimple.works/tag:y2020" class="hashtag"><span>#</span><span class="p-category">y2020</span></a> ,<a href="https://getsimple.works/tag:Jan2020" class="hashtag"><span>#</span><span class="p-category">Jan2020</span></a> <a href="https://getsimple.works/tag:HowTo" class="hashtag"><span>#</span><span class="p-category">HowTo</span></a> <a href="https://getsimple.works/tag:ConfiguringNodejsApplications" class="hashtag"><span>#</span><span class="p-category">ConfiguringNodejsApplications</span></a> <a href="https://getsimple.works/tag:tdd" class="hashtag"><span>#</span><span class="p-category">tdd</span></a> <a href="https://getsimple.works/tag:TestingNodejsApplications" class="hashtag"><span>#</span><span class="p-category">TestingNodejsApplications</span></a></p>
]]></content:encoded>
      <guid>https://getsimple.works/how-to-install-monit</guid>
      <pubDate>Fri, 31 Jan 2020 22:49:49 +0000</pubDate>
    </item>
  </channel>
</rss>