Imagine we want to monitor a web site host with Internet protocol address “1

0
190

Imagine we want to monitor a web site host with Internet protocol address “1

So it definition is right and can yes do the job. Exactly what for many who afterwards want to put a different internet servers? Is it possible you view it simpler so you’re able to describe a new (nearly the same) order, in just the newest Ip address altered? It is much more effective when planning on taking advantage of macros from the creating one generic order such as for example:

and leave Nagios the responsibility to expand the built-in $HOSTADDRESS$ macro to the appropriate IP address, obtained from the host definition (see below). As you’ll remember from the previous chapter, the $USER1$ macro holds the path to the plugins directory.

As well as the of those we have just viewed, Nagios brings other beneficial macros. Please refer to the newest papers to possess an in depth selection of most of the available macros and their legitimacy perspective. Lower than is an example group of demand definitions.

3.step three Contact meaning

get in touch with objects allow you to specify people who should be notified automatically when the alert conditions are met. Contacts are first defined individually and then grouped together in contactgroup objects, for easier management.

For the first time, in the following definitions, we will refer to previously defined objects. In fact, the values of the host_notification_period and service_notification_several months directives must be timeperiod objects; and the values of the host_notification_demand and service_notification_order directives must be command objects.

step 3.4 Host meaning

We now have ultimately visited perhaps one of the most extremely important areas of Nagios setup: the word the fresh computers (servers, workstations, gizmos, etc.) that we need to display. This will lead me to establish probably one of the most strong top features of Nagios configuration: . Observe that, regardless if we have been sharing they today earliest, object inheritance relates to all Nagios things; however, it is on the concept of servers and you may characteristics that one may obtain the most from it.

Actually, configuring an atmosphere needs setting-up quite a few details; and also the property value such details will generally function as same for the majority hosts. Instead of object inheritance, this would indicate throwing away long typing an identical details over and over again and eventually finding yourself with messy, overweight and you can almost uncontrollable configuration records.

But thank goodness, Nagios makes sense sufficient to help save you lots of typing by permitting one define special objects, whoever properties might be “inherited” by almost every other things without having to write him or her. Below was a quick exemplory instance of just how a template is established:

  • every template must be assigned a title with the name directive;
  • since this is not an actual host, you must tell Nagios not to it by setting the value of the register directive to 0; this property doesn’t get inherited and defaults to 1, so live escort reviews New York City NY you won’t need to explicitely override it in all “children” objects;
  • a layout object would be left , i.elizabeth. they eters.

To create an actual host object from a template, you simply have to specify the template name as the value of the use directive and make sure that all mandatory fields are either inherited or explicitely set:

Well, today let us go from principle to train and explain several server themes for our host. Note that the second you to inherits from the earliest; this might be possible just like the Nagios allows several quantities of layout stuff.

Hosts can optionally be grouped together with the hostgroup statement, which has no effect on monitoring, but simply allows you to display the hosts in groups in the CGIs.

step three.5 Service definition

Configuring the services to monitor is much like configuring hosts: object inheritance can save you a lot of typing and you can group services together with the optional servicegroup statement. Below is the definition of our service template: