Skip to content

v2e4lisp/zabbix-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

zabbix-api

Simple Zabbix API wrapper for node.js.

Install

npm install zabbix-api

Usage and API

var Zabbix = require('zabbix-api');
var zbx = new Zabbix(user, password, api_url);

// You don't have to do login yourself. `request` method will keep you authenticated.
// `output` default is `extend`
// `res` is an JS object, `result` property from zabbix response.
zbx.request('hostgroup.get', {hostids: 1}, function (err, res) {
  if (err) {
    console.log(err.message);
  } else {
    console.log(res.hostid);
    console.log(res.name);
  }
});


// Acturally there is another api method but I don't really think you'll need that.
// In case that you may want to just test if the user/password is valid ,`login` is for this.
zbx.login(function (err, auth_token) {
  err || console.log(auth_token);
}

About

zabbix api js wrapper.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published