How to add remote hosts to the Icinga2 monitoring system

Impression: Jack Wallen

Icinga2 is an excellent, company-course, knowledge middle server monitoring device. With this resource up and managing (How to set up the Icinga2 Monitoring device on Ubuntu Server 16.04), you can remain apprised on what is occurring with your servers from a central site. This can make it easy for you to keep track of general performance and products and services in serious time, and even be notified of outages.

The a person caveat to Icinga2 is that it would not supply a means to include hosts, by means of the internet-based GUI. Simply because of that, you need to manually insert any server to be monitored, by using the terminal window. Fortunately, that process is not terribly hard, but it does have to have you to get the job done from the command line.

Let’s wander via the approach of including a distant host for Icinga2 and examine it for primary availability. I’ll configure the technique to watch a Nextcloud server at IP address 192.168.1.10. The checking we will established up is fairly primary and will run a common look at on the server availability. The very first configuration will simply use a ping examination to check server uptime, and the next will use a standard template and search for a website at the document root URL. For case in point, Icinga2 will look for for a website or site (this kind of as index.php or index.html) at the / listing of either the domain or the IP address. Should really Icinga2 not be in a position to get hold of the configured distant host, it will instantly inform the icinga admins of the situation.

SEE: Information heart automation exploration report 2018: Even with development in facts, automation adoption continues to be sluggish (Tech Pro Research)

Let’s configure.

Incorporating the remote host

To include the new distant host, SSH (or log into) your Icinga2 server. To start with, we’ll configure a remote host check out to make confident the server is simply just up and jogging. At the terminal window, challenge the command:

sudo nano /etc/icinga2/conf.d/hosts.conf

The file you now have open up is the general host configuration. You want to append all new hosts at the base of this file. Scroll to the bottom and paste the adhering to contents:

object Host "HOSTNAME" 
  import "generic-host"
  address = "SERVER_IP"
  test_command = "hostalive"

where by HOSTNAME is the hostname of the distant server and SERVER_IP is the IP deal with of the server.

Conserve and shut that file.

Restart Icinga2 with the command:

sudo systemctl restart icinga2

Checking the freshly included host

Icinga2 will choose up the new host pretty promptly. Level your browser to http://SERVER_IP/icingaweb2 (in which SERVER_IP is the IP deal with of the Icinga server), and you ought to promptly see the recently included host (Figure A).

Figure A

Figure A

Our recently added distant host.

Checking HTTP

Now let’s configure a remote host that will verify the standing of an HTTP server. The configuration is generally the identical, only the verify_command selection is distinct. So situation the command:

sudo nano /etcetera/icinga2/conf.d/hosts.conf

This time scroll to the bottom and improve:

check out_command = "hostalive"

To:

check_command = "http"

Save and near that file. Restart Icinga2 with the command:

sudo systemctl restart icinga2

Head about to the Icinga2 internet site and go to Overview | Hosts. You should now see the remote host remaining checked for the HTTP assistance (Determine B).

Determine B

Figure B

HTTP is good to go on 192.168.1.10.

Our HTTP server is now becoming monitored by Icinga2.

Far more than meets the eye

We now have the skill to test to see if a website/server is down or having complications. Icinga2 is considerably extra complicated than that, and soon we will dive even further down this rabbit gap to set up substantially additional complicated distant host checking (that can watch CPU load, range of approach, disk house, and a great deal a lot more). Right up until then, delight in maintaining tabs on your distant server uptime with Icinga2.

Also see

Fibo Quantum

Be the first to comment

Leave a Reply

Your email address will not be published.


*