ITNuvoAkademiya
Academy homePackagesPlaylistsToolsSubnet calculatorSearchGlossary
CiscoCCNA · CCNA: networking fundamentals1. Introduction2. Network Fundamentals3. Network Access4. IP Connectivity5. IP Services6. IPv67. Security Fundamentals8. AutomationCCNP: Enterprise networks · coming soon
LinuxLinux: system administrator üçün · Linux for system administrators1. Getting to know Linux2. Working with text3. Users and permissions4. Processes and packages5. Inside the system6. Monitoring and logs7. NetworkingRed Hat Enterprise Linux · Red Hat Enterprise Linux: from beginner to advanced1. Getting started2. Packages3. Users and permissions4. SELinux5. Services6. Storage7. Networking8. Building services9. Boot and recovery10. DevOps11. Security and monitoring
FortinetFortiGate Administrator · FortiGate Administrator: from first login to ZTNA1. Getting to know FortiGate2. Routing, policy and NAT3. Security profiles4. Users and logs5. Resilience, SD-WAN and automation6. VDOM7. VPN and ZTNA8. Proxy9. DMZ
MonitoringZabbix · Zabbix: from installation to alerts1. Introduction2. Installation and the database3. Basics: groups, templates, users4. Connecting devices5. Alerts, Grafana and the API
VirtualizationProxmox VE · coming soonVMware ESXi · coming soon
My account / Sign in
AZENRU
← itnuvo.com

Zabbix API: adding devices with a script

Lesson 5.414 minAdvancedDecember 5, 2026

Sign in to read this lesson

Ten hosts can be added by hand, a hundred cannot. In this lesson we learn how the Zabbix API works, how API access is opened in 8.0, how to create a token, how to find group and template IDs with curl, how to add a host with an SNMP v2c or v3 interface through host.create, and a small script that adds hosts in bulk from a CSV file.

What you will learn

  • API address: http://10.10.10.20/zabbix/api_jsonrpc.php, format JSON-RPC 2.0, headers Content-Type: application/json-rpc and Authorization: Bearer <token>.
  • In a new Zabbix 8.0 installation API access is disabled for roles: create a separate role (Access to API: Enabled, only the methods that are needed), a user and an API token.
  • IDs are found by name: hostgroup.get (groupid), template.get (templateid); then host.create.
  • Interface: type 1 Agent, 2 SNMP; for SNMP the details: version 2 and community, or version 3, securityname, securitylevel 2, authprotocol, privprotocol and the passphrases.
  • We do not write the token inside the script: we keep it in a file with 600 permissions or in an environment variable, and give it an expiry date.

The lesson has 5 key points, an explanation and 5 questions. It opens with a package.