This is a text-only version of the following page on https://raymii.org:
---
Title       :   What's coming in the next version of Leaf Node Monitoring?
Author      :   Remy van Elst
Date        :   14-07-2022
URL         :   https://raymii.org/s/blog/Whats_coming_in_leaf_node_monitoring_v2022_02.html
Format      :   Markdown/HTML
---



Leaf Node Monitoring is my own open source (GPLv3), paid, network monitoring program for Windows, Linux & Android. Written in C++ & Qt 5. Perfect to run on your desktop and monitor your servers. Simple setup, auto-detects running services, runs checks concurrently, open port scanning and alerting. I've recently released the first version, and this post goes over the features that will come in the next release.

I did not do any active promotion for the first release, only added a link to
my sponsor message block on this site. That's a bit of text linking to
different ways to sponsor me, which I include on almost all articles on this
site. This article does not include that block, but if you want to check out
[Leaf Node Monitoring, please click here][1]. Although, without that active
promotion, sales have been way above expectation, which I'm surprised by and
also happy about. I also received quite some positive feedback, thanks to all
of you who wrote in.

Now, on to the new features planned for v2022.02.

#### External Process checks

One of the big new features in the next release will be external processes as
monitor checks. Here is a screenshot of two external checks on Android:

![external process checks][5]

You might notice that they're orange, which means warning status. You might
also notice the visual changes, rounded corners and other small tweaks.
External processes are simple checks that are successful (OK) when the exit
code is 0 and critical otherwise. In this case, they're warning because some
errors, like a nonexistent binary, do not trigger critical (since, no exit
code is not the same as exit code > 0).

External processes allow you to have many more checks. For testing the
functionality, I use the checks from Nagios / Icinga, [monitoring plugins][3],
which extend the functionality of Leaf Node Monitoring by a huge amount.
I will still continue to implement new checks in native C++, both for speed
and cross-platform functionality, but this feature will help in all the cases
where there are no checks yet. These monitoring plugins will not be shipped
with Leaf Node Monitoring, it's just the example I'm using.

#### Retry attempts

![retry attempts][6]

The next new feature is retry attempts. For all checks currently, like the TCP
port or HTTP check I'm implementing an automated retry. Currently 4 times,
but I might make that configurable in the future. If a check fails, it will
be retried with the same parameters. No back-off timer or pause in between
yet. I've been running LeafNodeMonitoring myself and have noticed some
notifications which were flaky tests, with the automated retries I hope to
have less of those.

#### Unit tests

The last new thing is that I've begun to add unit tests. For most of my
private projects I don't do unit tests since they're not worth the
time/effort. At work they're required and we have automated checks that
reject merge requests when there is not enough coverage. Unit tests are not
user facing, but they do help in delivering better software. With the growing
amount of checks and logic, I am now of the opinion that Leaf Node Monitoring
benefits from tests. Since I'm used to write code that can be tested
(small methods, decoupled, dependency injected, etc), it does not require any
refactoring, I'm noticing most of the code is already testable just fine.

Here is an example test that checks if the new external process code fires off
the correct signals and returns the correct result when it receives an exit
code of 0:

   TEST_F(ExternalProcessCheckTest, exitCodeZeroShouldGiveOkayResult)
   {
       //arrange
       QString fullPath = "/bin/bash";
       QStringList arguments;
       arguments << "-c 'exit 0'";
       epck = new ExternalProcessCheck(*target, fullPath, arguments, timeout);
       QSignalSpy signalSpy_checkResultChanged(epck, &ExternalProcessCheck::checkResultChanged);

       //act
       emit epck->startCheck();
       signalSpy_checkResultChanged.wait(1000);

       //assert
       EXPECT_EQ(epck->checkResult(), MonitorEnums::CheckResult::Ok);
       EXPECT_EQ(signalSpy_checkResultChanged.count(), 1);
   }

The constructor and destructor of this test suite handle the deletion of the
pointers and further cleanup, so don't worry about the [naked new][4].

It's always hard to test external programs like this, as is testing
time-related stuff (without a lot of stubs/mocks). I'm using the `googletest`
framework since I'm used to it. It requires a bit of shoehorning to make it
works with Qt but once your project is setup correctly it's a breeze to use.
I had to convert the one project to three projects (a library, an application
and a test-app) using SUBDIRS in qmake and linking to the library in the main
application. Not rocket science, but I imagine it can be hard to do if you
don't know what to look for.

Code coverage is now up to 57% so that's a great start.

That's all for this post, I'm not sure when the next version is going to be
released, but it will be a free update for all of you who purchased it. If
you have any feature requests, issues or want to let me know something, don't
hesitate to contact me.


### More on selling GPL software?

I did a series of articles on figuring out how to sell GPL software. Leaf Node
Monitoring is an open source application, but it's paid as well. The parts
are here:

- [Part 1: Selling my own GPL software, part 1: a lot of hurdles](https://raymii.org/s/blog/Selling_GPL_Software_part_1_lots_of_hurdles.html)
- [Part 2: Embed the source code directly in your Qt app with qmake and qrc, for GPL compliance](https://raymii.org/s/articles/Embed_the_source_code_directly_in_your_Qt_app.html)
- [Part 3: Existing GPL software for sale](https://raymii.org/s/blog/Existing_GPL_software_for_sale.html)


This article is [cross-posted][2] on the Leaf Node Monitoring site.

[1]: https://leafnode.nl
[2]: https://www.leafnode.nl/news/whats-coming-in-the-next-version-of-leaf-node-monitoring/
[3]: https://www.monitoring-plugins.org/
[4]: https://stackoverflow.com/questions/9299489/whats-a-naked-pointer
[5]: /s/inc/img/leafnode-2022-02-1.jpg
[6]: /s/inc/img/leafnode-2022-02-2.jpg

---

License:
All the text on this website is free as in freedom unless stated otherwise.
This means you can use it in any way you want, you can copy it, change it
the way you like and republish it, as long as you release the (modified)
content under the same license to give others the same freedoms you've got
and place my name and a link to this site with the article as source.

This site uses Google Analytics for statistics and Google Adwords for
advertisements. You are tracked and Google knows everything about you.
Use an adblocker like ublock-origin if you don't want it.

All the code on this website is licensed under the GNU GPL v3 license
unless already licensed under a license which does not allows this form
of licensing or if another license is stated on that page / in that software:

   This program is free software: you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation, either version 3 of the License, or
   (at your option) any later version.

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with this program.  If not, see <http://www.gnu.org/licenses/>.

Just to be clear, the information on this website is for meant for educational
purposes and you use it at your own risk. I do not take responsibility if you
screw something up. Use common sense, do not 'rm -rf /' as root for example.
If you have any questions then do not hesitate to contact me.

See https://raymii.org/s/static/About.html for details.