Icinga2 nutzt falsches PluginDir

This forum was archived to /woltlab and is now in read-only mode.
  • Server:

    OS: Debian8

    Icinga2: version: r2.6.0-1


    Client: RedHat Enterprise 7

    icinga2: version: v2.6.0


    Server



    constant.conf


    Code
    1. [...]
    2. const PluginDir = "/usr/lib/nagios/plugins"
    3. [...]


    Kommando check_mem.pl


    Code
    1. object CheckCommand "mem" {
    2. import "plugin-check-command"
    3. command = [ PluginDir + "/check_mem.pl" ]
    4. timeout = 1m
    5. [...]


    Kommando: check_disk

    Code
    1. object CheckCommand "disk" {
    2. import "plugin-check-command"
    3. command = [ PluginDir + "/check_disk" ]
    4. timeout = 1m
    5. [...]


    Beim Inspecten des Service_checks im icingaweb2 die auf dem selben Host angewandt sind:


    check_mem:

    Code
    1. [...]
    2. command: [
    3. "/usr/lib/nagios/plugins/check_mem.pl"
    4. [...]

    check_disk:


    Code
    1. [...]
    2. command: [
    3. "/usr/lib64/nagios/plugins/check_disk",
    4. [...]




    Client



    constant.conf

    ;(

  • And how do the service object for these checks look like? Can you extract the CheckCommand definition from the client (icinga2 object list --type CheckCommand --name mem).

  • Ich habe hierfür das eingebaute icinga2-director check_mem.pl genutzt.

    Die Plugins habe ich via Ansible auf die Hosts verteilt. (in die richtigen Verzeichnisse).


    SERVER

    Code
    1. ll /usr/lib/nagios/plugins/check_mem.pl
    2. 8,0K -rwxr-xr-x 1 nagios nagios 6,5K Jan 16 10:06 /usr/lib/nagios/plugins/check_mem.pl


    CLIENT


    Code
    1. ll /usr/lib64/nagios/plugins/check_mem.pl
    2. -rwxr-xr-x. 1 icinga icinga 6642 16. Jan 11:42 /usr/lib64/nagios/plugins/check_mem.pl
    Code
    1. icinga2 object list --type CheckCommand --name mem
    2. user@hostname
  • Huh? Why does the client return an empty result? Can you check whether this CheckCommand is defined and included?


    Code
    1. grep -r mem /usr/share/icinga2/include
    2. cat /etc/icinga2/icinga2.conf
  • SERVER

  • CLIENT


    Code
    1. cat /etc/icinga2/icinga2.conf
    2. /** Icinga 2 Config - proposed by Icinga Director */
    3. include "constants.conf"
    4. include "zones.conf"
    5. include "features-enabled/*.conf"
    6. include <itl>
    7. include <plugins>
  • So there's an include missing, isn't it?


    Code
    1. include <plugins-contrib>

    your right! Its resolved after adding it to icinga2.conf


    Maybe it is an issue with the icinga2-director script?


  • The '//' characters are comments, so Icinga 2 ignores the line. You probably want to re-enable such by removing them.

    Yeah I know, but why is that, when some error like mine occure?

    I just wanted to put some plugin in there and had to edit all servers.. :-S

  • To be honest, it should fail with a different error - if the CheckCommand doesn't exist on the client, the command endpoint check should turn unto Unknown and tell you exactly that. That's why I asked you to show the client's configuration.


    Are you sure that you're dealing with the correct client?

  • yes I'm absolutely sure about it. I can also see it on every other of my hosts. I installed them all the same way.

    Add host in Icinga2-director --> copy the script onto the server --> installed icinga2 via repo --> run the script --> restart icinga2 client

  • It happened to me today, I added a new host with icinga director (icinga installed on RHEL6 from repository) and I wasn't able to user the oracle_health command.

    I found that by default the plugin-contrib is commented out in icinga2.conf

  • Instead of telling you to create a patch I've manually edited the file on GitHub and sent a PR. Took me 30 seconds.




    https://github.com/Icinga/icin…-module-director/pull/783