Which meaning is correct and certainly will certainly get the job done. Exactly what if you afterwards want to add another web machine? Would you see it much easier to determine a unique (almost similar) order, in just the fresh new Ip changed? It is a great deal more effective to take benefit of macros by creating a single common demand 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 check my source well as the of these i have just viewed, Nagios provides various other of use macros. Excite relate to the latest paperwork having reveal directory of all readily available macros as well as their legitimacy perspective. Less than try a sample selection of order meanings.
step 3.step three Contact definition
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_several months and service_notification_period directives must be timeperiod objects; and the values of the host_notification_order and service_notification_command directives must be command objects.
3.4 Machine definition
Now we have fundamentally visited perhaps one of the most extremely important aspects of Nagios setup: the phrase the fresh servers (host, workstations, equipment, etc.) that people should display. This can lead me to introduce probably one of the most effective features of Nagios setup: . Note that, even though we are discussing it today earliest, object heredity applies to all the Nagios objects; however, it is regarding concept of computers and you can qualities to get the maximum benefit from the jawhorse.
Actually, configuring an environment needs setting up many details; plus the worth of these types of parameters will normally function as the exact same for some servers. In the place of target genetics, this will suggest throwing away a lot of time typing the same parameters more than once and in the end ending up with messy, fat and almost unmanageable arrangement files.
But luckily, Nagios is smart adequate to save enough entering by permitting you to definitely determine unique objects, whoever attributes are going to be “inherited” because of the almost every other things without the need to rewrite them. Below was a brief example of how a layout is established:
- 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 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 object shall be left , 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:
Really, today why don’t we go from concept to practice and you may determine a few machine layouts for the machine. Keep in mind that the next you to inherits regarding very first; this is you can while the Nagios allows several quantities of template 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 three.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:
