How to monitor multiple device on local lan

Hi,

my Icinga is hosted on a VPS online, i would like to know how can i monitor multiple device on my local lan. should i use the same port or change it?

The questions that come up for me are:

  • what do you want to monitor on the local hosts?
  • how is the monitoring server connected to the local hosts?
1 Like

Let me explain, i already have a working installation master with clients which is working fine.

The Icinga Master in hosted on Linode and i’m monitoring few VPS and dedicated server. now i would like to monitor my home network which i have 10 devices in the local lan, i have icinga client installed on my home server already, what is the best setup to monitor the other devices on the LAN Network?

The question here is still: What do you want to monitor on those devices?

Depending on your answer you’ll either need some additional software solution/icinga2 or you will be good by configuring Hosts and Service on your home server.

The usual CPU, Ram and Disk etc… I know how to configure the host and services… I want to know what Configuration Modes to use to monitor devices on local lan. The icinga master is not on the local lan its on the cloud this is my main issue.

The icinga master is not on the local lan its on the cloud this is my main issue.

That is not a problem, as long as the Icinga on your server and the master know each other. See distributed monitoring.

Three solutions for this I would say:

  • set up a icinga2 satellite in your local lan that runs checks against the local hardware
  • install the Icinga2 agent on each of the local lan servers (linux and/or windows) and connect them via tcp/5665 to the master server
  • run the checks directly from the master server (would only do this if you have a secure connection (like a tunnel) between the cloud and local servers.

The link posted by @dflach will walk you through the installation of the first two options

1 Like

This is my setup Icinga2 Master in hosted online then i configured a satellite in my local lan and a client connected to the satellite but it show pending on icinga web.

Below are my configs maybe i did something wrong.

Icinga2 Master
/etc/icinga2/zone.conf

/* -------------------------------
   Master Endpoints & Zone
--------------------------------*/

object Endpoint "icinga2-master1.localdomain" {
}

object Zone "master" {
        endpoints = [ "icinga2-master1.localdomain" ]
}

/* -------------------------------
   Satellite Endpoints & Zone
--------------------------------*/

object Zone "satellite" {
        endpoints = [ "icinga2-satellite1.localdomain" ]
        parent = "master"
}

object Endpoint "icinga2-satellite1.localdomain" {
        host = "xxx.xxx.xx.xx"
}

object Zone "global-templates" {
        global = true
}

object Zone "director-global" {
        global = true
}

Icinga2 Satellite:
/etc/icinga2/zone.conf

object Endpoint "icinga2-master1.localdomain" {
        host = "xxx.xxx.xxx.xxx"
        port = "5665"
}

object Zone "master" {
        endpoints = [ "icinga2-master1.localdomain" ]
}

object Endpoint "icinga2-satellite1.localdomain" {
        host = "icinga2-satellite1.localdomain"
}

object Zone "satellite" {
        endpoints = [ "icinga2-satellite1.localdomain" ]
        parent = "master"
}

object Zone "global-templates" {
        global = true
}

object Zone "director-global" {
        global = true
}

Icinga2 Client
/etc/icinga2/zone.conf

object Endpoint "icinga2-satellite1.localdomain" {
        host = "192.168.1.120"
        port = "5665"
}

object Zone "satellite" {
        endpoints = [ "icinga2-satellite1.localdomain" ]
}

object Endpoint "icinga2-client1.localdomain" {
}

object Zone "icinga2-client1.localdomain" {
        endpoints = [ "icinga2-client1.localdomain" ]
        parent = "satellite"
}

object Zone "global-templates" {
        global = true
}

object Zone "director-global" {
        global = true
}

In this folder on Icinga Master /etc/icinga2/zones.d/satellite/

object Host "icinga2-client1.localdomain" {
  check_command = "hostalive"
  address = "182.168.1.134"
  vars.client_endpoint = name //follows the convention that host name == endpoint name
}

object Endpoint "icinga2-client1.localdomain" {
  host = "192.168.1.134" //the satellite actively tries to connect to the client
}

object Zone "icinga2-client1.localdomain" {
  endpoints = [ "icinga2-client1.localdomain" ]

  parent = "satellite"
}

This service in on Icinga Master:

apply Service "ping4" {
  check_command = "ping4"
  command_endpoint = host.vars.client_endpoint
  vars.ping_cpl = 50
  vars.ping_crta = 600
  vars.ping_wpl = 30
  vars.ping_wrta = 400
  assign where host.zone == "satellite" && host.vars.client_endpoint
}

apply Service "hostalive" {
  check_command = "hostalive"
  command_endpoint = host.vars.client_endpoint
  assign where host.zone == "satellite" && host.vars.client_endpoint
}

apply Service "users" {
  import "generic-service"
  check_command = "users"
  vars.users_wgreater = "2"
  vars.users_cgreater = "3"
  command_endpoint = host.vars.client_endpoint
  assign where host.zone == "satellite" && host.vars.client_endpoint
}

apply Service "procs" {
  import "generic-service"
  check_command = "procs"
  command_endpoint = host.vars.client_endpoint
  assign where host.zone == "satellite" && host.vars.client_endpoint
}

apply Service "ssh" {
  import "generic-service"
  check_command = "ssh"
  command_endpoint = host.vars.client_endpoint
  assign where (host.address || host.address6) && host.vars.os == "Linux"
}

apply Service "disk" {
  check_command = "disk"
  command_endpoint = host.vars.client_endpoint
  assign where host.vars.client_endpoint
  vars.disk_wfree = "10%"
  vars.disk_cfree = "5%"
  assign where host.zone == "satellite" && host.vars.client_endpoint
}

apply Service "icinga" {
  check_command = "icinga"
  command_endpoint = host.vars.client_endpoint
  assign where host.zone == "satellite" && host.vars.client_endpoint
}

apply Service "load" {
  check_command = "load"
  command_endpoint = host.vars.client_endpoint
  assign where host.zone == "satellite" && host.vars.client_endpoint
}
```

Your master has a zone called “satellite” but there is no endpoint object that is part of it.
You satellite has both endpoint and zone object, but they are not the same as one the master. There should be a zone “satellite” as well.

Did you use the icinga2 node wizard to setup and connect the satellite?

1 Like

Yes I did run icinga2 node wizard.

I have created the satellite endpoint object on the master.

Can you elaborate on how to do it.

You satellite has both endpoint and zone object, but they are not the same as one the master. There should be a zone “satellite” as well

Rename
object Zone "icinga2-satellite1.localdomain" to object Zone "satellite" in you zones.conf on the satellite host.

Thank you
I changed it.

Where should i create the host & services for icinga2-client1.localdomain, on the master or satellite?

The configuration for the client is on the master but the host is up and all services stay pending.

On the config master in zones.d/satellite.

I did but the client service stay pending i see this error on the master

[2019-08-13 22:17:44 +0200] notice/Process: PID 16793 (’/usr/lib/nagios/plugins/check_ping’ ‘-H’ ‘123.73.46.86’ ‘-c’ ‘5000,100%’ ‘-w’ ‘3000,80%’) terminated with exit code 0

if i run it on the master it works:
PING OK - Packet loss = 0%, RTA = 229.21 ms|rta=229.212997ms;3000.000000;5000.000000;0.000000 pl=0%;80;100;0

Thank you all for the replies.

its sorted