On 25.06.2014 16:01, el majdoubi Driss wrote:
Sorry, I did not send the good version. Here is the actual configuration.

The idea is to have a generic nrpe command to which I could pass any number of arguments. 


apply Service "nrpe-load" {
  import "tpl-service"

  check_command = "check_nrpe_load"
  vars.w_level = "30"
  vars.c_level = "5"
  vars.nrpe_timeout = "15"
  assign where host.vars.tpl-linux
}


object CheckCommand "check_nrpe_load" {
        import "check_nrpe_arg"
        vars.remote_nrpe_command  = "check_load2"
        vars.nrpe_arg_list = "$w_level$ $C_level$"
}

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

        command = PluginDir + "/check_nrpe"

        arguments = {
                "-H" = "$nrpe_address$"
                "-p" = "$nrpe_port$"
                "-c" = "$remote_nrpe_command$"
                "-n" = {
                        set_if = "$nrpe_no_ssl$"
                        description = "Do not use SSL."
                }
                "-u" = {
                        set_if = "$nrpe_timeout_unknown$"
                        description = "Make socket timeouts return an UNKNOWN state instead of CRITICAL"
                }
                "-t" = "$nrpe_timeout$"
                 "-a" = "$nrpe_arg_list$"

}

The problem is that all the arguments I give it are considered in the execution as a single string argument, 
and that's why I get an unknown status.

What would be a good practice configuration for this problem?

Thanks


2014-06-25 15:48 GMT+02:00 el majdoubi Driss <[email protected]>:
hello,

im trying to define a sevice as follow:

apply Service "nrpe-load" {
  import "tpl-service"

  check_command = "check_nrpe_load"
  vars.w_level = "30"
  vars.c_level = "5"
  vars.nrpe_timeout = "15"
  assign where host.vars.tpl-linux
}


object CheckCommand "check_nrpe_load" {
        import "check_nrpe_arg"
        vars.remote_nrpe_command  = "check_load2"
}

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

        command = PluginDir + "/check_nrpe"

        arguments = {
                "-H" = "$nrpe_address$"
                "-p" = "$nrpe_port$"
                "-c" = "$remote_nrpe_command$"
                "-n" = {
                        set_if = "$nrpe_no_ssl$"
                        description = "Do not use SSL."
                }
                "-u" = {
                        set_if = "$nrpe_timeout_unknown$"
                        description = "Make socket timeouts return an UNKNOWN state instead of CRITICAL"
                }
                "-t" = "$nrpe_timeout$"
                 "-a" = "$w_level$,$c_level$%"

}


after checkimg the config there are no errors but in the icingaweb interface i get an umknown status of my service with this output "uncorrect command line arguments supplied"

command arguments are not the right way for doing this will shell escaped arguments. Unfortunately the strange implementation of passing additional arguments to nrpe requires a manual command line string currently.

Probably you should reconsider disabling command arguments in nrpe too, given their recent CVEs and security exploits. Rather deploy the nrpe.cfg with local threaholds with your preferred config management tool (puppet users do it like that).



any ideas??

thanks a lot
cordially



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


-- 
Michael Friedrich, DI (FH)
Application Developer

NETWAYS GmbH | Deutschherrnstr. 15-19 | D-90429 Nuernberg
Tel: +49 911 92885-0 | Fax: +49 911 92885-77
GF: Julian Hein, Bernd Erk | AG Nuernberg HRB18461
http://www.netways.de | [email protected]

** Open Source Backup Conference 2014 - September - osbconf.org **
** Puppet Camp Duesseldorf 2014 - Oktober - netways.de/puppetcamp **
** OSMC 2014 - November - netways.de/osmc **
** OpenNebula Conf 2014 - Dezember - opennebulaconf.com **


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

Reply via email to