Delete host via action, Zabbix

preview_player
Показать описание
JavaScript:
// convert to JSON all input arguments
var params = JSON.parse(value);

// define new HTTP request
var req = new CurlHttpRequest();

// where Zabbix API endpoint is located

// this will be JSON call
req.AddHeader('Content-Type: application/json');

// close event based on event id and report the answer
var response = JSON.parse(req.Post(json_rpc,
)).result;

Zabbix.Log(3,JSON.stringify(response));

Рекомендации по теме
Комментарии
Автор

Thank you for sharing this. Just one thing. Is this only auto remove host by your trigger which is as example put here by icmp or it works out of box with let say Zabbix agent is unreachable for 60 minutes? Or it will trigger any problem? I have lot triggers which can be in a problem but not for removing.

MarkoJovanovicunngenant
Автор

I have done all the steps but the host is not deleting from the UI.. can you please help me with this .. if maunally executing getting
" 56 3 undefined"

sunandpanda
Автор

hi !
Do you know why you are giving this error?

cannot execute script: ReferenceError: identifier ' CurLHttpRequest' undefined
at [anon] (duktape.c83869) internal

at [anon] (function:5) prevestsyield

TiagoDomingosFigueiredo