There is a python code:
import json
from pyzabbix import ZabbixAPI
username = "user"
password = "*************"
servername = "https://<name of the site.com>/api_jsonrpc.php"
zapi = ZabbixAPI(servername)
zapi.session.verify = False
zapi.login(username, password)
hosts = zapi.host.get(
output=["host"], groupids=[25, 41, 43], selectInventory=["site_notes"],
)
print(json.dumps(hosts, indent=4, sort_keys=True))
We get the output (specified part):
[
{
"host": "CR-20",
"hostid": "10355",
"inventory": {
"site_notes": "_\n_\n128\n4112\nastronomyoracle.com\nastronomyoracle.com\nastrooracles.com\nastrooracles.com\nastro-stars.com\nastro-stars.com\ndwrf.justapi.cc\ndwrf.justapi.cc\ngrafana.justapi.cc\ngrafana.justapi.cc\nhoro.astrozens.com\nhoro.astrozens.com\njcontent.justservices.cc\njcontent.justservices.cc\njustcontent.services\njustcontent.services\njustfeeds.services\njustfeeds.services\njustinsight.services\njustinsight.services\njustservices.cc\njustservices.cc\njustsupport.services\njustsupport.services\njusttemplate.services\nln.astrozens.com\nln.astrozens.com\nln.trivia.buzz\nln.trivia.buzz\npush.justapi.cc\npush.justapi.cc\nsegments.justapi.cc\nsegments.justapi.cc\ns_hash_bucket_size\ns_hash_max_size\nsms.justapi.cc\nsms.justapi.cc\nstat.justapi.cc\nstat.justapi.cc\ntrk.justservices.cc\ntrk.justservices.cc\nuser.justcontent.services\nusers.justapi.cc\nusers.justapi.cc\nusers.justtemplate.services\nwww.astronomyoracle.com\nwww.astrooracles.com\nwww.astro-stars.com\nwww.dwrf.justapi.cc\nwww.grafana.justapi.cc\nwww.grafana.justapi.cc\nwww.horo.astrozens.com\nwww.jcontent.justservices.cc\nwww.jcontent.justservices.cc\nwww.justcontent.services\nwww.justcontent.services\nwww.justfeeds.services\nwww.justfeeds.services\nwww.justinsight.services\nwww.justinsight.services\nwww.justservices.cc\nwww.justservices.cc\nwww.justsupport.services\nwww.justsupport.services\nwww.justtemplate.services\nwww.ln.astrozens.com\nwww.ln.trivia.buzz\nwww.push.justapi.cc\nwww.push.justapi.cc\nwww.segments.justapi.cc\nwww.segments.justapi.cc\nwww.sms.justapi.cc\nwww.sms.justapi.cc\nwww.stat.justapi.cc\nwww.stat.justapi.cc\nwww.trk.justservices.cc\nwww.user.justcontent.services\nwww.users.justapi.cc\nwww.users.justapi.cc\nwww.users.justtemplate.services"
}
},
{
"host": "DO-08",
"hostid": "10659",
"inventory": {
"site_notes": "_\nbeta.everydayhoroscopes.com\ncontent.everydayhoroscopes.com\ncontent.everydayhoroscopes.com\neveryday-astrology.com\neveryday-horoscopes.net\neverydayhoroscopes.com\neverydayhoroscopes.com\neverydayhoroscopes.org\neverydayzenastrology.com\nmoonboundhoroscopes.com\nregular-horoscopes.com\nregularastrology.com\nwww.beta.everydayhoroscopes.com\nwww.beta.everydayhoroscopes.com\nwww.content.everydayhoroscopes.com\nwww.content.everydayhoroscopes.com\nwww.everyday-astrology.com\nwww.everyday-horoscopes.net\nwww.everydayhoroscopes.com\nwww.everydayhoroscopes.com\nwww.everydayhoroscopes.org\nwww.everydayzenastrology.com\nwww.moonboundhoroscopes.com\nwww.regular-horoscopes.com\nwww.regularastrology.com"
}
}
]
How can I display only a list of sites in a column (without brackets, host, hostid, \n, etc.)?