Suppose we wish to screen a web site host which have Ip “step 1

Suppose we wish to screen a web site host which have Ip “step 1

It definition is right and will yes do the job. But what for individuals who afterwards decide to add a new net machine? Could you notice it easier to help you define an alternative (almost the same) order, in just the fresh Ip address changed? It is even more productive to take advantage of macros by the composing an individual generic order particularly:

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.

And the of them we have only seen, Nagios brings another of use macros. Excite make reference to the latest paperwork having a detailed set of all of the offered macros as well as their validity perspective. Below is a sample gang of command significance.

step 3.3 Get in touch with 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_months and service_notification_period directives must be timeperiod objects; and the values of the host_notification_demand and service_notification_command directives must be command objects.

3.4 Machine definition

We now have ultimately arrive at one of the most important aspects of Nagios configuration: the word the fresh new hosts (host, workstations, equipment, an such like.) that people need to display. This will lead us to expose probably one of the most powerful popular features of Nagios configuration: . Keep in mind that, whether or not we’re discussing it today very first, object inheritance applies to all the Nagios stuff; although not, it is from the concept of hosts and you will qualities as possible get the most from the jawhorse.

In fact, configuring a host need setting-up plenty details; in addition to property value these parameters will normally function as same for many hosts. Versus target genetics, this will indicate wasting a lot of time typing an identical parameters over and over again and in the end ending up having messy, over weight and you may almost unmanageable configuration documents.

But fortunately, Nagios makes sense sufficient to save a great amount of entering by permitting you to describe special stuff, whoever functions shall be “inherited” by the other items without having to rewrite her or him. Less than are a brief illustration of just how a layout is made:

  • every template must be assigned a title 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 theme object is going to be remaining , 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 let’s move from concept to practice and you will identify one or two machine layouts for the host. Observe that another you to definitely inherits about basic; this might be you’ll due to the fact Nagios lets numerous quantities of theme 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 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:

Bir cevap yazın

E-posta hesabınız yayımlanmayacak. Gerekli alanlar * ile işaretlenmişlerdir

Başa dön