Hi,

I'm using the autoreleased packages from packages.icinga.org under Debian testing/unstable:

# dpkg -l "*icinga2*" |grep ^ii
ii icinga2 2.0.0~icingaautorelease201406160756 amd64 host and network monitoring system ii icinga2-bin 2.0.0~icingaautorelease201406160756 amd64 host and network monitoring system - daemon ii icinga2-classicui 2.0.0~icingaautorelease201406160756 all host and network monitoring system - classic ui integration ii icinga2-common 2.0.0~icingaautorelease201406160756 all host and network monitoring system - common files ii icinga2-ido-mysql 2.0.0~icingaautorelease201406160756 amd64 host and network monitoring system - IDO for MySQL

I would like to tweak the http CheckCommand to support IPv6 HTTP Checks (like with ping4/ping6), so I add the argument -6 to the check_http plugin call, but when I do a config validation on the attached file, I get the following StackTrace because of some brackets my "http6" CheckCommand object:

icinga2 -C -c /etc/icinga2/icinga2-test.conf

Caught unhandled exception.
Current time: 2014-06-29 04:33:29 +0200

***
* Application version: v2.0.0
* Installation root: /usr
* Sysconf directory: /etc
* Local state directory: /var
* Package data directory: /usr/share/icinga2
* State path: /var/lib/icinga2/icinga2.state
* PID path: /var/run/icinga2/icinga2.pid
* Application type: icinga/IcingaApplication
***

../../../lib/config/aexpression.cpp(64): Throw in function icinga::Value icinga::AExpression::Evaluate(const Ptr&) const Dynamic exception type: N5boost16exception_detail10clone_implIN6icinga11ConfigErrorEEE std::exception::what: Error while evaluating expression: Operator + cannot be applied to values of type 'String' and 'Array'
Config location: in /etc/icinga2/icinga2-test.conf: 48:2-48:20
/etc/icinga2/icinga2-test.conf(46): object CheckCommand "http6" {
/etc/icinga2/icinga2-test.conf(47):  import "http-common"
/etc/icinga2/icinga2-test.conf(48):  command += [ "-6" ]
                                     ^^^^^^^^^^^^^^^^^^^
/etc/icinga2/icinga2-test.conf(49):  vars.http_address = "$address6$"
/etc/icinga2/icinga2-test.conf(50): }
[PN5boost25errinfo_nested_exception_E] =
../../../lib/base/value-operators.cpp(220): Throw in function icinga::Value icinga::operator+(const icinga::Value&, const icinga::Value&) Dynamic exception type: N5boost16exception_detail10clone_implINS0_19error_info_injectorISt16invalid_argumentEEEE std::exception::what: Operator + cannot be applied to values of type 'String' and 'Array'
  [PN6icinga10StackTraceE] =
