Generic server monitoring with Monitis & M3

Had I been told to monitor a cat chasing a mouse with Monitis, my answer would have been – “Yes, it’s probably possible”.
With the not-so-recent addition of M3 to the arsenal of monitoring tools Monitis can utilize, it is possible to monitor anything. However this alone is far from being enough. Smart implementations of proper applicative monitoring is what should be practiced.
Unleashing the power of M3 & timers

During the lifespan of M3 (Monitis Monitor Manager) there has always been something lacking – timers.
M3 execution procedure was outlined in this previous article.
The execution mentioned in the latter was a one-time-execution, whereas server monitoring requires periodic invocation of monitors in order to actually provide counters over time, graphing performance.
The periodic invocation method suggested up until today was to integrate M3 with crontab.
Crontab, in a nutshell, is a Linux/Unix service for periodic invocation of executables. Implementing M3 with crontab properly meant M3 would run every X minutes, producing a Monitis counter update every X minutes, should everything run properly.
In the following article I’ll outline the changes done to support timers in M3.

Pluggable M3 (Monitis Monitor Manager) Framework
Who needs an introduction about M3? – Perhaps no one!
After gaining some reputation with M3, providing extra-easy integration of any monitor into Monitis it was time to take it to the next level.
Generally speaking, the work flow of M3 was described in detail in this article.
After some thought and design, we’ve decided it’d be best if M3 was pluggable. Pluggable in terms of being able to easily add execution and parsing plugins.
The interface and behavior of M3 stayed exactly the same, however now it is much easier to obtain data from any source and parse the data the way you want it.
Saying that, it was time to put the new design for a test. We tried to integrate the DBI support into M3.
Guess what – it was much easier than expected!

M3 (Monitis Monitor Manager) framework usage and examples were outlined in a few previous articles:
M3 – introduction
Planning your vacation / HTTP extraction
However we’ve never explained the bits and bytes behind it and what was the initial motivation for implementing it.
This article will outline the motivation, design, implementation and perhaps also the future road map for M3.
Rereading my previous articles I realized that I generated a somewhat steep learning curve for using M3 with the complex examples provided, just because M3 can handle these complex scenarios.
However M3 was created in order to simplify things. I’m going to use an extremely simple example in the following article to explain the way M3 works this time, I promise!
In the previous article we’ve shown how easy it is to integrate popular Nagios server monitoring commands, or plugins, with Monitis M3 monitoring framework.
However, given the fact you have a working Nagios configuration, which is vast and complex – I can sympathize with your unwillingness to actually migrate to Monitis.
Monitis provides built in functionality to monitor a wide variety of system statistics as well as the ability to create custom system monitors. Monitis Monitor Manager, or M3 for short, allows you to take these custom monitors even further by providing you with a simple framework to use the incredible power of regular expressions to pull and format literally any kind of data and automatically send it over the wire to your Monitis dashboard.

Nagios, a systems monitoring software
What’s Nagios? – Nagios is a rather simplistic monitoring software. And I like simple things. Nagios’ responsibility is not necessarily to draw nice graphs for your boss or collect data you may or may not need.
Nagios simply decides whether your system runs properly. And for this question there is a very explicit answer – a YES or a NO. Nagios will alert you if the answer is a NO.
In the following article I’m going to show how easy it is to integrate Nagios with Monitis.

A rabbit?
Writing custom monitors for Monitis is easy. On monitisexchange you can find many examples for custom monitors. However, now I bring you a surprise.
It is only rarely after I write a piece of code and represent it to others that I feel like pulling a rabbit out of a hat. On this occasion – there is something even better than a rabbit!
I’m proud to present you this time with ‘Monitis Monitor Manager‘, or M3 (M³) in short.

People who are familiar with me know that there are two things I’m not forgiving about. The first is backups, the second is security.
If backups interest you, perhaps we can discuss it some other time. This time we’re going to discuss security.
I’m going to outline in the following article some of the best practices I’ve learned along the years and help you “almost brick up, but not just yet” or “harden” your Linux server.
While reading this article, however, I suggest also reading this article as well. As we both try to tackle the same issues. I believe both articles eventually represent the same views in a different guise.
All of the ideas I’m coming up with are already implemented in shk. I suggest downloading shk, reviewing the code and using it.