Thank you! That was the key to the problem exactly.

I'm using director which did not show the include on the imported command. Now to figure out how to properly replicate that ... variable function in director to allow me to include it.... but that's not a problem for this list.

Thank you again!

Cheers,
Eric Schultz

CyVon
- a CostPerCopy Company

On 09/18/2017 06:10 AM, Michael Friedrich wrote:
On 14. Sep 2017, at 20:25, Eric Schultz <eric.schu...@cyvon.com> wrote:

I'm having an issue with a custom service where the -H <address> is not getting 
populated. From all my inspections everything seems to be right. Can someone give me 
a hint as to why this is not working. I've included the config Structure, object 
definition dump, and last check result for ibm_bladecenter (the one not working) and 
pop (a pre-defined one that is working). (yes I removed comments/description for ease 
of reading) Everything seems to match except the last check result. What would cause 
that not to appear on the check command line? As always, I greatly appreciate any 
help!

###############################################
object CheckCommand "ibm_bladecenter" {
    import "plugin-check-command"
    command = [ PluginDir + "/check_snmp_IBM_Bladecenter.pl" ]
    arguments += {
        "-C" = "$bladecenter_community$"
        "-H" = "$bladecenter_address$"
        "-c" = "$bladecenter_crit$"
        "-n" = "$bladecenter_elements$"
        "-t" = "$bladecenter_test$"
        "-w" = "$bladecenter_warn$"
    }
    vars.bladecenter_address = "$check_address$"
    vars.bladecenter_community = "public"
}

Object 'ibm_bladecenter' of type 'CheckCommand':
  * __name = "ibm_bladecenter"
  * arguments
    * -C = "$bladecenter_community$"
    * -H = "$bladecenter_address$"
    * -c = "$bladecenter_crit$"
    * -n = "$bladecenter_elements$"
    * -t = "$bladecenter_test$"
    * -w = "$bladecenter_warn$"
  * command = [ "/usr/lib64/nagios/plugins/check_snmp_IBM_Bladecenter.pl" ]
  * env = null
  * execute
    * type = "Function"
  * name = "ibm_bladecenter"
  * package = "director"
  * templates = [ "ibm_bladecenter", "plugin-check-command", 
"plugin-check-command" ]
  * timeout = 60
  * type = "CheckCommand"
  * vars
    * bladecenter_address = "$check_address$"
    * bladecenter_community = "public"
  * zone = "director-global"

# when run:
last_check_result: {
      active: true,
      check_source: "admin2.blahXX.com",
      command: [
        "/usr/lib64/nagios/plugins/check_snmp_IBM_Bladecenter.pl",
        "-C",
        "public",
        "-c",
        "3500",
        "-t",
        "System-Temp-Ambient",
        "-w",
        "2600"
      ],

###############################################

object CheckCommand "pop" {
    import "plugin-check-command"
    command = [ PluginDir + "/check_pop" ]
    timeout = 1m
    arguments += {
        "-4" = {
            set_if = "$pop_ipv4$"
        }
        "-6" = {
            set_if = "$pop_ipv6$"
        }
        "-A" = {
            set_if = "$pop_all$"
        }
        "-D" = "$pop_certificate_age$"
        "-E" = "$pop_escape$"
        "-H" = "$pop_address$"
        "-M" = "$pop_mismatch$"
        "-S" = {
            set_if = "$pop_ssl$"
        }
        "-c" = "$pop_critical$"
        "-d" = "$pop_delay$"
        "-e" = "$pop_expect$"
        "-j" = {
            set_if = "$pop_jail$"
        }
        "-m" = "$pop_maxbytes$"
        "-p" = "$pop_port$"
        "-q" = "$pop_quit$"
        "-r" = "$pop_refuse$"
        "-s" = "$pop_send$"
        "-t" = "$pop_timeout$"
        "-w" = "$pop_warning$"
    }
    vars.check_address = {
        type = "Function"
    }
This uses a function inside the ITL to calculate the check_address custom 
attribute from either “address” or “address6”. Your CheckCommand definition 
does not have that.

This can be achieved by just importing the ITL defined template “ipv4-or-ipv6”.

https://github.com/Icinga/icinga2/blob/master/itl/command-plugins.conf#L1050
https://github.com/Icinga/icinga2/blob/master/itl/command-plugins.conf#L20

Kind regards,
Michael


_______________________________________________
icinga-users mailing list
icinga-users@lists.icinga.org
https://lists.icinga.org/mailman/listinfo/icinga-users

_______________________________________________
icinga-users mailing list
icinga-users@lists.icinga.org
https://lists.icinga.org/mailman/listinfo/icinga-users

Reply via email to