title: icinga, how to pass attribute to check Command
body: <p>I have a conditionnal rule in Icinga to execute a script for checking cas authentification.
  The script use an URL and grep a string in the page returned.
  URL and string are given attributes to the script.</p>
  
  <p>Here's the defintion of a host :</p>
  
  <pre><code> object Host "m" {
    address = "1xx.xx7.25"
    import "linux-server"
    display_name = "m"    
    vars.curl_casURL = "http://xxx.html"
    vars.curl_casGREP = "Returned String"
  }
  </code></pre>
  
  <p>Here's the code for the Service, it's only executed when the 2 variables curl_casURL and curl_casGREP are defined in the host :</p>
  
  <pre><code>apply Service "cas"  {
    import "generic-service"
    check_command = "cas"
    assign  where (host.vars.curl_casURL &amp;&amp; host.vars.curl_casGREP)
  }
  </code></pre>
  
  <p>In the web Interface, it's OK, I saw that the script is executed for the server "m". </p>
  
  <p>Here's the command :</p>
  
  <pre><code>object CheckCommand "cas" {
    import "plugin-check-command"
    command = [ PluginDir + "/icinga-curl_cas.sh" ]
    command +=[  vars.curl_casURL + vars.curl_casGREP ]
  }
  </code></pre>
  
  <p>But the script never receives the arguments and echoes a critical state because of the first line of the script :</p>
  
  <pre><code>if [ ! $1  ]
   then
    echo "GIVE ME AN  URL, PLEASE!"
    exit $STATE_CRITICAL
  fi
  </code></pre>
  
  <p>I didn't find in the documentation the answer. Could anyone help me?
  Thanks!!</p>