Monitoring dynamic processes with Nagios

We spent a couple of weeks now at work, setting up our Nagios installation.  This is one of those things that one can never finish.  Monitoring is like security – no matter how good it is, it can always be better.

One thing that I particularly enjoyed figuring out was how to monitor dynamic stuff.  Hosts and services are the easy part – they are always there and should be there.  If they aren’t – let me know.  But how to monitor dynamic values, that change based on the time of day or day of week?  How to configure the monitoring so that we don’t need to update the limits every other week?

For example, consider the number of the user registrations through a web form.  If we are to measure this number over any sensible (monitoring-wise) period of time, such as one hour, we’d see that it fluctuates a lot during the day.  Furthermore, this number fluctuates differently depending on the day of the week.  We have three separate pick hours during the day, and we have a great decrease in numbers over the weekend.  Plus the amount of user registrations is linked to all the advertising that company does, so this week might different from the last week and from the next week.  How can we measure it so that a notiification is sent when the number is abnormal?  What is abnormal?

The solution turned out to be much simpler than I originally thought it would.  It is sufficient to get a few samples of the data in same hour last week and a week before.  If current value is more than twice the maximum or less than twice the minimum from the sample data, then we should be notified. This, in fact, works pretty well.  The only time when we get a lot of false positives is when the values in the sample data are small.  With values under 10, it’s very easy to jump over or under the limit.  When the sample values are higher, there is more space between the boundaries and the system works as expected.

We’ll get some more sample data now and we’ll be adjusting the formulat accordingly.  But as I said, even as it is, it’s pretty good.

The Dark Knight

The other day I went to see “The Dark Knight“, also known as the latest story in the series about Batman.  I am not a big fan of superhero comics, with Batman being no exception.  But I’ve seen all the movies so far.

I have to say that this one was the worst.  It was too long and too boring.  It had great cast, but that didn’t help the film one bit.  There are a few special effects, but the overall boredom burries them in the long propagandic dialogues.  In fact, the movie is total crap except for one bit, which makes it worth watching – The Joker.

Heath Ledger did an excellent job with this character.  It was by all means the best villain I’ve ever seen in the movies. Heath Ledger even outdid Jack Nicholson, who played The Joker in “Batman” (1992).  Heath’s Joker was the scary kind.  That person was so evil and … broken, that you wouldn’t want him to exist on this planet at all.  But, at the same time, he was so realistic that you could easily meet somebody very similar (minus the make-up, of course) just around the corner.  Really, a masterpiece.

As it stands, it’s difficult to rate this film.  I’ll give it a 5 out of 10, with all 5 points being for The Joker alone.  If you aren’t into movie villains, avoid this film at all costs.