13.07.2015 Views

Linux System Administration Recipes A Problem-Solution Approach

Linux System Administration Recipes A Problem-Solution Approach

Linux System Administration Recipes A Problem-Solution Approach

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

CHAPTER 3 ■ MONITORING AND UPDATING■ Note To make the front page of the Nagios web interface more useful, you can set it to go straight to thetactical overview rather than to a home page. Edit /usr/share/nagios3/htdocs/index.html, and replacethis line:with this one:3-2. Adding Another Host to NagiosSo far, Nagios is monitoring the Nagios server machine itself and that one default gateway. Next, youneed to add a host, that is, another machine that you’re monitoring. The best way to do this is to create aconf.d/host-hostname.cfg file, named for the machine you want to monitor (here cepheus, so the file willbe conf.d/host-cepheus.cfg):define host{use generic-hosthost_name cepheusaddress 10.0.0.2}As you can see, this can be very basic; almost all the information is taken from the host template(see recipe 3-3 for more information about templates). Reload Nagios:/etc/init.d/nagios3 reloadIt will take maybe a minute to run the various checks before the data shows up on the web page, sobe patient.That’s your first very basic Nagios setup done. The server now checks itself and an external clientand will alert you to any problems.3-3. Using Templates in NagiosNagios provides templates as a way of saving yourself work. The previous recipe used one of these: take alook at the defaults defined for the localhost in conf.d/localhost_nagios2.cfg. The host definition andthe first service definition should look a bit like this:67Download at WoweBook.Com

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!