Skip to content

Instantly share code, notes, and snippets.

@v-zhuravlev
Last active October 3, 2019 08:40
Show Gist options
  • Save v-zhuravlev/203a10720d3c044b78ca45f865684818 to your computer and use it in GitHub Desktop.
Save v-zhuravlev/203a10720d3c044b78ca45f865684818 to your computer and use it in GitHub Desktop.
JSON array to Zabbix LLD sample
// run wmi.getall[root\cimv2,"select * from win32_networkadapter where PhysicalAdapter=True"]
// this filters other performance metric counters, so Discard can be applied.
output = JSON.parse(value).map(function(net){
return {
"{#IFNAME}": net.Name,
"{#IFDESCR}": net.Description,
"{#IFPHYSICALADAPTER}": net.PhysicalAdapter,
"{#IFALIAS}": net.NetConnectionID,
"{#IFNETENABLED}": net.NetEnabled
}})
return JSON.stringify({"data": output})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment