Assume we should monitor an internet machine having Ip address “step one

Assume we should monitor an internet machine having Ip address “step one

So it definition is right and will indeed work. Exactly what for people who afterwards plan to incorporate an alternate websites machine? Is it possible you notice it easier in order to define an alternate (almost identical) order, in just the latest Ip address altered? It is more successful to take advantageous asset of macros by the composing just one universal order such as:

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 ones we have just seen, Nagios provides some other useful macros. Delight relate to this new documentation to own reveal selection of all of the offered macros in addition to their legitimacy framework. Less than is actually an example selection of demand meanings.

3.step 3 Get in touch with 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_months and service_notification_period directives must be timeperiod objects; and the values of the host_notification_command and service_notification_demand directives must be command objects.

step three.cuatro Servers meaning

We now have eventually arrive at perhaps one of the most important facets of Nagios setup: the expression the latest hosts (machine, workstations, gadgets, etcetera.) that we should display screen. This can lead us to establish perhaps one of the most powerful features of Nagios configuration: . Note that, even though we’re revealing they now very first, object genetics applies to most of the Nagios objects; but not, it’s about concept of machines and you can functions that you could get the most out of it.

Actually, configuring an environment demands establishing quite a few parameters; while the value of these variables will generally function as exact same for many hosts. As opposed to object heredity, this will imply throwing away much time typing an identical variables more often than once and eventually finding yourself that have messy, fat and almost uncontrollable arrangement files.

However, thank goodness, Nagios is smart enough to help you save loads of typing by allowing one explain special items, whoever properties would be “inherited” of the other things without having to rewrite them. Lower than is a brief illustration of just how a template is done:

  • every template must be assigned a identity with the name directive;
  • since this is not an actual host, you must tell Nagios not to it by setting the value of the check in directive to 0; this property doesn’t get inherited and defaults to 1, so you won’t need to explicitely override it in all “children” objects;
  • a theme object are kept , we.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:

Better, now let’s go from concept to train and determine a couple of server templates in regards to our servers. Note that another one to inherits regarding very first; this is you can easily since Nagios allows numerous levels of theme items.

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 3.5 Service meaning

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: