Which meaning is right and will yes do the job. Exactly what for those who after plan to include yet another net host? Is it possible you view it convenient so you’re able to determine a special (nearly identical) demand, in just the fresh new Ip altered? It’s far more successful to take benefit of macros by the creating just one simple order such:
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.
In addition to the of these we have only seen, Nagios brings several other beneficial macros. Delight make reference to brand new records to possess a detailed list of all of the available macros in addition to their authenticity framework. Below try a sample band of command significance.
step three.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_period and service_notification_several months directives must be timeperiod objects; and the values of the host_notification_order and service_notification_command directives must be command objects.
3.cuatro Host meaning
Now we have in the end started to probably one of the most extremely important facets of Nagios setting: the term the fresh machines (servers, workstations, products, etcetera.) that people have to display screen. This will lead us to expose probably one of the most effective top features of Nagios setting: . Keep in mind that, though we are revealing they today very first, object inheritance applies to all of the Nagios objects; not, it’s throughout the definition of machines and you may functions as you are able to get the most from it.
In fact, configuring an atmosphere needs installing lots of variables; and also the worth of such parameters will normally function as the exact same for the majority machines. Versus target genetics, this would imply wasting much time typing a similar variables over and over again and finally finding yourself which have messy, heavy and you can nearly unmanageable setting documents.
But luckily, Nagios makes sense adequate to help save you plenty of typing by allowing one to explain unique stuff, whoever attributes should be “inherited” by almost every other things without having to rewrite her or him. Lower than was a brief illustration of just how a template is made:
- every template must be assigned a label 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 layout object might be 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:
Well, today let’s move from theory to train and you can establish a few servers layouts in regards to our server. Observe that next one to inherits regarding the first; this is certainly you’ll be able to given that Nagios lets several quantities of template things.
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 Provider 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: