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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

CHAPTER 3 ■ MONITORING AND UPDATING■ Note By default, some of the files in this directory (when installing from the version in Debian stable at the timeof this writing, which was 3.0.6-4) still have names that end with nagios2, despite the version of the software as awhole being Nagios 3. Feel free to change the file names if you prefer; here I’ll refer to them by the default namesthat the Debian package uses.For the basic server setup, monitoring only the server itself (localhost) from a package install, mostof the default settings should be OK. All you need to do is to edit the conf.d/contacts_nagios2.cfg file toput your e-mail address in as the value of the email parameter under the first defined contact:# comments must start with # with no whitespace in frontdefine contact{contact_namerootaliasRootservice_notification_period 24x7host_notification_period 24x7service_notification_options w,u,c,rhost_notification_options d,rservice_notification_commands notify-by-emailhost_notification_commands host-notify-by-emailemailmyself@example.com}This means that if an alert is triggered (see recipe 3-5 for alert setup), you’ll be e-mailed.■ Note It’s a good idea to use Subversion to keep track of changes in config files; see Chapter 1.A good habit to get into is that of checking the config syntax whenever you make a change; you cando so with this:nagios3 -v /etc/nagios3/nagios.cmdOnce you’ve checked the config, reload Nagios with /etc/init.d/nagios3 reload, and go look athttp://server.example.com/nagios3 (you’ll be asked for that nagiosadmin password that you set atinstall). From the welcome page, click Tactical Overview in the left menu, and the report screen willcome up, as shown in Figure 3-1.65Download at WoweBook.Com

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

Saved successfully!

Ooh no, something went wrong!