(0) libbase.so: void boost::throw_exception<boost::exception_detail::error_info_injector<std::invalid_argument> >(boost::exception_detail::error_info_injector<std::invalid_argument> const&) (+0x1a3) [0x7fd6789a0a23] (??:?) (1) libbase.so: void boost::exception_detail::throw_exception_<std::invalid_argument>(std::invalid_argument const&, char const*, char const*, int) (+0x6d) [0x7fd6789a9acd] (??:?) (2) libbase.so: icinga::operator+(icinga::Value const&, icinga::Value const&) (+0x28a) [0x7fd678a0bcaa] (??:?) (3) libconfig.so: icinga::AExpression::OpSetPlus(icinga::AExpression const*, boost::shared_ptr<icinga::Dictionary> const&) (+0x10f) [0x7fd678656fef] (??:?) (4) libconfig.so: icinga::AExpression::Evaluate(boost::shared_ptr<icinga::Dictionary> const&) const (+0x18) [0x7fd6786526d8] (??:?) (5) libconfig.so: icinga::AExpression::OpDict(icinga::AExpression const*, boost::shared_ptr<icinga::Dictionary> const&) (+0x151) [0x7fd678656691] (??:?) (6) libconfig.so: icinga::AExpression::Evaluate(boost::shared_ptr<icinga::Dictionary> const&) const (+0x18) [0x7fd6786526d8] (??:?) (7) libconfig.so: icinga::AExpression::OpDict(icinga::AExpression const*, boost::shared_ptr<icinga::Dictionary> const&) (+0x151) [0x7fd678656691] (??:?) (8) libconfig.so: icinga::AExpression::Evaluate(boost::shared_ptr<icinga::Dictionary> const&) const (+0x18) [0x7fd6786526d8] (??:?) (9) libconfig.so: icinga::AExpression::OpDict(icinga::AExpression const*, boost::shared_ptr<icinga::Dictionary> const&) (+0x151) [0x7fd678656691] (??:?) (10) libconfig.so: icinga::AExpression::Evaluate(boost::shared_ptr<icinga::Dictionary> const&) const (+0x18) [0x7fd6786526d8] (??:?) (11) libconfig.so: icinga::ConfigItem::GetProperties() (+0x359) [0x7fd678685609] (??:?) (12) libconfig.so: icinga::ConfigType::ValidateItem(boost::shared_ptr<icinga::ConfigItem> const&) (+0xe7) [0x7fd67869fb37] (??:?) (13) libconfig.so: icinga::ConfigItem::ValidateItem() (+0xbd) [0x7fd67868182d] (??:?) (14) libbase.so: icinga::WorkQueue::WorkerThreadProc() (+0x367) [0x7fd678a0ec07] (??:?) (15) libboost_thread.so.1.55.0: <unknown function> (+0xc5ba) [0x7fd67965c5ba] (??:?) (16) libpthread.so.0: <unknown function> (+0x80ca) [0x7fd678cb80ca] (??:?)
        (17) libc.so.6: clone (+0x6d) [0x7fd676cbd05d] (??:?)


  [PN6icinga12ContextTraceE] =



***
* This would indicate a runtime problem or configuration error. If you believe this is a bug in Icinga 2 * please submit a bug report at https://dev.icinga.org/ and include this stack trace as well as any other
* information that might be useful in order to reproduce this problem.
***
Aborted

Regards
Daniel
include "constants.conf"
include "zones.conf"
include <itl>
include <plugins>
include "features-enabled/*.conf"

template Host "generic-host" {
  max_check_attempts = 5
  check_interval = 1m
  retry_interval = 30s
  check_command = "hostalive"
}

template Service "generic-service" {
  max_check_attempts = 3
  check_interval = 1m
  retry_interval = 30s
}

template CheckCommand "http-common" {
  import "plugin-check-command"
  command = PluginDir + "/check_http"
  arguments = {
    "-H" = "$http_vhost$"
    "-I" = "$http_address$"
    "-u" = "$http_uri$"
    "-p" = "$http_port$"
    "-S" = {
      set_if = "$http_ssl$"
    }
    "-a" = {
      value = "$http_auth_pair$"
      description = "Username:password on sites with basic authentication"
    }
    "--no-body" = {
      set_if = "$http_ignore_body$"
    }
    "-r" = "$http_expect_body_regex$"
    "-w" = "$http_warn_time$"
    "-c" = "$http_critical_time$"
  }
  vars.http_address = "$address$"
  vars.http_ssl = false
}

object CheckCommand "http6" {
        import "http-common"
        command += [ "-6" ]
        vars.http_address = "$address6$"
}

object Host "localhost" {
  import "generic-host"
  address = "127.0.0.1"
  address6 = "::1"
  vars.os = "Linux"
  vars.sla = "24x7"
}

object Service "http" {
  import "generic-service"
  host_name = "localhost"
  check_command = "http6"
  vars.sla = "24x7"
}

_______________________________________________
icinga-users mailing list
[email protected]
https://lists.icinga.org/mailman/listinfo/icinga-users

Reply via email to