官术网_书友最值得收藏!

Introduction

Nagios Core is perhaps best thought of less as a monitoring tool and more as a monitoring framework. Its modular design allows any kind of program that returns appropriate values based on some kind of check as a check_command for a host or service, for use to ensure that a host or service is still responsive and functioning correctly. This is where the concepts of commands and plugins come into play.

For Nagios Core, a plugin is any program that can be used to gather information about a host or service. To ensure that a host is responding to PING requests, we'd use a plugin such as check_ping, which when run against a hostname or address—whether by Nagios Core or not—returns a status code to whatever called it, based on whether a response was received to the PING request within a certain period of time. This status code and any accompanying message is what Nagios Core uses to establish what state a host or service is in.

Plugins are generally just like any other program on a Unix-like system; they can be run from the command line, are subject to permissions and owner restrictions, can be written in any language, can read variables from their environment, and can take parameters and options to modify how they work. Most importantly, they are entirely separate from Nagios Core itself (even if programmed by the same people) and the way in which they're used by the application can be changed.

To allow additional flexibility in how plugins are used, Nagios Core uses these programs according to the terms of a command definition. A command for a specific plugin defines the way in which that plugin is used, including its location in the filesystem, any parameters that should be passed to it, and any other options. In particular, parameters and options often include thresholds for the WARNING and CRITICAL states.

Nagios Core is usually downloaded and installed alongside a set of plugins called Nagios Plugins, which are available at https://nagios-plugins.org/, which this book assumes you have installed. These plugins were chosen because, as a set, they cover the most common needs for a monitoring infrastructure quite well. These common needs include checks for common services, such as web services, mail services, DNS services, and others. They also perform more generic checks, such as whether a TCP or UDP port is accessible and open on a server. It's possible that for most, if not all, of our monitoring needs, we won't need any other plugins. However, if we do need other plugins, Nagios Core makes it possible for us to use the existing plugins in novel ways using custom command definitions, to add third-party plugins written by contributors on the Nagios Exchange website, or even to write custom plugins ourselves from scratch in some special cases.

主站蜘蛛池模板: 郸城县| 襄樊市| 莲花县| 滦南县| 隆安县| 凤庆县| 广昌县| 大田县| 武宁县| 定远县| 耒阳市| 马公市| 武邑县| 普宁市| 海阳市| 江油市| 滁州市| 竹北市| 攀枝花市| 疏勒县| 象山县| 清丰县| 孟津县| 朝阳县| 二连浩特市| 筠连县| 垦利县| 马公市| 万荣县| 杭锦旗| 宕昌县| 闽清县| 保德县| 马鞍山市| 湘阴县| 拉萨市| 县级市| 哈尔滨市| 闽侯县| 大名县| 泽州县|