The future for Nagios in the enterprise is certainly bright! Nagios 3 Enterprise Network Monitoring can help you harness the full power of Nagios in your organization. Nagios 3 contains many significant new features and updates, and this book details them all for you. Once up and running, you'll see how a number of useful add-ons and enhancements for Nagios can extend the functionality of Nagios throughout your organization. And, if you want to learn how to write your own plugins. . . this is the book for you! In these pages you'll find a cookbook-style chapter full of useful plugins that monitor a variety of devices, from HTTP-based applications to CPU utilization to LDAP servers and more.
- Complete Case Study Demonstrates how to Deploy Nagios Globally in an Enterprise Network
- Monitor Third Party Hardware Devices with Nagios
Inhaltsverzeichnis
1;Front Cover;1 2;Nagios 3 Enterprise Network Monitoring Including Plug-Ins and Hardware Devices;4 3;Copyright Page;5 4;Authors;6 5;Contents;10 6;Foreword;20 7;Introduction;22 7.1;A Brief History of Nagios;22 7.1.1;In the Beginning, There Was Netsaint;22 7.1.2;Enter Nagios 3;23 7.1.3;Nagios in the Enterprisea Flexible Giant Awakens;23 8.1;Whats New in Nagios 3?;27 8.1.1;Storage of Data;27 8.1.1.1;Scheduled Downtime;27 8.1.1.2;Comments;27 8.1.1.3;State Retention;28 8.1.1.4;Status Data;28 8.1.2;Checks;28 8.1.2.1;Service Checks;28 8.1.2.2;Host Checks;29 8.1.2.3;Freshness Checks;29 8.1.3;Objects;29 8.1.3.1;Object Definitions;30 8.1.3.2;Object Inheritance;31 8.1.4;Operation;32 8.1.4.1;Performance Improvements;32 8.1.4.2;Inter-Process Communication (IPC);32 8.1.4.3;Time Periods;32 8.1.4.4;Nagios Event Broker;33 8.1.4.5;Debugging Information;33 8.1.4.6;Flap Detection;33 8.1.4.7;Notifications;34 8.1.5;Usability;34 8.1.5.1;Web Interface;34 8.1.5.2;External Commands;35 8.1.5.3;Embedded Perl;35 8.1.5.4;Adaptive Monitoring;35 8.1.5.5;Plug-in Output;35 8.1.5.6;Custom Variables;36 8.1.6;Macros;36 8.2;Backing up Your Nagios 2 Files;43 8.3;Migrating from Nagios 2 to 3;43 8.3.1;Upgrading Using Nagios 3 Source Code;45 8.3.2;Upgrading from an RPM Installation;47 8.3.3;Converting Nagios Legacy Perl Plug-ins;48 9;Chapter 2: Designing Configurations for Large Organizations;50 9.1;Introduction;51 9.2;Fault Management Configuration Best Practices;51 9.2.1;Solicit Input from Your Users First;51 9.2.2;Use a "Less Is More" Approach;51 9.2.3;Take an Iterative Approach to Growing Your Configuration;52 9.2.3.1;Only Alert on the Most Important Problems;52 9.2.3.2;Let Your Customers and Users Tell You What Is Important;53 9.3;Planning Your Configuration;53 9.3.1;Soliciting Requirements from Your Customers and Users;53 9.3.1.1;Start High-Level and Work Down the Application Stack;54 9.3.1.2;Find Out What Applications Are the Most Important to Your Users;55 9.3.1.3;Find Out What the Most Important In
dicators of Application Failure/Stress Are;55 9.3.1.4;Start By Only Monitoring the Most Critical Indicators of Health/Failure;55 9.3.1.5;Device Monitoring;55 9.3.1.6;Application Monitoring;56 9.4;Nagios Configuration Object Relationship Diagrams;56 9.4.1;Hosts and Services;57 9.4.2;Contacts, Contact Groups, and Time Periods;57 9.4.3;Hosts and Host Groups;58 9.4.4;Services and Service Groups;59 9.4.5;Hosts and Host Dependencies;60 9.4.6;Services and Service Dependencies;61 9.4.7;Hosts and Host Escalations;62 9.4.8;Services and Service Escalations;63 9.4.9;Version Control;64 9.5;Notification Rules and Output Formats;68 9.5.1;Notification via Email;68 9.5.1.1;Minimize the Fluff;68 9.5.1.2;Make Notification Emails Easy to Filter;69 9.5.1.3;Enhancing Email Notifications to Fit Your Users' Environment;69 9.5.2;Notification Via Pager/SMS;75 9.5.2.1;Minimize Included Information;75 9.5.2.2;Only Notify in the Most Important Situations;76 9.5.2.3;Respect Working Hours and Employee Schedules;76 9.5.3;Alternative Notification Methods;76 9.5.3.1;Instant Messenger;76 9.5.3.2;Text-to-Speech;79 9.6;On-Call Schedules;93 9.6.1;Rotating Schedules and Dynamic Notification;93 9.7;Dependencies and Escalations;95 9.7.1;Host and Service Escalation Rules;96 9.7.1.1;Escalate on a Host Level or a Service Level?;96 9.7.2;Host and Service Dependencies;99 9.8;Maximizing Templates;102 9.8.1;How Do We Make a Template?;105 9.8.2;Multiple Hosts;107 9.8.3;Multiple Host Groups;107 9.8.4;Regular Expression Tricks in Config Files;107 10;Chapter 3: Scaling Nagios;110 10.1;Scaling the GUI;111 10.1.1;Rule 1: Only Show Outstanding Problems on Your Primary Display;111 10.1.2;Rule 2: Keep Informational Displays Simple;111 10.1.3;Detailed Information on Parameters Used by status.cgi;113 10.1.3.1;hoststatustypes;114 10.1.3.2;servicestatustypes;114 10.1.3.3;style;114 10.1.3.4;noheader;114 10.2;Limiting the View to Read-Only;117 10.3;Multiple GUI Users (Users/Groups);120 10.3.1;One Administrator, One Shared Read-
Only Account;120 10.3.2;One Administrator, Multiple Read-Only Accounts;120 10.3.3;Multiple Administrators, Multiple Semi-Privileged Accounts, One Read-Only Account;121 10.4;Clustering;121 10.4.1;NSCA and Nagios;124 10.4.2;Passive Service Checking;125 10.4.3;Passive Host Checking;129 10.4.4;Sending Data without NSCA;129 10.5;Failover or Redundancy;130 10.5.1;Redundancy;130 10.5.2;Failover;131 10.5.2.1;Establish Data Synchronization between Two Nagios Servers;131 10.6;The Future;135 10.6.1;Database Persistence;136 10.7;CGI Front End;137 10.7.1;Even More;137 10.7.2;A Pluggable Core;138 11;Chapter 4: Plug-ins, Plug-ins, and More Plug-ins;140 11.1;Introduction;141 11.2;Plug-in Guidelines and Best Practices;141 11.2.1;Use Plug-ins from the Nagios Community;141 11.2.2;Use Version Control;142 11.2.3;Output Performance Data;142 11.3;Software Services and Network Protocols;142 11.3.1;SNMP Plug-ins;142 11.3.2;What SNMP Is Good For;143 11.3.3;What SNMP Is Not Good For;144 11.3.4;Nagios::Plug-in and Nagios::Plug-in::SNMP;144 11.3.5;ePN-The Embedded Nagios Interpreter;151 11.3.5.1;Example;151 11.3.6;Network Devices-Switches, Routers;152 11.3.6.1;CPU Utilization;152 11.3.6.1.1;MIB needed;152 11.3.6.1.2;OIDs needed;153 11.3.6.2;Example Call to the Script;153 11.3.6.3;The Script;153 11.3.6.4;Memory Utilization;157 11.3.6.4.1;MIB needed;157 11.3.6.4.2;OIDs needed;157 11.3.6.5;Example Call;157 11.3.6.6;The Script;158 11.3.6.7;Component Temperature;160 11.3.6.7.1;MIB needed;160 11.3.6.7.2;OIDs needed;160 11.3.6.8;Example Call to the Script;161 11.3.6.9;The Script;161 11.3.6.10;Bandwidth Utilization;166 11.3.6.10.1;MIB needed;166 11.3.6.10.2;OIDs needed;166 11.3.6.11;Example Call to the Script;166 11.3.6.12;The Script;167 11.3.7;Network Interface as Nagios Host?;174 11.3.7.1;Host Definition Example;175 11.4;Servers;175 11.4.1;Basic System Checks;176 11.4.1.1;CPU utilization;176 11.4.1.1.1;MIB needed:;176 11.4.1.1.2;OIDs used:;176 11.4.1.2;Example Call and Output;177 11.4.1.3;The Script;
178 11.4.1.4;RAM utilization;182 11.4.1.4.1;MIB needed;182 11.4.1.4.2;OIDS used;182 11.4.1.5;The Script;182 11.4.1.6;Swap utilization;184 11.4.1.6.1;MIB needed;184 11.4.1.6.2;OIDs used;184 11.4.1.7;Partition Utilization;186 11.4.1.7.1;MIB needed;186 11.4.1.7.2;OIDs needed;186 11.4.1.7.3;Example output;187 11.4.1.8;Load Averages;199 11.4.1.8.1;MIB needed;199 11.4.1.8.2;OIDs used;199 11.4.1.9;Example call and output;200 11.4.1.10;And here is the code for the plug-in;200 11.4.1.11;Number of Processes by State and Number of Processes By Process Type;203 11.4.1.11.1;MIB Needed;203 11.4.1.11.2;OIDs used;203 11.4.1.12;Critical Services by Number of Processes;211 11.4.1.12.1;MIB needed;211 11.4.1.12.2;OIDS used;211 11.4.1.13;The Code for the Script;213 11.5;HTTP Scraping Plug-ins;228 11.5.1;Robotic Network-Based Tests;229 11.5.2;Testing HTTP-based Applications;229 11.5.3;Ensuring the Home Page Performs Well and Has the Content We Expect;230 11.5.4;Ensuring a Search Page Performs as Expected and Meets SLAs;230 11.5.4.1;Example Call to the Script;231 11.5.4.2;The Library (WWW::UltimateDomains);231 11.6;Testing Telnet-like Interfaces (Telnet or SSH);236 11.6.1;Network Devices;236 11.7;Monitoring LDAP;236 11.7.1;Testing Replication;236 11.7.1.1;Example Call to This Script;237 11.7.1.2;The Script;237 11.8;Monitoring Databases;247 11.9;Specialized Hardware;248 11.9.1;Bluecoat Application Proxy and Anti-Virus Devices;248 11.9.1.1;SNMP-based Checks;248 11.9.2;Proxy Devices (SG510, SG800);249 11.9.2.1;CPU Utilization;250 11.9.2.1.1;MIB needed;250 11.9.2.1.2;OIDs used;250 11.9.2.2;Memory Utilization;252 11.9.2.2.1;MIB needed;252 11.9.2.2.2;OIDs used;253 11.9.2.3;Network Interface Utilization;255 11.9.2.3.1;MIB needed;255 11.9.2.3.2;OIDs used;255 11.10;Anti-Virus Devices;258 11.10.1;A/V Health Check;258 11.10.1.1;MIB needed;258 11.10.1.2;OIDs needed;258 11.11;Environmental Probes;260 11.11.1;Complete Sensor Check and Alert Script;261 11.11.1.1;MIB needed;261 11.11.1.2;OIDs used;261 11
.11.1.3;Example call to the script;262 11.12;Summary;269 12;Chapter 5: Add-ons and Enhancements;270 12.1;Introduction;271 12.2;Checking Private Services when SNMP Is Not Allowed;271 12.2.1;NRPE;271 12.2.2;DMZs and Network Security;271 12.2.3;Security Caveats;272 12.2.4;NRPE Details;273 12.2.5;NRPE in the Enterprise;273 12.2.5.1;Scenario 1: The Internet Web Server;273 12.2.6;NSCA;274 12.3;Visualization;275 12.3.1;NagVis;275 12.3.1.1;Enable the Event Broker in Nagios;275 12.3.2;Install the NDO Utils Package;276 12.3.3;Download and Install NagVis, Configure It to Use the Database Back End You Set up with NDO;278 12.4;PNP-PNP Not PerfParse;280 12.5;Cacinda;285 12.6;NLG-Nagios Looking Glass;287 12.7;SNMP Trap Handling;289 12.7.1;Net-SNMP and snmptrapd;289 12.8;SNMPTT;289 12.8.1;Configuring SNMPTT for Maintainability and Configuration File Growth;290 12.9;NagTrap;290 12.10;Text-to-Speech for Nagios Alerts;294 12.11;Summary;296 13;Chapter 6: Enterprise Integration;298 13.1;Introduction;299 13.2;Nagios as a Monitor of Monitors;299 13.3;LDAP Authentication;300 13.3.1;One LDAP User, One Nagios User;300 13.3.2;One LDAP Group, One Nagios User;301 13.4;Integration with Splunk;302 13.5;Integrating with Third-Party Trend and Analysis Tools;303 13.5.1;Cacti;303 13.5.2;eHealth;305 13.6;Multiple Administrators/Configuration Writers;306 13.7;Integration with Puppet;307 13.8;Integration with Trouble Ticketing Systems;308 13.9;Nagios in the NOC;309 13.9.1;The Nagios Administrator;310 13.9.2;The Nagios Software;310 13.9.3;Integration;311 13.9.4;Deployment;311 13.9.5;Maintenance;312 13.9.6;The Process;312 13.9.7;The Operations Centers;313 13.9.7.1;The Enterprise NOC;313 13.9.8;The Incident;316 13.9.9;Ongoing Maintenance;317 13.9.10;Smaller NOCs;317 13.10;Summary;319 14;Chapter 7: Intrusion Detection and Security Analysis;320 14.1;Know Your Network;321 14.1.1;Security Tools under Attack;321 14.1.2;Enter Nagios;322 14.1.3;Attackers Make Mistakes;323 14.1.3.1;NSClient++ Checks for Windows;32
3 14.1.3.2;Securing Communications with NSClient++;325 14.1.4;Security Checks with NRPE for Linux;326 14.1.4.1;check_load;326 14.1.4.2;check_users;326 14.1.4.3;check_total_procs;327 14.1.4.4;check_by_ssh;327 14.2;Watching for Session Hijacking Attacks;327 14.2.1;DNS Attacks;327 14.2.2;Arp Cache Poisoning Attacks;328 14.3;Nagios and Compliance;331 14.3.1;Sarbanes-Oxley;331 14.3.2;SOX and COBIT;332 14.3.3;SOX and COSO;332 14.3.4;Payment Card Industry;333 14.3.5;DCID 6/3;333 14.3.6;DIACAP;335 14.3.7;DCSS-2 System State Changes;335 14.4;Securing Nagios;335 14.4.1;Hardening Linux and Apache;336 14.4.2;Basics;337 14.5;Summary;339 15;Chapter 8: Case Study: Acme Enterprises;340 15.1;Case Study Overview;341 15.1.1;Who Are You?;341 15.2;ACME Enterprises Network: Whats under the Hood?;341 15.3;ACME Enterprises Management and Staff: Whos Running the Show?;343 15.4;ACME Enterprises and Nagios: Rubber Meets the Road!;344 15.5;Nagios Pre-Deployment Activities: What Are We Monitoring?;346 15.6;Nagios Deployment Activities: Can You See Me?;353 15.7;Enterprise and Remote Site Monitoring;355 15.8;eHealth;356 15.8.1;NagTrap;357 15.8.2;NagVis;357 15.8.3;Puppet;358 15.8.4;Splunk;358 15.9;Host and Service Escalations, and Notifications;358 15.9.1;Service Escalations;359 15.9.2;Notification Schemes;359 15.10;Nagios Configuration Strategies;359 15.10.1;DMZ Monitoring-Active versus Passive Checking;359 15.10.1.1;Why Passive Service Checks?;359 15.10.2;Why Active Service Checks?;360 15.10.3;NRPE and ACME Enterprises;360 15.11;Developer, Corporate, and IT Support Network Monitoring;361 15.11.1;NSCA to the Rescue!;361 15.11.2;NRPE Revisited;361 15.12;Select Advice for Integrating Nagios as the Enterprise Network Monitoring Solution;362 15.12.1;The Nagios Software;363 15.13;Nagios Integration and Deployment;364 16;Index;366