Dear all =)
With the below NodeJS PoC, it returns all hosts with all their meta data.
Is it possible to just return the hostname using the Zabbix API, or should that be filtered out afterwards?
Hugs
Sandra =)
With the below NodeJS PoC, it returns all hosts with all their meta data.
Is it possible to just return the hostname using the Zabbix API, or should that be filtered out afterwards?
Hugs
Sandra =)
Code:
const Zabbix = require('zabbix-promise')
const zabbix = new Zabbix({
url: 'https://example.com/api_jsonrpc.php',
user: '',
password: ''
})
const main = async () => {
try {
await zabbix.login()
const host = await zabbix.request('host.get', {
// selectInterfaces: 'extend',
})
console.log(JSON.stringify(host, null, 2))
zabbix.logout()
} catch (error) {
console.error(error)
}
}
main()
Comment