- Tested against Zabbix 1.8 through 4.0
- For Node.js you will need the xmlhttprequest library.
If you are using Node.js, install jsZabbix using npm:
$ npm install jszabbix
You can now require and use jszabbix like so:
let ZabbixAPI =const ZABBIX_URL = processenvZABBIX_URLconst ZABBIX_USER = processenvZABBIX_USERconst ZABBIX_PASS = processenvZABBIX_PASSlet zapi = ZABBIX_URLzapi
Refer to the Zabbix API Documentation and the jsZabbix Examples for more information.
You can also load this script on your browser like so:
You can now use the class ZabbixAPI normally on the page, like you would on Node.js.