That it meaning is correct and certainly will indeed perform the job. But what for those who after decide to add yet another online server? Are you willing to view it much easier to define a different sort of (nearly identical) demand, with only the brand new Ip address altered? It is a whole lot more effective when deciding to take advantage of macros of the composing 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.
In addition to the of these you will find simply seen, Nagios provides various other of use macros. Excite make reference to the papers getting reveal set of all of the readily available macros as well as their validity perspective. Below is actually a sample selection of demand significance.
3.3 Contact 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_demand and service_notification_demand directives must be command objects.
3.4 Machine meaning
We now have eventually reach probably one of the most crucial elements of Nagios arrangement: the phrase the brand new hosts (host, workstations, products, etcetera.) we want their website to screen. This may lead me to introduce one of the most powerful attributes of Nagios setting: . Remember that, whether or not we have been revealing it now earliest, target heredity pertains to all the Nagios items; yet not, it’s about definition of machines and characteristics that one may get the maximum benefit from it.
Indeed, configuring a breeding ground needs installing many variables; therefore the worth of this type of variables will normally end up being the exact same for most servers. Rather than object heredity, this will indicate throwing away a lot of time entering an identical variables more than once and eventually finding yourself with messy, over weight and you may almost unmanageable setting files.
But luckily for us, Nagios makes sense adequate to help save you numerous entering by allowing one identify special stuff, whoever services might be “inherited” from the other objects without having to write her or him. Below was a brief instance of exactly how a theme is made:
- every template must be assigned a name 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 might be left , we.elizabeth. 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:
Better, today why don’t we go from concept to train and identify two server themes for our server. Note that next you to definitely inherits on the earliest; this is certainly possible due to the fact Nagios lets multiple 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.
3.5 Solution 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: