Книга Nagios: system and network monitoring Nagios: system and network monitoringКниги Компьютерные сети Автор: Wolfgang Barth Год издания: 2005 Формат: pdf Издат.:No Starch Press Страниц: 462 Размер: 7 ISBN: 1-59327-070-4 Язык: Русский0 (голосов: 0) Оценка:This book is directed at network administrators who want to find out about the condition of their systems and networks using an Open Source tool. It describes Nagios version 2.0.ContentsIntroduction 15From Source Code to a Running Installation 231 Installation 251.1 Compiling the Source Code . . . . . . . . . . . . . . . . . . . . . . 261.2 Installing and Testing Plugins . . . . . . . . . . . . . . . . . . . . . 301.2.1 Installation . . . . . . . . . . . . . . . . . . . . . . . . . . 301.2.2 Plugin test . . . . . . . . . . . . . . . . . . . . . . . . . . 321.3 Configuration of the Web Interface . . . . . . . . . . . . . . . . . 331.3.1 Setting Up Apache . . . . . . . . . . . . . . . . . . . . . . 331.3.2 User Authentication . . . . . . . . . . . . . . . . . . . . . 342 Nagios Configuration 372.1 The Main Configuration File nagios.cfg . . . . . . . . . . . . . . . 382.2 Objects—an Overview . . . . . . . . . . . . . . . . . . . . . . . . . 412.3 Defining the Machines to Be Monitored, with host . . . . . . . . . 442.4 Grouping Computers Together with hostgroup . . . . . . . . . . . 462.5 Defining Services to Be Monitored with service . . . . . . . . . . . 472.6 Grouping Services Together with servicegroup . . . . . . . . . . . 502.7 Defining Addressees for Error Messages: contact . . . . . . . . . . 502.8 The Message Recipient: contactgroup . . . . . . . . . . . . . . . . 522.9 When Nagios Needs to Do Something: the command Object . . . 532.10 Defining a Time Period with timeperiod . . . . . . . . . . . . . . . 542.11 Templates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 542.12 Configuration Aids for Those Too Lazy to Type . . . . . . . . . . . . 562.12.1 Defining services for several computers . . . . . . . . . . . 562.12.2 One host group for all computers . . . . . . . . . . . . . . 572.12.3 Other configuration aids . . . . . . . . . . . . . . . . . . . 572.13 CGI Configuration in cgi.cfg . . . . . . . . . . . . . . . . . . . . . 572.14 The Resources File resource.cfg . . . . . . . . . . . . . . . . . . . . 593 Startup 613.1 Checking the Configuration . . . . . . . . . . . . . . . . . . . . . . 613.2 Getting Monitoring Started . . . . . . . . . . . . . . . . . . . . . . 633.2.1 Manual start . . . . . . . . . . . . . . . . . . . . . . . . . 633.2.2 Automatic start . . . . . . . . . . . . . . . . . . . . . . . . 643.2.3 Making configuration changes come into effect . . . . . . 643.3 Overview of the Web Interface . . . . . . . . . . . . . . . . . . . . 64In More Detail . . . 694 Nagios Basics 714.1 Taking into Account the Network Topology . . . . . . . . . . . . . 724.2 Forced Host Checks vs. Periodic Reachability Tests . . . . . . . . . . 754.3 States of Hosts and Services . . . . . . . . . . . . . . . . . . . . . 755 Service Checks and How They Are Performed 795.1 Testing Network Services Directly . . . . . . . . . . . . . . . . . . . 815.2 Running Plugins via Secure Shell on the Remote Computer . . . . 825.3 The Nagios Remote Plugin Executor . . . . . . . . . . . . . . . . . 825.4 Monitoring via SNMP . . . . . . . . . . . . . . . . . . . . . . . . . 835.5 The Nagios Service Check Acceptor . . . . . . . . . . . . . . . . . . 846 Plugins for Network Services 856.1 Standard Options . . . . . . . . . . . . . . . . . . . . . . . . . . . 876.2 Reachability Test with Ping . . . . . . . . . . . . . . . . . . . . . . 886.2.1 check_icmp as a service check . . . . . . . . . . . . . . . 906.2.2 check_icmp as a host check . . . . . . . . . . . . . . . . . 916.3 Monitoring Mail Servers . . . . . . . . . . . . . . . . . . . . . . . . 926.3.1 Monitoring SMTP with check_smtp . . . . . . . . . . . . . 926.3.2 POP and IMAP . . . . . . . . . . . . . . . . . . . . . . . . 956.4 Monitoring FTP and Web Servers . . . . . . . . . . . . . . . . . . . 976.4.1 FTP services . . . . . . . . . . . . . . . . . . . . . . . . . . 976.4.2 Web server control via HTTP . . . . . . . . . . . . . . . . . 986.4.3 Monitoring Web proxies . . . . . . . . . . . . . . . . . . . 1016.5 Domain Name Server under Control . . . . . . . . . . . . . . . . . 1056.5.1 DNS check with nslookup . . . . . . . . . . . . . . . . . . 1066.5.2 Monitoring the name server with dig . . . . . . . . . . . . 1076.6 Querying the Secure Shell Server . . . . . . . . . . . . . . . . . . . 1086.7 Generic Network Plugins . . . . . . . . . . . . . . . . . . . . . . . 1106.7.1 Testing TCP ports . . . . . . . . . . . . . . . . . . . . . . . 1106.7.2 Monitoring UDP ports . . . . . . . . . . . . . . . . . . . . 1126.8 Monitoring Databases . . . . . . . . . . . . . . . . . . . . . . . . . 1146.8.1 PostgreSQL . . . . . . . . . . . . . . . . . . . . . . . . . . 1156.8.2 MySQL . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1196.9 Monitoring LDAP Directory Services . . . . . . . . . . . . . . . . . 1216.10 Checking a DHCP Server . . . . . . . . . . . . . . . . . . . . . . . . 1246.11 Monitoring UPS with the Network UPS Tools . . . . . . . . . . . . 1267 Testing Local Resources 1337.1 Free Hard Drive Capacity . . . . . . . . . . . . . . . . . . . . . . . 1347.2 Utilization of the Swap Space . . . . . . . . . . . . . . . . . . . . . 1367.3 Testing the System Load . . . . . . . . . . . . . . . . . . . . . . . . 1377.4 Monitoring Processes . . . . . . . . . . . . . . . . . . . . . . . . . 1387.5 Checking Log Files . . . . . . . . . . . . . . . . . . . . . . . . . . . 1417.5.1 The standard plugin check_log . . . . . . . . . . . . . . . 1427.5.2 The modern variation: check_logs.pl . . . . . . . . . . . . 1437.6 Keeping Tabs on the Number of Logged-in Users . . . . . . . . . . 1447.7 Checking the System Time . . . . . . . . . . . . . . . . . . . . . . 1457.7.1 Checking the system time via NTP . . . . . . . . . . . . . . 1457.7.2 Checking system time with the time protocol . . . . . . . 1467.8 Regularly Checking the Status of the Mail Queue . . . . . . . . . . 1477.9 Keeping an Eye on the Modification Date of a File . . . . . . . . . 1487.10 Monitoring UPSs with apcupsd . . . . . . . . . . . . . . . . . . . . 1497.11 Nagios Monitors Itself . . . . . . . . . . . . . . . . . . . . . . . . . 1507.11.1 Running the plugin manually with a script . . . . . . . . . 1517.11.2 check_nagios as a tool for CGI programs . . . . . . . . . . 1527.12 Hardware Checks with LM Sensors . . . . . . . . . . . . . . . . . . 1527.13 The Dummy Plugin for Tests . . . . . . . . . . . . . . . . . . . . . 1548 Manipulating Plugin Output 1558.1 Negating Plugin Results . . . . . . . . . . . . . . . . . . . . . . . . 1558.2 Inserting Hyperlinks with urlize . . . . . . . . . . . . . . . . . . . 1569 Executing Plugins via SSH 1579.1 The check_by_ssh Plugin . . . . . . . . . . . . . . . . . . . . . . . 1589.2 Configuring SSH . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1609.2.1 Generating SSH key pairs on the Nagios server . . . . . . . 1609.2.2 Setting up the user nagios on the target host . . . . . . . 1619.2.3 Checking the SSH connection and check_by_ssh . . . . . 1619.3 Nagios Configuration . . . . . . . . . . . . . . . . . . . . . . . . . 16210 The Nagios Remote Plugin Executor (NRPE) 16510.1 Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16610.1.1 Distribution-specific packages . . . . . . . . . . . . . . . . 16610.1.2 Installation from the source code . . . . . . . . . . . . . . 16710.2 Starting via the inet Daemon . . . . . . . . . . . . . . . . . . . . . 16810.2.1 xinetd configuration . . . . . . . . . . . . . . . . . . . . . 16810.2.2 inetd configuration . . . . . . . . . . . . . . . . . . . . . 16910.3 NRPE Configuration on the Computer to Be Monitored . . . . . . . 17010.3.1 Passing parameters on to local plugins . . . . . . . . . . . 17110.4 Nagios Configuration . . . . . . . . . . . . . . . . . . . . . . . . . 17210.4.1 NRPE without passing parameters on . . . . . . . . . . . . 17210.4.2 Passing parameters on in NRPE . . . . . . . . . . . . . . . 17310.4.3 Optimizing the configuration . . . . . . . . . . . . . . . . 17310.5 Indirect Checks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17411 Collecting Information Relevant for Monitoring with SNMP 17711.1 Introduction to SNMP . . . . . . . . . . . . . . . . . . . . . . . . . 17811.1.1 The Management Information Base . . . . . . . . . . . . . 17911.1.2 SNMP protocol versions . . . . . . . . . . . . . . . . . . . 18311.2 NET-SNMP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18411.2.1 Tools for SNMP requests . . . . . . . . . . . . . . . . . . . 18411.2.2 The NET-SNMP daemon . . . . . . . . . . . . . . . . . . . 18711.3 Nagios’s Own SNMP Plugins . . . . . . . . . . . . . . . . . . . . . 19611.3.1 The generic SNMP plugin check_snmp . . . . . . . . . . . 19611.3.2 Checking several interfaces simultaneously . . . . . . . . . 20111.3.3 Testing the operating status of individual interfaces . . . . 20311.4 Other SNMP-based Plugins . . . . . . . . . . . . . . . . . . . . . . 20511.4.1 Monitoring hard drive space and processes with nagiossnmp-plugins . . . . . . . . . . . . . . . . . . . . . . . . 20511.4.2 Observing the load on network interfaces with checkiftraffic. . . . . . . . . . . . . . . . . . . . . . . . . . . . 20711.4.3 The manubulon.com plugins for special application purposes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20912 The Nagios Notification System 21512.1 Who Should be Informed of What, When? . . . . . . . . . . . . . . 21612.2 When Does a Message Occur? . . . . . . . . . . . . . . . . . . . . 21712.3 The Message Filter . . . . . . . . . . . . . . . . . . . . . . . . . . . 21712.3.1 Switching messages on and off systemwide . . . . . . . . 21812.3.2 Enabling and suppressing computer and service-relatedmessages . . . . . . . . . . . . . . . . . . . . . . . . . . . 21912.3.3 Person-related filter options . . . . . . . . . . . . . . . . . 22112.3.4 Case examples . . . . . . . . . . . . . . . . . . . . . . . . 22212.4 External Notification Programs . . . . . . . . . . . . . . . . . . . . 22412.4.1 Notification via e-mail . . . . . . . . . . . . . . . . . . . . 22512.4.2 Notification via SMS . . . . . . . . . . . . . . . . . . . . . 22712.5 Escalation Management . . . . . . . . . . . . . . . . . . . . . . . . 23112.6 Dependences between Hosts and Services as a Filter Criterion . . . 23412.6.1 The standard case: service dependencies . . . . . . . . . . 23412.6.2 Only in exceptional cases: host dependencies . . . . . . . 23813 Passive Tests with the External Command File 23913.1 The Interface for External Commands . . . . . . . . . . . . . . . . 24013.2 Passive Service Checks . . . . . . . . . . . . . . . . . . . . . . . . . 24113.3 Passive Host Checks . . . . . . . . . . . . . . . . . . . . . . . . . . 24213.4 Reacting to Out-of-Date Information of Passive Checks . . . . . . 24314 The Nagios Service Check Acceptor (NSCA) 24714.1 Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24814.2 Configuring the Nagios Server . . . . . . . . . . . . . . . . . . . . 24914.2.1 The configuration file nsca.cfg . . . . . . . . . . . . . . . 24914.2.2 Configurung the inet daemon . . . . . . . . . . . . . . . . 25114.3 Client-side Configuration . . . . . . . . . . . . . . . . . . . . . . . 25214.4 Sending Test Results to the Server . . . . . . . . . . . . . . . . . . 25314.5 Application Example I: Integrating syslog and Nagios . . . . . . . . 25414.5.1 Preparing syslog-ng for use with Nagios . . . . . . . . . . 25514.5.2 Nagios configuration: volatile services . . . . . . . . . . . 25714.5.3 Resetting error states manually . . . . . . . . . . . . . . . 25814.6 Application Example II: Processing SNMP Traps . . . . . . . . . . . 26014.6.1 Receiving traps with snmptrapd . . . . . . . . . . . . . . 26014.6.2 Passing on traps to NSCA . . . . . . . . . . . . . . . . . . 26114.6.3 The matching service definition . . . . . . . . . . . . . . . 26315 Distributed Monitoring 26515.1 Switching On the OCSP/OCHP Mechanism . . . . . . . . . . . . . . 26615.2 Defining OCSP/OCHP Commands . . . . . . . . . . . . . . . . . . . 26715.3 Practical Scenarios . . . . . . . . . . . . . . . . . . . . . . . . . . . 26915.3.1 Avoiding redundancy in configuration files . . . . . . . . . 26915.3.2 Defining templates . . . . . . . . . . . . . . . . . . . . . . 27016 The Web Interface 27316.1 Recognizing and Acting On Problems . . . . . . . . . . . . . . . . 27516.1.1 Comments on problematic hosts . . . . . . . . . . . . . . 27616.1.2 Taking responsibility for problems: acknowledgements . . 27816.2 An Overview of the Individual CGI Programs . . . . . . . . . . . . . 27916.2.1 Variations in status display: status.cgi . . . . . . . . . . . 27916.2.2 Additional information and control center: extinfo.cgi . . 28416.2.3 Interface for external commands: cmd.cgi . . . . . . . . . 28816.2.4 The most important things at a glance: tac.cgi . . . . . . 29016.2.5 Network plan: the topological map of the network (statusmap.cgi) . . . . . . . . . . . . . . . . . . . . . . . . . . 29116.2.6 Navigation in 3D: statuswrl.cgi . . . . . . . . . . . . . . . 29316.2.7 Querying the status with a cell phone: statuswml.cgi . . . 29516.2.8 Analyzing disrupted partial networks: outages.cgi . . . . . 29516.2.9 Querying the object definition with config.cgi . . . . . . . 29516.2.10 Availability statistics: avail.cgi . . . . . . . . . . . . . . . 29616.2.11 What events occur, how often? histogram.cgi . . . . . . . 29816.2.12 Filtering log entries after specific states: history.cgi . . . . 29916.2.13 Who was told what, when? notifications.cgi . . . . . . . 30016.2.14 Showing all logfile entries: showlog.cgi . . . . . . . . . . 30116.2.15 Evaluating whatever you want: summary.cgi . . . . . . . 30116.2.16 Following states graphically over time: trends.cgi . . . . . 30316.3 Planning Downtimes . . . . . . . . . . . . . . . . . . . . . . . . . 30416.3.1 Maintenance periods for hosts . . . . . . . . . . . . . . . 30516.3.2 Downtime for services . . . . . . . . . . . . . . . . . . . . 30616.4 Additional Information on Hosts and Services . . . . . . . . . . . . 30716.4.1 Extended host information . . . . . . . . . . . . . . . . . 30716.4.2 Extended service information . . . . . . . . . . . . . . . . 31016.5 Configuration Changes through the Web Interfaces: the Restart Problem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31117 Graphic Display of Performance Data 31317.1 Processing Plugin Performance Data with Nagios . . . . . . . . . . 31417.1.1 The template mechanism . . . . . . . . . . . . . . . . . . 31417.1.2 Using external commands to process performance data . . 31717.2 Graphs for the Web with Nagiosgraph . . . . . . . . . . . . . . . . 31717.2.1 Basic installation . . . . . . . . . . . . . . . . . . . . . . . 31817.2.2 Configuration . . . . . . . . . . . . . . . . . . . . . . . . . 31917.3 Preparing Performance Data for Evaluation with Perf2rrd . . . . . 32517.3.1 Installation . . . . . . . . . . . . . . . . . . . . . . . . . . 32617.3.2 Nagios configuration . . . . . . . . . . . . . . . . . . . . . 32617.3.3 Perf2rrd in practice . . . . . . . . . . . . . . . . . . . . . . 32717.4 The Graphics Specialist drraw . . . . . . . . . . . . . . . . . . . . . 33017.4.1 Installation . . . . . . . . . . . . . . . . . . . . . . . . . . 33017.4.2 Configuration . . . . . . . . . . . . . . . . . . . . . . . . . 33117.4.3 Practical application . . . . . . . . . . . . . . . . . . . . . 33217.5 Automated to a Large Extent: NagiosGrapher . . . . . . . . . . . . 33617.5.1 Installation . . . . . . . . . . . . . . . . . . . . . . . . . . 33617.5.2 Configuration . . . . . . . . . . . . . . . . . . . . . . . . . 33817.6 Other tools and the limits of graphic evaluation . . . . . . . . . . . 349Special Applications 35118 Monitoring Windows Servers 35318.1 NSClient and NC Net . . . . . . . . . . . . . . . . . . . . . . . . . 35418.1.1 Installation . . . . . . . . . . . . . . . . . . . . . . . . . . 35418.1.2 The check_nt plugin . . . . . . . . . . . . . . . . . . . . . 35518.1.3 Commands which can be run with NSClient and NC Net . 35618.1.4 Advanced functions of NC Net . . . . . . . . . . . . . . . 36318.2 NRPE for Windows: NRPE NT . . . . . . . . . . . . . . . . . . . . . 37118.2.1 Installation and configuration . . . . . . . . . . . . . . . . 37218.2.2 Function test . . . . . . . . . . . . . . . . . . . . . . . . . 37318.2.3 The Cygwin plugins . . . . . . . . . . . . . . . . . . . . . . 37318.2.4 Perl plugins in Windows . . . . . . . . . . . . . . . . . . . 37419 Monitoring Room Temperature and Humidity 37719.1 Sensors and Software . . . . . . . . . . . . . . . . . . . . . . . . . 37819.1.1 The PCMeasure software for Linux . . . . . . . . . . . . . 37819.1.2 The query protocol . . . . . . . . . . . . . . . . . . . . . . 37919.2 The Nagios Plugin check_pcmeasure . . . . . . . . . . . . . . . . 37920 Monitoring SAP Systems 38320.1 Checking without a Login: sapinfo . . . . . . . . . . . . . . . . . . 38420.1.1 Installation . . . . . . . . . . . . . . . . . . . . . . . . . . 38420.1.2 First test . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38420.1.3 The plugin check_sap.sh . . . . . . . . . . . . . . . . . . . 38620.2 Monitoring with SAP’s Own Monitoring System (CCMS) . . . . . . 38820.2.1 CCMS—a short overview . . . . . . . . . . . . . . . . . . . 38820.2.2 Obtaining the necessary SAP usage permissions for Nagios 39020.2.3 Monitors and templates . . . . . . . . . . . . . . . . . . . 39220.2.4 The CCMS plugins . . . . . . . . . . . . . . . . . . . . . . 39420.2.5 Performance optimization . . . . . . . . . . . . . . . . . . 398Appendixes 399A Rapidly Alternating States: Flapping 401A.1 Flap Detection with Services . . . . . . . . . . . . . . . . . . . . . 402A.1.1 Nagios configuration . . . . . . . . . . . . . . . . . . . . . 403A.1.2 The history memory and the chronological progression ofthe changes in state . . . . . . . . . . . . . . . . . . . . . 404A.1.3 Representation in the Web interface . . . . . . . . . . . . 404A.2 Flap Detection for Hosts . . . . . . . . . . . . . . . . . . . . . . . . 406B Event Handlers 409B.1 Execution Times for the Event Handler . . . . . . . . . . . . . . . . 410B.2 Defining the Event Handler in the Service Definition . . . . . . . . 411B.3 The Handler Script . . . . . . . . . . . . . . . . . . . . . . . . . . . 411B.4 Things to Note When Using Event Handlers . . . . . . . . . . . . . 413C Writing Your Own Plugins: Monitoring Oracle with theInstant Client 415C.1 Installing the Oracle Instant Client . . . . . . . . . . . . . . . . . . 416C.2 Establishing a Connection to the Oracle Database . . . . . . . . . . 417C.3 A Wrapper Plugin for sqlplus . . . . . . . . . . . . . . . . . . . . . 417C.3.1 How the wrapper works . . . . . . . . . . . . . . . . . . . 418C.3.2 The Perl plugin in detail . . . . . . . . . . . . . . . . . . . 419D An Overview of the Nagios Configuration Parameters 423D.1 The Main Configuration File nagios.cfg . . . . . . . . . . . . . . . 424D.2 CGI Configuration in cgi.cfg . . . . . . . . . . . . . . . . . . . . . 443D.2.1 Authentication parameters . . . . . . . . . . . . . . . . . 443D.2.2 Other Parameters . . . . . . . . . . . . . . . . . . . . . . . 444Index 447
Author(s): Wolfgang Barth
Publisher: No Starch Press
Year: 2005
Language: English
Commentary: 17664
Pages: 463
Cover......Page 1
Contents......Page 6
Introduction......Page 16
About This Book......Page 20
Note of Thanks......Page 22
1 Installation......Page 26
1.1 Compiling the Source Code......Page 27
1.2 Installing and Testing Plugins......Page 31
1.3 Configuration of the Web Interface......Page 34
2 Nagios Configuration......Page 38
2.1 The Main Configuration File nagios.cfg......Page 39
2.2 Objects—an Overview......Page 42
2.3 Defining the Machines to Be Monitored, with......Page 45
2.4 Grouping Computers Together with hostgroup......Page 47
2.5 Defining Services to Be Monitored with service......Page 48
2.7 Defining Addressees for Error Messages:......Page 51
2.8 The Message Recipient: contactgroup......Page 53
2.9 When Nagios Needs to Do Something: the......Page 54
2.11 Templates......Page 55
2.12 Configuration Aids for Those Too Lazy to Type......Page 57
2.13 CGI Configuration in cgi.cfg......Page 58
2.14 The Resources File resource.cfg......Page 60
3.1 Checking the Configuration......Page 62
3.2 Getting Monitoring Started......Page 64
3.3 Overview of the Web Interface......Page 65
4 Nagios Basics......Page 72
4.1 Taking into Account the Network Topology......Page 73
4.3 States of Hosts and Services......Page 76
5 Service Checks and How They Are Performed......Page 80
5.1 Testing Network Services Directly......Page 82
5.3 The Nagios Remote Plugin Executor......Page 83
5.4 Monitoring via SNMP......Page 84
5.5 The Nagios Service Check Acceptor......Page 85
6 Plugins for Network Services......Page 86
6.1 Standard Options......Page 88
6.2 Reachability Test with Ping......Page 89
6.3 Monitoring Mail Servers......Page 93
6.4 Monitoring FTP and Web Servers......Page 98
6.5 Domain Name Server under Control......Page 106
6.6 Querying the Secure Shell Server......Page 109
6.7 Generic Network Plugins......Page 111
6.8 Monitoring Databases......Page 115
6.9 Monitoring LDAP Directory Services......Page 122
6.10 Checking a DHCP Server......Page 125
6.11 Monitoring UPS with the Network UPS Tools......Page 127
7 Testing Local Resources......Page 134
7.1 Free Hard Drive Capacity......Page 135
7.2 Utilization of the Swap Space......Page 137
7.3 Testing the System Load......Page 138
7.4 Monitoring Processes......Page 139
7.5 Checking Log Files......Page 142
7.6 Keeping Tabs on the Number of Logged-in Users......Page 145
7.7 Checking the System Time......Page 146
7.8 Regularly Checking the Status of the Mail Queue......Page 148
7.9 Keeping an Eye on the Modification Date of a File......Page 149
7.10 Monitoring UPSs with apcupsd......Page 150
7.11 Nagios Monitors Itself......Page 151
7.12 Hardware Checks with LM Sensors......Page 153
7.13 The Dummy Plugin for Tests......Page 155
8.1 Negating Plugin Results......Page 156
8.2 Inserting Hyperlinks with urlize......Page 157
9 Executing Plugins via SSH......Page 158
9.1 The check_by_ssh Plugin......Page 159
9.2 Configuring SSH......Page 161
9.3 Nagios Configuration......Page 163
10 The Nagios Remote Plugin Executor (NRPE)......Page 166
10.1 Installation......Page 167
10.2 Starting via the inet Daemon......Page 169
10.3 NRPE Configuration on the Computer to Be Monitored......Page 171
10.4 Nagios Configuration......Page 173
10.5 Indirect Checks......Page 175
11 Collecting Information Relevant for Monitoring with SNMP......Page 178
11.1 Introduction to SNMP......Page 179
11.2 NET-SNMP......Page 185
11.3 Nagios’s Own SNMP Plugins......Page 197
11.4 Other SNMP-based Plugins......Page 206
12 The Nagios Notification System......Page 216
12.1 Who Should be Informed of What, When?......Page 217
12.3 The Message Filter......Page 218
12.4 External Notification Programs......Page 225
12.5 Escalation Management......Page 232
12.6 Dependences between Hosts and Services as a Filter Criterion......Page 235
13 Passive Tests with the External Command File......Page 240
13.1 The Interface for External Commands......Page 241
13.2 Passive Service Checks......Page 242
13.3 Passive Host Checks......Page 243
13.4 Reacting to Out-of-Date Information of Passive Checks......Page 244
14 The Nagios Service Check Acceptor (NSCA)......Page 248
14.1 Installation......Page 249
14.2 Configuring the Nagios Server......Page 250
14.3 Client-side Configuration......Page 253
14.4 Sending Test Results to the Server......Page 254
14.5 Application Example I: Integrating syslog and Nagios......Page 255
14.6 Application Example II: Processing SNMP Traps......Page 261
15 Distributed Monitoring......Page 266
15.1 Switching On the OCSP/OCHP Mechanism......Page 267
15.2 Defining OCSP/OCHP Commands......Page 268
15.3 Practical Scenarios......Page 270
16 The Web Interface......Page 274
16.1 Recognizing and Acting On Problems......Page 276
16.3 Planning Downtimes......Page 305
16.4 Additional Information on Hosts and Services......Page 308
16.5 Configuration Changes through the Web Interfaces: the Restart Problem......Page 312
17 Graphic Display of Performance Data......Page 314
17.1 Processing Plugin Performance Data with Nagios......Page 315
17.2 Graphs for the Web with Nagiosgraph......Page 318
17.3 Preparing Performance Data for Evaluation with Perf2rrd......Page 326
17.4 The Graphics Specialist drraw......Page 331
17.5 Automated to a Large Extent: NagiosGrapher......Page 337
17.6 Other tools and the limits of graphic evaluation......Page 350
18 Monitoring Windows Servers......Page 354
18.1 NSClient and NC Net......Page 355
18.2 NRPE for Windows: NRPE NT......Page 372
19 Monitoring Room Temperature and Humidity......Page 378
19.1 Sensors and Software......Page 379
19.2 The Nagios Plugin check_pcmeasure......Page 380
20 Monitoring SAP Systems......Page 384
20.1 Checking without a Login: sapinfo......Page 385
20.2 Monitoring with SAP’s Own Monitoring System (CCMS)......Page 389
Appendix A Rapidly Alternating States: Flapping......Page 402
A.1 Flap Detection with Services......Page 403
A.2 Flap Detection for Hosts......Page 407
Appendix B Event Handlers......Page 410
B.1 Execution Times for the Event Handler......Page 411
B.3 The Handler Script......Page 412
B.4 Things to Note When Using Event Handlers......Page 414
Appendix C Writing Your Own Plugins: Monitoring Oracle with the Instant Client......Page 416
C.1 Installing the Oracle Instant Client......Page 417
C.3 A Wrapper Plugin for sqlplus......Page 418
Appendix D An Overview of the Nagios Configuration Parameters......Page 424
D.1 The Main Configuration File nagios.cfg......Page 425
D.2 CGI Configuration in cgi.cfg......Page 444
Index......Page 448