Skip to content

Vidlec/nodebix

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

nodebix

Nodebix is a API library for zabbix

  • Login
  • Call API
  • Logout

install

npm install nodebix

example

var zabbix = require("nodebix");
var client = new zabbix("zabbix_url","user","password");

client.login()
.then((result) => {
    console.log(result);
    return client.call("host.get", {hostids: 20});
})
.then((result) => {
    console.log(result);
    return client.logout();
})
.then((result) => {
    console.log(result);
})
.catch((error) => console.log(error));

Result:

Logged in
{ jsonrpc: '2.0',
  result:
   [ { hostid: '1',
       proxy_hostid: '0',
       host: 'someserver',
       status: '1',
       ...
       } ],
  id: 1 }
Logged out