X509 Module: icinga2 check commands

Hi,

I´ve installed the newly great x509 module. Is there any check_command, which I could use the old way round? I´ve checked the documentation, but didn´t find any check_command, which I could use at the service definition. I´m not using icinga director till now because we´ve got many hosts and services, which were created the old / classic way (= conf files).

Hi,

there’s an entire section about the check command in the documentation :thinking:

The command is part of the icingacli so there’s no separate binary if that’s what you’re looking for.

2 Likes

Just ensure that Icinga is able to access Web 2’s configuration directory.

Icinga 2.11 will include a template for this command which you can of course integrate manually in the meantime.

2 Likes

Just a note: The Vagrant boxes use snapshot packages which is why the CheckCommand already is available inside the Director/ITL. Adding it manually e.g. in global-templates/commands.conf with 2.10 doesn’t hurt. If you’re using the Director, add it, restart Icinga 2 and re-run the kickstart wizard to see it under Commands > External Commands.

Cheers,
Michael

Thanks, how can I add icingacli commands to the commands.conf? My try doesn´t work:
object CheckCommand “x509_check” {

   command = [ "icingacli x509 check host"]
   arguments = {
        "--host_name" = "$host.vars.x509$"
        "--warning" = "1M"
        }
}

No, just copy the raw text from https://raw.githubusercontent.com/Icinga/icinga2/45433e5c915c27cfa425aebbd94f86e2c60a1e33/itl/plugins-contrib.d/icingacli.conf (the x509 parts).

Thanks, I could set the object command, but it seems to be a further problem to execute this command:

ERROR: Cannot read enabled modules. Config directory “/etc/icingaweb2” is not readable

icingaweb2 is set to apache:icingaweb2 and read access is granted. Does icingacli run with a different user? The x509 module is available at enabledModules and modules with config.ini placed. So I don´t know, why this error occurs.

@nilmerg already was so kind to tell you :wink:

Thanks, seems to be a monday today :wink:

1 Like