Ruby Zabbix Api Module.

Simple and lightweight ruby module for work with zabbix api version 1.8.x

You can:

  • Create and delete host/template/application/items/triggers and screens;

  • Get info about all zabbix essences;


gem install zabbixapi

Get Start

  • Create host and get hostid from zabbix api:

    zbx    ='', 'login', 'password')
    host_options = { 
      "ip"     => '',
      "dns"    => '',
      "host"   => '',
      "useip"  => 1,
      "groups" => [zbx.get_group_id('some_group')]
    if zbx.create_host(host_options)
      puts zbx.get_host_id('')
  • Create hostgroup and get hostgroupid from zabbix api:

    zbx   ='', 'login', 'password')
    if zbx.add_group('some_group') 
      puts zbx.get_group_id('some_group')

More see in spec pleaseā€¦


  • net/http

  • net/https

  • json

Use examples

  • zabbix_la - LoadAverage template

    cd examples
    ruby zabbix_la -E development -g Templates
  • -E - env from examples/config.yml (like RAILS_ENV)

  • -g - group in zabbix for templates

Zabbix documentation