You are previewing Nagios, 2nd Edition.

Nagios, 2nd Edition

Cover of Nagios, 2nd Edition by Wolfgang Barth Published by No Starch Press
  1. Nagios: System and Network Monitoring, 2nd Edition
    1. Foreword to the second edition
      1. What's New in the Second Edition?
      2. Information Sources on the Internet
    2. Introduction
      1. The tests
      2. The suppliers of information
      3. Keeping admins up-to-date
      4. Taking in information from outside
      5. Other tools for network monitoring
      6. About This Book
      7. Further notes on the book
      8. Note of Thanks
    3. I. From Source Code to a Running Installation
      1. 1. Installation
      2. 2. Nagios Configuration
      3. 3. Startup
    4. II. In More Detail...
      1. 4. Nagios Basics
      2. 5. Service Checks and How They Are Performed
      3. 6. Plugins for Network Services
      4. 7. Testing Local Resources
      5. 8. Plugins for Special Tasks
      6. 9. Executing Plugins via SSH
      7. 10. The Nagios Remote Plugin Executor (NRPE)
      8. 11. Collecting Information Relevant for Monitoring with SNMP
      9. 12. The Nagios Notification System
      10. 13. Passive Tests with the External Command File
      11. 14. The Nagios Service Check Acceptor (NSCA)
      12. 15. Distributed Monitoring
    5. III. The Web Interface and Other Ways to Visualize Nagios Data
      1. 16. The Classical Web Interface
      2. 17. Flexible Web Interface with the NDOUtils
      3. 18. NagVis
      4. 19. Graphic Display of Performance Data
    6. IV. Part IV Special Applications
      1. 20. Monitoring Windows Servers
      2. 21. Monitoring Room Temperature and Humidity
      3. 22. Monitoring SAP Systems
      4. 23. Processing Events with the EventDB
    7. V. Part V Development
      1. 24. Writing Your Own Plugins
      2. 25. Determining File and Directory Sizes
      3. 26. Monitoring Oracle with the Instant Client
    8. VI. Part VI Appendixes
      1. A. An Overview of the Nagios Configuration Parameters
      2. B. Rapidly Alternating States: Flapping
      3. C. Event Handlers
      4. D. Macros
      5. E. Single Sign-On for the Nagios Web Interface
      6. F. Tips on Optimizing Performance
      7. G. The Embedded Perl Interpreter
      8. H. What's New in Nagios 3.0?
O'Reilly logo

2.5 Defining Services to Be Monitored with service

A service in Nagios always consists of the combination of a host and a service name. This combination must be unique. Service names, on the other hand, may occur many times, as long as they are combined with different hosts.

The simplest service consists of a simple ping, which tests whether the relevant host is reachable, and which registers the response time and any packet loss that may occur:

# -- /etc/nagios/mysite/services.cfg
define service{
   host_name                         linux01
   service_description               PING
   check_command                     check_ping!100.0,20%!500.0,60%
   max_check_attempts                3
   normal_check_interval(*)          5
   retry_check_interval(*)           1
   check_period                      24×7
   notification_interval             120
   notification_period(*)            24×7
 notification_options ...

The best content for your career. Discover unlimited learning on demand for around $1/day.