Problems with starting checks in icinga2 [solved]

i’m trying to configure check_esxi_hardware.py

in commands.conf

i pasted:


object CheckCommand "esxi_hardware" {
  import "plugin-check-command"

  command = [ PluginContribDir + "/check_esxi_hardware.py" ]

  arguments = {
    "-H" = {
      value = "$esxi_hardware_host$"
      description = "report on HOST"
    }
    "-U" = {
      value = "$esxi_hardware_user$"
      description = "user to connect as"
    }
    "-P" = {
      value = "$esxi_hardware_pass$"
      description = "password"
    }
    "-C" = {
      value = "$esxi_hardware_port$"
      description = "cim port"
    }
    "-S" = {
      value = "$esxi_hardware_sslproto$"
      description = "ssl/tls protocol"
    }
    "-V" = {
      value = "$esxi_hardware_vendor$"
      description = "Vendor code: auto, dell, hp, ibm, intel, or unknown"
    }
    "-I" = {
      value = "$esxi_hardware_html$"
      description = "generate html links for country XX"
    }
    "-i" = {
      value = "$esxi_hardware_ignore$"
      description = "comma-separated list of elements to ignore"
    }
    "-r" = {
      set_if = "$esxi_hardware_regex$"
      description = "Allow regular expression lookups of elements in ignore list"
    }
    "-p" = {
      set_if = "$esxi_hardware_perfdata$"
      description = "collect performance data for pnp4nagios"
    }
    "--no-power" = {
      set_if = "$esxi_hardware_nopower$"
      description = "don't collect power performance data"
    }
    "--no-volts" = {
      set_if = "$esxi_hardware_novolts$"
      description = "don't collect voltage performance data"
    }
    "--no-current" = {
      set_if = "$esxi_hardware_nocurrent$"
      description = "don't collect current performance data"
    }
    "--no-temp" = {
      set_if = "$esxi_hardware_notemp$"
      description = "don't collect temperature performance data"
    }
    "--no-fan" = {
      set_if = "$esxi_hardware_nofan$"
      description = "don't collect fan performance data"
    }
    "--no-lcd" = {
      set_if = "$esxi_hardware_nolcd$"
      description = "don't collect lcd/front display status data"
    }
    "--no-intrusion" = {
      set_if = "$esxi_hardware_nointrusion$"
      description = "don't collect chassic intrusion status data"
    }
  }

  vars.esxi_hardware_host = "$address$"
  vars.esxi_hardware_port = 5989
  vars.esxi_hardware_regex = false
  vars.esxi_hardware_perfdata = false
  vars.esxi_hardware_nopower = false
  vars.esxi_hardware_novolts = false
  vars.esxi_hardware_nocurrent = false
  vars.esxi_hardware_notemp = false
  vars.esxi_hardware_nofan = false
  vars.esxi_hardware_nolcd = false
  vars.esxi_hardware_nointrusion = false
}

but upon restarting icinga i get:

 /etc/icinga2/conf.d/commands.conf(277): */
May 27 11:17:22 icinga icinga2[507264]: /etc/icinga2/conf.d/commands.conf(278):
May 27 11:17:22 icinga icinga2[507264]: /etc/icinga2/conf.d/commands.conf(279): object CheckCommand "esxi_hardware" {
May 27 11:17:22 icinga icinga2[507264]:                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
May 27 11:17:22 icinga icinga2[507264]: /etc/icinga2/conf.d/commands.conf(280):   import "plugin-check-command"
May 27 11:17:22 icinga icinga2[507264]: /etc/icinga2/conf.d/commands.conf(281):
May 27 11:17:22 icinga icinga2[507264]: [2021-05-27 11:17:22 +0300] critical/cli: Config validation failed. Re-run with 'icinga2 daemon -C' after fixing the config.
May 27 11:17:22 icinga systemd[1]: icinga2.service: Main process exited, code=exited, status=1/FAILURE
May 27 11:17:22 icinga systemd[1]: icinga2.service: Failed with result 'exit-code'.
May 27 11:17:22 icinga systemd[1]: Failed to start Icinga host/service/network monitoring system.

i tried
object checkcommand "esxi_hardware"
and
object CheckCommand = "esxi_hardware"

but nothing seems to work!

Hi & welcome to the icinga community,

You’re trying to redefine an already existing check command which is part of ITL. If you want to use your own definition you need to use a different command name.

1 Like

ok, but where is this command defined?

On a debian machine it’s /usr/share/icinga2/include/plugins-contrib.d/virtualization.conf

well, thanks, but coming in from nagios and expecting definitions outside /etc is bewildering…

Icinga2 is not Nagios :slight_smile:

You may find the following documentation helpful:
https://icinga.com/docs/icinga-2/latest/doc/10-icinga-template-library/

Antony.

perhaps you can save me hours of searching and inform us, if you know, does icinga have a netflow module, like nagios network analyzer?

No. That is an entirely separate product from the Nagios Monitoring system
(which seems to be called Nagios XI now), and Icinga2 is a Monitoring system.

Antony.

Apologies, I think I meant Nagios Core, not Nagios XI. I’m no expert, though

  • that’s why I’m here on the icinga list :slight_smile:

Antony.