Ad Widget

Collapse

Need help in API implementation Node JS

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • arun
    Junior Member
    • Aug 2014
    • 2

    #1

    Need help in API implementation Node JS

    Hi,
    We are using a Node JS application to get some data from the zabbix server. Our requirement is to get few items for each monitored host in a single API call . We have got one libarary in Node JS which we are using .

    The following is the query which we are firing

    zabbix.call("host.get",
    { "monitored_hosts" : true,
    "hostids" : "10111",
    "selectInventory":true,"selectItems": [
    "name",
    "description",
    "lastvalue",
    "units",
    "itemid",
    "lastclock",
    "value_type",
    "itemid"
    ],
    "output" : "extend",
    "sortfield" : "host",
    "searchWildcardsEnabled" : 1,
    "expandDescription": 1,
    "expandData": 1
    },function (err, resp, body) {
    if (!err) {
    console.log(resp.statusCode + " result: " + JSON.stringify(body.result));
    }
    });

    This is however, returning all the items belonging to a host . We want to restrioct this to a subset of items only viz.

    "itemids":"23864,23865,23866,23867,23868,23869,238 70,23871"

    Can you please let me know how to do this in zabbix api ?
  • VincentP
    Junior Member
    • Dec 2014
    • 1

    #2
    Hi

    have you used ?

    "params": {
    "itemids": [23864,23865,23866,23867,23868,23869,238 70,23871]
    },

    Regards
    Vincent

    Comment

    Working...