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

Chapter 4. Overview of Nagios Plugins

Nagios' strength comes from its ability to monitor servers and the services they offer in a large number of ways. What's more interesting is that all of these ways make sure that your services are provided as functional, are external plugins, and work in quite an easy way. Many of these are even shipped with Nagios, as we mentioned in Chapter 2, Installation and Configuration. Therefore, it is possible to either use existing plugins or write your own.

The previous chapter discussed basic configuration of host and service checking. Nagios can be set up to check if your services are up and running. This chapter describes how these checks work in more detail. It also introduces some of the Nagios plugins that are developed as a part of Nagios, and as a part of the Nagios Plugins project.

Nagios performs checks by running an external command, and uses the return code, along with output from the command, as information on whether the check worked or not. It is the command's responsibility to verify if a host or service is working at the time the command is invoked.

Nagios itself handles all of the internals, such as scheduling the commands to be run, storing their results, and determining what the status is for each host and service.

Nagios requires that all plugins follow a specific, easy-to-follow behavior in order for them to work smoothly. These rules are common for both host checks and service checks. It requires that each command returns specific result codes, which are:

Standard output from the command is not parsed in any way by Nagios. It is usually formatted in the following way:

PLUGIN STATUS - status description

Usually, the status description contains human-readable information that is visible using the web interface. Some sample outputs from various plugins and states are:

PING OK - Packet loss = 0%, RTA = 0.18 ms
DNS WARNING: 0.015 seconds response time
DISK CRITICAL - free space: /boot 18 MB (8% inode=99%)

Nagios plugins use options for their configuration. It is up to the plugin author's host to parse these options. However, most commands that come as part of the Nagios Plugins package use standard options and support the -h or --help options to provide a full description of all the arguments they accept.

Standard Nagios plugins usually accept the following parameters:

Commands that verify various daemons also have a common set of options. Many of the networking-related plugins use the following options in addition to the preceding standard ones

This chapter describes the commands provided by a standard distribution Nagios Plugins and is based on version 1.4.10. Before using specific options for a command, it is recommended that you use the --help option and familiarize yourself with the functionality available on your Nagios installation.

All plugins have their nonstandard options, described in more detail in this chapter. All commands described in this chapter also have a sample configuration for the Nagios check command. Even though some longer definitions might span multiple lines, please make sure that you put it on a single line in your configuration. Some of the plugins already have their command counterparts configured with the sample Nagios configuration that is installed along with Nagios. Therefore, it is also worth checking if your commands.cfg file contains a definition for a particular command.

主站蜘蛛池模板: 麻城市| 沽源县| 湘阴县| 云阳县| 卫辉市| 彰武县| 新源县| 精河县| 玉山县| 武城县| 桂东县| 嘉荫县| 乌海市| 贵南县| 泗水县| 娱乐| 施秉县| 新巴尔虎右旗| 城步| 成都市| 神池县| 新泰市| 莒南县| 鄄城县| 龙南县| 上饶市| 东平县| 舞钢市| 荔波县| 芷江| 察隅县| 紫云| 沁水县| 吕梁市| 柘荣县| 青岛市| 开原市| 高邑县| 巍山| 普兰县| 禹州市|