Skip to content

Instantly share code, notes, and snippets.

View isaqueprofeta's full-sized avatar
🎯
Focusing

Isaque Profeta isaqueprofeta

🎯
Focusing
View GitHub Profile
@isaqueprofeta
isaqueprofeta / zabbix_queries.sh
Last active May 5, 2024 16:43 — forked from jsidhu/gist:766e4e85193f89c94640495959eb5620
Curl post to zabbix api (api_jsonrpc.php)
#LOGIN
curl -i -X POST -H 'Content-type:application/json' -d '{"jsonrpc":"2.0","method":"user.login","params":{ "user":"myUserName","password":"myPassword"},"auth":null,"id":0}' https://zabbix.server/api_jsonrpc.php
#GET ALL HOSTS WITH NAME
curl -i -X POST -H 'Content-type:application/json' -d '{"jsonrpc":"2.0","method":"host.get","params":{"output": ["hostid", "name"]},"auth":"<AUTH_KEY>","id":0}' https://zabbix.server/api_jsonrpc.php
#GET ALL HOSTS WITH NAME, HOSTNAME AND IP ADDRESS
curl -i -X POST -H 'Content-type:application/json' -d '{"jsonrpc":"2.0","method":"host.get","params":{"output":["hostid", "host", "name"], "selectInterfaces":["ip"]},"auth":"<AUTH_KEY>","id":0}' https://zabbix.server/api_jsonrpc.php