THỨ TƯ,NGÀY 22 THÁNG 4, 2020

Once you’ve determined the root logic of its “object-oriented” setting, you’ll delight in Nagios’ flexibility and you can brush construction

Bởi Nguyễn Hoàng Phong

Cập nhật: 01/09/2022, 08:20

Once you’ve determined the root logic of its “object-oriented” setting, you’ll delight in Nagios’ flexibility and you can brush construction

dos.2 Arrangement assessment

Nagios configuration may look overly complicated at first glance; even the documentation warns that Nagios is quite powerful and flexible, but it can take a lot of work to get it configured just the way you’d like . Anyway, don’t despair! For the first tests, you can start by tweaking the sample configuration files contained in the /usr/local/share/examples/nagios/ directory, customizing them to your needs.

  • comments start with BDSM dating sites a “#” character and span to the end of the line;
  • changeable brands have to initiate in the beginning of the line (i.elizabeth. no indentation allowed);
  • varying labels are situation delicate;
  • no spaces are allowed around the “=” sign.

Setup involves means several details towards overseeing daemon, brand new CGIs and you may, without a doubt, the newest machines and services you want to screen. All of this data is pass on among multiple documents: we’re going to now take a look at him or her one by one.

dos.2.1 The main arrangement file

The overall behaviour of the Nagios daemon is determined by the directives included in the main configuration file, /var/www/etc/nagios/nagios.cfg. Though this file contains several dozens of parameters, for most of them the default value is the most reasonable option and you will probably want to care about only very few of them (usually cfg_document, cfg_dir and admin_email). In any case, you can find a detailed description of each and every parameter in the official documentation.

dos.2.dos The newest money file

The allows you to assign values to the user-definable macros “$Associate letter $” (where n is a number between 1 and 32 inclusive). Basically, in Nagios, macros are variables (starting and ending with a dollar sign, “$“) that you can insert into command definitions and that will get expanded to the appropriate value immediately prior to the execution of the command. User-described macros (and the several other macros Nagios makes available) allow you to keep command definitions generic and simple (see the next chapter for some examples).

User-defined macros are normally used to store recurring items in command definitions (like directory paths) and sensitive information (like usernames and passwords). It is recommended that you set restrictive permissions (600) on the resource file(s) in order to keep sensitive information protected.

The next thing is configuring target research, which is even the trickiest area of the arrangement. We are going to hence put in the second section completely to that material.

3.0 Object study setting

Now it is time to tell Nagios what to remain tabs for the. For this reason, we should instead have they with advice about:

  • whenever and the ways to perform monitors and you may send-out notifications;
  • whom to help you alert;
  • and this hosts and you will attributes observe.

All this information is represented by means of , which are defined by a set of “define” , enclosed in curly braces and containing a variable number of newline-separated , in keyword/value form. Keywords are separated from values by whitespace and multiple values can be separated by commas; indentation within statements is allowed.

Object definitions can be split into any number of files: just remember to list them all in the main configuration file by using the cfg_document and/or cfg_dir directives.

step three.step one Timeperiod meaning

The timeperiod statement allows you to specify, for each day of the week, one or more time slots in which to run certain checks and/or notify certain people. Time intervals can’t span across midnight and excluded days are simply omitted.

In the following example, all the timeperiod definitions are grouped together in a file named timeperiods.cfg stored in the /var/www/etc/nagios/ directory.

3.2 Command meaning

The next step is to tell Nagios how to perform the various checks and send out notifications; this is accomplished by defining multiple command objects specifying the actual commands for Nagios to run.

Bình luận

Tôn trọng lẫn nhau, hãy giữ cuộc tranh luận một cách văn minh và không đi vượt quá chủ đề chính. Thoải mái được chỉ trích ý kiến nhưng không được chỉ trích cá nhân. Chúng tôi sẽ xóa bình luận nếu nó vi phạm Nguyên tắc cộng đồng của chúng tôi

Chưa có bình luận. Sao bạn không là người đầu tiên bình luận nhỉ?

SEARCH