Chapter 5. Monitoring Methods

In this chapter, we will cover the following topics:

  • Monitoring PING for any host
  • Monitoring SSH for any host
  • Checking an alternative SSH port
  • Monitoring mail services
  • Monitoring web services
  • Checking that a website returns a given string
  • Monitoring database services
  • Monitoring the output of an SNMP query
  • Monitoring a RAID or other hardware device
  • Creating an SNMP OID for monitoring

Introduction

Nagios Core is best thought of as a monitoring framework that uses plugins to perform appropriate checks on hosts and services, and returns results about their states in a format that it understands and can use for sending notifications and keeping track of states on a longer term basis.

The design is quite flexible; as explained in the "Commands and Plugins" chapter, Nagios Core can use as a plugin any command-line application that gives appropriate return values as defined in the Nagios Core header files, Perl library, or shell script. In turn, Nagios Core can be configured to use the same plugin in many different ways, taking advantage of any switches provided by the plugin to adjust its behavior, including providing metadata to it in the form of the values of Nagios Core macros like $HOSTADDRESS$.

The collection of plugins available on the Nagios Exchange website at https://exchange.nagios.org/ is fairly large and documenting all of them is well out of the scope of this book. However, some of the most useful plugins are included as part of the Nagios Plugins set and are installed as part of the recommended quick start guides for Nagios Core at https://assets.nagios.com/downloads/nagioscore/docs/nagioscore/4/en/. They include programs for monitoring very common network features in typical ways, such as monitoring basic network connectivity, web services, mail servers, and other very common network properties and services. The plugin site itself is at https://nagios-plugins.org/.

This chapter will demonstrate the usage of some of the most useful components of this plugin set, which it assumes you have already installed. The focus will be on monitoring tasks that will be relevant to most or even all networks of various sizes, hopefully bringing the reader well past the point of thinking of Nagios Core as merely a process for sending PING requests. The last few recipes will show how you can use the Simple Network Management Protocol (SNMP) as a method of checking any generic network service or system property that may not be covered by the standard Nagios Plugins set.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.15.25.32