A Host has the following custom parameters:
“vars”: {
“http_address”: “$host.address$”,
“http_expect”: “”,
“http_sni”: true,
“http_ssl”: true,
“http_vhost”: “fsc-web.kpmgedge.com”,
“port”: 443.0
},
However the command looks like this:
“command”: [
“/usr/lib64/nagios/plugins/check_http”,
“–no-body”,
“–sni”,
“-H”,
“fsc-web.kpmgedge.com”,
“-I”,
“kasplatfkast.outsystemsenterprise.com”,
“-S”,
“-e”,
“401”,
“-f”,
“ok”,
“-t”,
“25”,
“-u”,
“/”
],
The templates do not contain default value for the -u (http_uri) as such it should be blank.
However as you can see the command for some reason has the “/” in it.
Also I have tried to remove the vars.http_expect so it would take the default from the template by running the following command:
curl -v -k -s -u root:c9056922911a5cfc -H 'Accept: application/json' -X POST 'https://localhost:5665/v1/objects/hosts/syd.KPMG.prod-fsc-web.fsc-web.kpmgedge.com.http' \
-d '{ "templates": [ "base.tmpl" ], "attrs": { "address": "kasplatfkast.outsystemsenterprise.com", "vars.http_address": "$host.address$", "vars.http_vhost": "fsc-web.kpmgedge.com", "vars.port": 443, "vars.http_ssl": true, "vars.http_sni" : true } }' | python -m json.tool
But it seems to have no effect although I got the 200 ok:
{
“results”: [
{
“code”: 200.0,
“name”: “syd.KPMG.prod-fsc-web.fsc-web.kpmgedge.com.http”,
“status”: “Attributes updated.”,
“type”: “Host”
}
]
}
The vars still remain within the blank value set previously.
Is there a way to ensure that a variable is wiped from a host and check via the API ?