https://github.com/v2e4lisp/zabbix-api
zabbix api js wrapper.
https://github.com/v2e4lisp/zabbix-api
Last synced: about 1 year ago
JSON representation
zabbix api js wrapper.
- Host: GitHub
- URL: https://github.com/v2e4lisp/zabbix-api
- Owner: v2e4lisp
- Created: 2013-08-28T06:06:55.000Z (almost 13 years ago)
- Default Branch: master
- Last Pushed: 2013-08-28T15:48:35.000Z (almost 13 years ago)
- Last Synced: 2025-03-14T01:35:24.711Z (over 1 year ago)
- Language: JavaScript
- Size: 133 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# zabbix-api
Simple Zabbix API wrapper for node.js.
## Install
```bash
npm install zabbix-api
```
## Usage and API
```javascript
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);
}
```