You are on page 1of 3

How to Add Remote Linux Host into Icinga

2 Server
RAJ SEPTEMBER 13, 2016 0 COMMENTS CENTOS 6, CENTOS 7, DEBIAN 8, HOW TO UPDATE UBUNTU 13.04 TO
UBUNTU 14.04, ICINGA, MONITORING-TOOLS

Verify the configurations files. Make sure your client node configurations should be like
below.
# vi /etc/icinga2/zones.conf

Update the zones.conf, if required. Replace client.itzgeek.local with your client machine
FQDN, and also ensure it has Icinga master node information.
/*
* Generated by Icinga 2 node setup commands
* on 2016-09-03 10:51:35 -0400
*/
object Endpoint "server.itzgeek.local" {
host = "192.168.12.6"
port = "5665"
}
object Zone "master" {
endpoints = [ "server.itzgeek.local" ]
}
object Endpoint "client.itzgeek.local" {
}
object Zone "client.itzgeek.local" {
endpoints = [ "client.itzgeek.local" ]
parent = "master"
}

Restart the Icinga 2 on the client node.


For SysVinit Systems:
# service icinga2 restart
For Systemd Systems:
# systemctl restart icinga2.service

Discover Client Services on the Master:


Icinga 2 clients usually sync their local object configurations to the master node. On the
master node, you can list and import the locally defined configuration of the clients using the
following command.
# icinga2 node list
Node 'client.itzgeek.local' (last seen: Sat Sep
* Host 'client.itzgeek.local'

3 10:54:48 2016)

*
*
*
*
*
*
*
*
*
*
*
*

Service
Service
Service
Service
Service
Service
Service
Service
Service
Service
Service
Service

'apt'
'disk'
'disk /'
'http'
'icinga'
'load'
'ping4'
'ping6'
'procs'
'ssh'
'swap'
'users'

In order to receive the check results from the clients, object configuration must exist on the
master node. Run the following command on the master for updating the client services,
generating the required object configurations.
# icinga2 node

update-config

information/cli: Updating node configuration for


Node 'client.itzgeek.local' (last seen: Sat Sep 3 10:59:50 2016)
* Host 'client.itzgeek.local'
* Service 'apt'
* Service 'disk'
* Service 'disk /'
* Service 'http'
* Service 'icinga'
* Service 'load'
* Service 'ping4'
* Service 'ping6'
* Service 'procs'
* Service 'ssh'
* Service 'swap'
* Service 'users'
information/cli: Adding host 'client.itzgeek.local' to the repository.
information/cli: Dumping changelog items to file
'/var/lib/icinga2/repository/changes/1472682449.003150-Hostf8b0ed9136c11c67f459d2341a989ea8a09e0492a556fc7d8368d15ad14d1781.change'
information/cli: Dumping changelog items to file
'/var/lib/icinga2/repository/changes/1472682449.005888-Service5009a047a11fbd680bb40d2f23cd3fcd626ac2d672c38e16f53bd622c3961534.change'
. . .
. . .
Changes to be committed:
Adding host 'client.itzgeek.local'
check_command = "cluster-zone"
import = [ "satellite-host" ]
Adding service 'apt'
check_command = "dummy"
host_name = "client.itzgeek.local"
import = [ "satellite-service" ]
zone = "client.itzgeek.local"
. . .
. . .
information/cli: Writing config object 'users' to file
'/etc/icinga2/repository.d/hosts/client.itzgeek.local/users.conf'

information/cli: Writing config object 'client.itzgeek.local' to file


'/etc/icinga2/repository.d/endpoints/client.itzgeek.local.conf'
information/cli: Writing config object 'client.itzgeek.local' to file
'/etc/icinga2/repository.d/zones/client.itzgeek.local.conf'
Make sure to reload Icinga 2 for these changes to take effect.

Reload the Icinga 2 on the master server.


# service icinga2 reload

You might also like