A
A
Aborigen10202019-10-15 11:13:22
linux
Aborigen1020, 2019-10-15 11:13:22

Same value for all hosts to check in Icinga2?

Hello.
I did some RAM check. I made this service:

apply Service "memory" {
        check_command = "mem"
        assign where host.vars.os == "Linux"
        vars.mem_used = true
        vars.mem_cache = true
        vars.mem_warning = 85
        vars.mem_critical = 95
}

Then I added this to commands.conf:
object CheckCommand "memory" {
  import "plugin-check-command"
  command = [ PluginDir + "/check_mem.pl" ]

  arguments = {
    "-w" = {
     required = true
     value = "$mem_warning$"
    }

    "-c" = {
     required = true
     value = "$mem_critical$"
    }
    "-u" = {
     required = true
     value = "$mem_used$"
    }

    "-C" = "$mem_cache$"
  }

  vars.mem_used = true
  vars.mem_cache = true
  vars.mem_warning = 85
  vars.mem_critical = 95
}

And at the output I get that all hosts receive values, like the Icinga server itself.
5da57f8a4b0e7571691174.jpeg
What did I miss?
Thank you.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Aborigen1020, 2019-10-16
@Aborigin1020

In short, I got it.
You need to add a check for hosts in hosts.conf
in services.conf in this service add:
connect the client to the server using icinga node wizard
Check in zones.conf for the presence of the following line:

object Endpoint "hostname" {
        host = "199.99.99.99"
}

and like this:
object Zone "client-zonename-hostname" {
   endpoints = [ "hostname" ]
   parent = "master"
}

With zones, most likely, the thing is wrong, but without it, icinga refused to work for me. Oo

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question