Error watcher input thought the Apache Reverse proxy

Hi all,

I try to configure a simple alert witch watcher about my cluster state

PUT /_watcher/watch/cluster_health_watch
{
"trigger" : {
"schedule" : { "interval" : "60s" }
},
"input" : {
"http" : {
"request" : {
"host" : "myhost",
"port" : 9200,
"path" : "/_cluster/health"
}
}
},
"condition" : {
"compare" : {
"ctx.payload.status" : { "eq" : "red" }
}
},
"actions" : {
"send_email" : {
"email" : {
"to" : "l*****@*******",
"subject" : "Chequear estado del cluster de Elasticsearch",
"body" : "Cluster Elasticsearch caido"
}
}
}
}

[2015-12-04 04:44:24,414][ERROR][watcher.input.http ] [Kamal] failed to execute [http] input for [org.elasticsearch.watcher.watch.Watch@5efed351]
ScriptException[scripts of type [inline], operation [elasticsearch-watcher_watch] and lang [xmustache] are disabled]
at org.elasticsearch.script.ScriptService.compile(ScriptService.java:245)
at org.elasticsearch.script.ScriptService.executable(ScriptService.java:442)
at org.elasticsearch.watcher.support.init.proxy.ScriptServiceProxy.executable(ScriptServiceProxy.java:70)
at org.elasticsearch.watcher.support.text.xmustache.XMustacheTextTemplateEngine.render(XMustacheTextTemplateEngine.java:50)
at org.elasticsearch.watcher.support.http.HttpRequestTemplate.render(HttpRequestTemplate.java:123)
at org.elasticsearch.watcher.input.http.ExecutableHttpInput.execute(ExecutableHttpInput.java:55)
at org.elasticsearch.watcher.input.http.ExecutableHttpInput.execute(ExecutableHttpInput.java:40)
at org.elasticsearch.watcher.execution.ExecutionService.executeInner(ExecutionService.java:350)
at org.elasticsearch.watcher.execution.ExecutionService.execute(ExecutionService.java:274)
at org.elasticsearch.watcher.execution.ExecutionService$WatchExecutionTask.run(ExecutionService.java:419)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)

That's why, you need to enable scripting in your config.

1 Like

Ah Ou!! than so much I wasn't focused