Hello everyone,
I check all examples and manuals, but I have still problem with webhook.
We have a really simple API service which allows us sending message to out admins in case of failure.
The only thing we are supposed to is calling that with some parameters including credential and message.
I tried tooooo many approaches to use it in zabbix but there is always the same error: SyntaxError: unterminated statement (line 1)
Here is the script:
String a = https://test.com/url/send?usr=test&pass=test&number=9999999&msg=test";
String answer= "";
try {
InputStream in = new URL(a).openConnection().getInputStream();
BufferedReader reader = new BufferedReader(new InputStreamReader(in));
String line;
while ((line = reader.readLine()) != null) {
answer = response + line + "\n";
}
} catch (Throwable e) {
answer = "Error: " + e.getMessage();
}
I tried the code by removing parameters from the url and putting them in parameter boxes above the script, but the result was the same.
I check all examples and manuals, but I have still problem with webhook.
We have a really simple API service which allows us sending message to out admins in case of failure.
The only thing we are supposed to is calling that with some parameters including credential and message.
I tried tooooo many approaches to use it in zabbix but there is always the same error: SyntaxError: unterminated statement (line 1)
Here is the script:
String a = https://test.com/url/send?usr=test&pass=test&number=9999999&msg=test";
String answer= "";
try {
InputStream in = new URL(a).openConnection().getInputStream();
BufferedReader reader = new BufferedReader(new InputStreamReader(in));
String line;
while ((line = reader.readLine()) != null) {
answer = response + line + "\n";
}
} catch (Throwable e) {
answer = "Error: " + e.getMessage();
}
I tried the code by removing parameters from the url and putting them in parameter boxes above the script, but the result was the same.
Comment