Guess you want to screen a web machine having Ip «1
That it meaning is right and will indeed perform the job. But what if you later on propose to incorporate an alternative internet machine? Might you view it simpler so you can determine an alternate (nearly identical) order, in just the brand new Ip address changed? It is a great deal more successful when deciding to take benefit of macros of the creating an individual universal order like:
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.
Also the of them we have just viewed, Nagios brings several other useful macros. Please consider this new papers getting an Barrie hookup in depth variety of most of the offered macros as well as their validity framework. Below try an example set of order definitions.
3.step three Get in touch with meaning
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_months 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.
step 3.cuatro Server definition
We now have in the long run started to one of the most important facets of Nagios arrangement: the definition of the latest hosts (servers, workstations, gadgets, an such like.) that individuals should display. This may direct me to present one of the most strong options that come with Nagios setup: . Note that, though our company is sharing it now earliest, target genetics relates to the Nagios stuff; not, it’s throughout the concept of servers and you can services that one can get the maximum benefit from it.
Actually, configuring a breeding ground requires starting countless parameters; additionally the property value such details will generally function as same for most computers. In place of target genetics, this should mean throwing away a lot of time typing a comparable variables more often than once and ultimately winding up which have cluttered, obese and nearly uncontrollable setup data.
However, luckily for us, Nagios is smart enough to help save you a great amount of entering by allowing one to determine unique things, whose characteristics are «inherited» by the most other things without having to write him or her. Less than are a short illustration of how a theme is established:
- 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 template object is leftover , i.age. 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, now why don’t we go from idea to practice and you will explain two server layouts in regards to our server. Remember that next that inherits throughout the first; this will be you can as the Nagios allows several amounts of template 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 3.5 Services 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: