HI,
first sorry for my bad inglish........!!!
This is my problem....I'm not able to connect zabbix api. I followed this code(previosly posted on this forum=>http://www.zabbix.com/forum/showthre...t=14048&page=2)
I create a zabbix user with api access but don't work!!!! Please help me!!!!!!!!!!!!!!!!!!!
first sorry for my bad inglish........!!!
This is my problem....I'm not able to connect zabbix api. I followed this code(previosly posted on this forum=>http://www.zabbix.com/forum/showthre...t=14048&page=2)
Code:
<HTML>
<script type="text/javascript">
var the_object;
var http_request = new XMLHttpRequest();
var jsonrpc = {'jsonrpc': '2.0','method': 'user.authenticate','params': {'user': 'nome', 'password': 'nome'},'id': 1};
http_request.open( "POST", '<zabbix_server_path>/zabbix/api_jsonrpc.php', true );
http_request.setRequestHeader('Content-Type', 'application/json-rpc');
http_request.send(jsonrpc);
http_request.onreadystatechange = function () {
if ( http_request.readyState == 4 ) {
if ( http_request.status == 200 ) {
the_object = eval( "(" + http_request.responseText + ")" );
document.getElementById("zone").innerHTML = http_request.responseText;
} else {
alert( "There was a problem with the URL." );
}
http_request = null;
}
};
</script>
<div id="zone"></div>
</HTML>
Comment