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

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.

主站蜘蛛池模板: 库尔勒市| 桦川县| 大名县| 枣阳市| 托里县| 樟树市| 茂名市| 皮山县| 建平县| 日照市| 仙桃市| 宣恩县| 凤台县| 上杭县| 珠海市| 宜黄县| 闽侯县| 抚远县| 米易县| 柳江县| 大渡口区| 永寿县| 皋兰县| 南召县| 昌图县| 达尔| 安乡县| 闵行区| 海淀区| 四川省| 阿拉善左旗| 建瓯市| 巨鹿县| 根河市| 老河口市| 霍林郭勒市| 泽普县| 招远市| 封开县| 田阳县| 阳曲县|