How to set up Icinga2 agent monitoring

12

Buy Organic Traffic | Cheap Organic Traffic | Increase Organic Traffic | Organic Traffic


Picture: Jack Wallen

Icinga2 is an impressive open supply device for monitoring all your information middle servers. With this device, you’ll be able to empower your IT employees to handle points earlier than they snowball into one thing a lot bigger. Out of the field, Icinga2 makes this process considerably simpler, but the straightforward methodology of configuring a node within the hosts.conf file will not be as safe as you may like.

With a bit of labor, Icinga2 can monitor a knowledge middle node’s inside well being parameters (akin to CPU load, disk house, reminiscence, and the variety of working processes) through a secured channel grasp/consumer setup.

I’ll configure an Icinga2 grasp/consumer arrange. I will use Ubuntu Server for each situations and can assume you have already got Icinga2 up and working on the grasp. (See: The way to set up the Icinga2 Monitoring device on Ubuntu Server 16.04 and The way to add distant hosts to the Icinga2 monitoring system.)

SEE: Configuration administration coverage (Tech Professional Analysis)

Let’s set up.

Organising the grasp

The very first thing to do is configure the grasp. My grasp is at IP deal with 192.168.1.193. You will need to know the complete hostname of each grasp and consumer. The hostname of my grasp is ubuntu16.04 (subject the command much less /and so on/hosts to seek out yours). The hostname of my take a look at consumer is localhost.localdomain. As that is just for testing functions, it is okay to make use of localhost.localdomain. Don’t, nonetheless, use this to your servers.

Although you have already got Icinga2 up and working, you continue to must run the arrange for it to be a grasp to an agent. Happily, that is fairly easy. Log into your Icinga2 server and subject the command:

sudo icinga2 node wizard

You may be requested a couple of straightforward questions (solutions are in caps):

Please specify if it is a satellite tv for pc setup ('n' installs a grasp setup) [Y/n]: N
Please specify the widespread identify (CN) [icinga]: HOSTNAME OF SERVER
Please specify the API bind host/port (optionally available): LEAVE BLANK
Bind Host []: LEAVE BLANK
Bind Port []: LEAVE BLANK

When the above completes, restart the Icinga2 service with the command:

sudo systemctl restart icinga2

Now we have now to generate a consumer ticket to your node. Concern the command:

icinga2 pki ticket --cn 'NODE_NAME'

The place NODE_NAME is the complete hostname of your consumer (in my case, localhost.localdomain). It is crucial that you simply get this proper, in any other case the Icinga2 consumer will not be capable to connect with the grasp. Copy the generated string.

Organising the consumer

Transfer over to the consumer you need to connect with the grasp. If Icinga2 is not put in on this server, achieve this with the command:

sudo apt-get set up icinga2 -y

As soon as it is put in, run the node wizard with the command:

sudo icinga2 node wizard

Reply the questions as proven in caps:

Please specify if it is a satellite tv for pc setup ('n' installs a grasp setup) [Y/n]: Y
Please specify the widespread identify (CN) [localhost.localdomain]: LEAVE BLANK
Grasp Frequent Identify (CN out of your grasp setup): HOSTNAME OF MASTER
Do you need to set up a connection to the dad or mum node? From this node [Y/n]: y
Grasp endpoint host (Your grasp's IP deal with or FQDN): MASTER IP
Grasp endpoint port [5665]: LEAVE BLANKAdd extra grasp endpoints? [y/N]: n
Please specify the grasp connection for CSR auto-signing (defaults to grasp endpoint host): LEAVE BLANK
Host [10.25.32.120]: LEAVE BLANK
Port [5665]: LEAVE BLANK

The place:

  • HOSTNAME OF MASTER is the complete hostname of the grasp server.
  • MASTER IP is the IP deal with of the grasp
  • LEAVE BLANK means to easily hit Enter in your keyboard

You’ll then be requested if the knowledge is appropriate. Sort y and hit Enter in your keyboard. Subsequent you may be requested to stick the PKI key out of your server (Determine A). Do that and hit Enter in your keyboard.

Determine A

Figure AFigure A

Including the grasp PKI key to the consumer.

Lastly, you may be requested one other quick spherical of questions:

Please specify the API bind host/port (optionally available): LEAVE THIS BLANK
Bind Host []: LEAVE THIS BLANK
Bind Port []: LEAVE THIS BLANK
Settle for config from grasp? [y/N]: y
Settle for instructions from grasp? [y/N]: y

As soon as you have answered the above, restart the Icinga2 daemon on the node with the command:

sudo systemctl restart icinga2

Create the configuration recordsdata

Subsequent we have to create a brand new listing to accommodate a few configuration recordsdata. Concern the command:

sudo mkdir /and so on/icinga2/zones.d/NODE_NAME

The place NODE_NAME is the identify of your node (for my instance, localhost.localdomain).

Subsequent create the 2 configuration recordsdata, with the instructions:

sudo contact /and so on/icinga2/zones.d/NODE_NAME/NODE_NAME.conf
sudo contact /and so on/icinga2/zones.d/NODE_NAME/providers.conf

The place NODE_NAME is the identify of your node (for my instance, localhost.localdomain)

Within the NODE_NAME.conf file, paste the next:

object Zone "NODE_NAME" 

object Endpoint "NODE_NAME" 

object Host "NODE_NAME" 

The place NODE_NAME is the identify of the node, SERVER_NODE is the identify of the Icinga2 grasp, and NODE_IP is the IP deal with of the node. Save and shut that file.

Subsequent, within the providers.conf file, paste the next:

apply Service "load" 

apply Service "procs" 

Save and shut that file.

As soon as you have taken care of that, restart Icinga2 with the command:

sudo systemctl restart icinga2

After a second, the brand new agent will seem, and Icinga2 will begin monitoring it with greater than only a ping take a look at, utilizing a safer methodology of connection (than simply a normal hosts.conf configuration).

Should you discover the node is not displaying up, refer again to The way to add distant hosts to the Icinga2 monitoring system.

Additionally see

Buy Website Traffic | Cheap Website Traffic | Increase Website Traffic | Website Traffic



Source link