Saturday, August 7, 2010

Nagios with check_mk

We don't do a lot of printing here at the homestead, but when we do we usually find that the printer isn't working. It is an older network printer that is a bit flaky. So I obviously needed to install Nagios an enterprise class monitoring package to let me know when it stopped working. I had a centOS machine lying around that I wasn't doing anything with, so one rainy Saturday afternoon I set to work. I followed the quick start instructions for fedora without encountering much trouble. I had a couple dependency issues (no apache) but was able to get everything through yum easily an aside yum has really made life easier; I remember the days where if you forgot to select gcc during the install you simply reformatted and started over because it was easier.

I also wanted to be able to do some trending (not on the printer mind you that would be silly). It seems like some people are using different products for trending and just Nagios for the monitoring; but Nagios does a great job of trending as well with help from an add-on. Of the various add-ons for Nagios that do trending pnp4nagio seemed to fit me best, it is easy to use and generates appealing graphs. As long as the Nagios check returns data properly pnp4nagios can graph it with no additional setup.

So it was time to setup my first host. This is where I think people start to get turned off by Nagios. For every host you have to edit a file with all the services the host has. This means thinking about what you want to monitor, having some idea of what Nagios can monitor, and when adding new monitors going back and updating potentially many config files. There are some plugins that will let you do this in a web GUI but I didn't try any so cannot speak to them. Despite the difficult config Nagios is nice; the web interface is clear, I could see that my file server and printer were both up, and I got nice alerts when my printer went offline.

I then set out to investigate check_mk which solves the difficult configuration of the monitored hosts which is Nagios's biggest negative. Check_mk is an auto discovery tool for services on a host. You tell it what host machines you want to monitor, install a small client on the host and it takes care of the rest. Anything check_mk can monitor it will find it on the host and monitor it; it also has built in integration to pnp4nagios so you can trend all of the check_mk monitors as well. You will still need to deal with figuring out how to monitor other stuff that is not at the OS layer (custom applications, database, etc) but you will be building off a solid foundation.

Installation of check_mk was very simple NOTE You will probably want to grab the latest version as the new 1.1.6 is out now (I admit I procrastinated a while before writing this post but the steps should otherwise be the same):
wget tar -xvf check_mk-1.1.2.tar.gz
cd check_mk-1.1.2
When you run the setup script it asked me lots and lots of questions, I took the defaults for all of them. To install the client on the target machine to be monitored:
rpm -i check_mk-agent-1.1.2-1.noarch.rpm
Next add the host name of the machine to be monitored to the check_mk config file (/etc/check_mk/, and run two commands to auto-generate the Nagios host config files:
check_mk -I alltcp
check_mk -R
These commands will also restart the Nagios server. One note is that if you are running on a slow host (like hardware sitting in your basement) sometimes 2 Nagios processes will be running at the same time, kill them both (killall -9 nagios) and restart nagios (service nagios start) and you should be fine.

Browse over to the web UI and you should see your monitored host, click on it and you should see a healthy amount of monitored services. To add additional hosts simply repeat the last two steps from above.

With the combination of Nagios and chck_mk you get the great monitoring server of Nagios without the headache or learning curve that is the traditional complaint of Nagios users. Skip the NRPE or remote shell invocation stuff and go straight to check_mk. You can add non check_mk services to these hosts (and other things) through standard Nagios configuration files. You will want to add a new "cfg_file" property to your nagios.cfg file to hold custom configurations, in this new file define a new check using the same host name used to setup check_mk. When done you should see your service along with the check_mk ones, and because it is in a separate file check_mk will not overwrite it when doing updates. Nagios may also be a bit chatty in the beginning, so even with check_mk it still takes a little tuning so alerts are not going off all the time; though you may also be surprised to discover a number of problems on your network if this is the first time you are setting up a non-home grown monitoring solution.

For additional reading check out the jboss2nagios plugin for JBoss monitoring and icinga a recent fork of Nagios. I didn't get a chance to look into icinga much as I didn't find it until I was already down the path with Nagios. Initial thoughts were the web UI looks much more modern but I don't think check_mk works with it yet.


  1. Nhiều chị em tỏ ra thắc mắc khibà bầu đau dạ dày nên ăn gì vì lúc đó chắc không có tâm trạng để ăn uống, bà bầu bị viêm đại tràng có nguy hiểm không vì những cơ quan bên trong bị đau thì sẽ rất khó chịu, bà bầu đi tiểu buốt có sao không và nó có ảnh hưởng gì đến thai nhi không, bà bầu bị tiểu đường có sao không vì đang trong thời gian của thai kì do đó phải theo dõi thường xuyên nếu không sẽ ảnh hưởng đến thai nhi, bà bầu bị tiểu đường nên ăn gì là điều quan trọng nhất, vì lượng đường tăng cao dẫn đến nguy hiểm cho thai nhi vì thế nên bổ sung các chất cần thiết khác.

  2. [url=][b]Ray-Ban Outlet[/b][/url]
    [url=][b]Nike Outlet[/b][/url]
    [url=][b]longchamp bags[/b][/url]
    [url=][b]Adidas Shoes[/b][/url]
    [url=][b]Nike Shoes[/b][/url]
    [url=][b]Yeezy Shoes[/b][/url]
    [url=][b]Ray-Ban sunglasses Outlet[/b][/url]
    [url=][b]Ray-Ban sunglasses Outlet[/b][/url]
    [url=][b]james Sale[/b][/url]
    [url=][b]Adidas NMD Outlet[/b][/url]
    [url=][b]Cheap Jordan[/b][/url]
    [url=][b]Air Max Outlet Online[/b][/url]
    [url=][b]Asics Outlet[/b][/url]
    [url=][b]Flip Flopst Outlet[/b][/url]
    [url=][b]Ray-Ban sunglasses[/b][/url]
    [url=][b]oakley outlet[/b][/url]
    [url=][b]oakley sunglasses[/b][/url]
    [url=][b]oakley store[/b][/url]
    [url=][b]Nike Shoes[/url]

  3. This application has very own guidelines as well as More Info regulations which are created from the designers Machine Liker PC, Android, iOS Free Download (APK) so you need to have to follow them as well as not associate Machine Liker with below tasks You are not qualified to get sorts from Machine Liker App illegal web content like adult and also sex-related posts.

  4. all help offer a wonderful experience for travelers Parents really value the detail offered Website to the general convenience and safety and BEST JOGGING STROLLERS 2017 AND REVIEWS security of this infant stroller.