Which meaning is correct and certainly will certainly do the job. But what if you later on intend to add an alternate web machine? Do you really notice it much easier to establish an alternative (nearly identical) demand, with only the new Ip address altered? It is a great deal more effective when planning on taking benefit of macros because of the creating one generic order including:
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 PЕ™Гklady profilu the perfect match plugins directory.
Also the of them we have just seen, Nagios brings several other of use macros. Please reference the fresh paperwork to own reveal a number of all readily available macros in addition to their validity perspective. Below are a sample band of order definitions.
3.step three Contact definition
contact 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_several months and service_notification_months directives must be timeperiod objects; and the values of the host_notification_demand and service_notification_demand directives must be command objects.
step 3.4 Server meaning
We have now ultimately reach one of the most very important facets of Nagios setup: the expression the computers (server, workstations, gadgets, etcetera.) that we need certainly to display. This will direct us to present perhaps one of the most effective options that come with Nagios setting: . Remember that, even when our company is sharing it now earliest, target genetics pertains to every Nagios things; yet not, it’s in the definition of machines and properties that you can get the maximum benefit from the jawhorse.
In reality, configuring a breeding ground needs creating plenty of variables; additionally the property value such parameters will normally function as exact same for most computers. Instead of target genetics, this should suggest throwing away much time typing a similar parameters over and over again and in the end finding yourself having messy, fat and you can almost uncontrollable configuration data.
But the good news is, Nagios is sensible adequate to save you enough typing by permitting one describe special objects, whoever functions shall be “inherited” because of the most other things without the need to write him or her. Lower than try a short example of how a layout is made:
- every template must be assigned a term 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 you won’t need to explicitely override it in all “children” objects;
- a layout target would be leftover , i.e. it 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, now why don’t we move from concept to rehearse and you will explain a couple of server layouts for the machine. Note that the following one inherits regarding first; this is exactly possible as Nagios allows multiple quantities of layout 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.
3.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: