SlideShare a Scribd company logo
September 31, 2011

Introduction API Zabcon Conclusion




 The Zabbix API
 and
 Zabcon
           “The Zabbix Console”
     Copyright 2011 Andrew Nelson, nelsonab@red-tux.net
API & Zabcon                    September 31, 2011

Introduction API Zabcon Conclusion
Your presenter


 Andrew Nelson
 ●RHCE, Zabbix Certified Specialist
 ●Active in the Zabbix community for

  approximately 7 years
 ●Nelsonab in the Zabbix forums.

 ●Creator of Zabcon, the Zabbix

  console.
  http://trac.red-tux.net
 ●Red Hat Consultant




       Copyright 2011 Andrew Nelson, nelsonab@red-tux.net
API & Zabcon                             September 31, 2011

Introduction API Zabcon Conclusion
Background | Introduction | Example



  ●Introduced in Zabbix 1.8.0
  ●Based on JSON-RPC v 2.0 over HTTP

  ●Not RESTful

  ●Provides a somewhat raw interface to the internal data structures

  ●API calls are made to the Frontend, not the Zabbix server process

  ●API calls mimic Frontend activities




       Copyright 2011 Andrew Nelson, nelsonab@red-tux.net
API & Zabcon                       September 31, 2011

Introduction API Zabcon Conclusion
Background | Introduction | Example

 Sounds interesting what do I need to know?
  ●URL used to access the api:
      <Server URL>/api_jsonrpc.php
      Example:
      http://myserver.example.com/zabbix/api_jsonrpc.php
  ●A valid Zabbix user is required for all API calls

    ● Often referred to as the “API User”

    ● Must be a member of a User group which has the API Access permission

      enabled
    ● API Users are Zabbix users with the ability to perform API calls

  ●The latest documentation is online:

      http://www.zabbix.com/documentation/1.8/api
  ●The forum is a great resource.




       Copyright 2011 Andrew Nelson, nelsonab@red-tux.net
API & Zabcon                          September 31, 2011

Introduction API Zabcon Conclusion
Background | Introduction | Example

 My API User is configured, now what?
  Use of a Zabbix API library can make things easier
  ●

   ● Not required, the brave use Curl and Wget.

 ●API calls are divided into namespaces

   ● Namespace.call

     ● user.get, host.get etc

 ●Every API function requires a valid session ID.

   ● Except user.login, which is used to generate the session ID.

 ●Basic API Call/Layout:


        {
           "jsonrpc":"2.0",
           "method":”Function”,
           "params":{ “Name”:”Value” },
           "auth":”SessionID”,
           "id":<Incrementing Number>
        }
 ●Order is not important, content is




       Copyright 2011 Andrew Nelson, nelsonab@red-tux.net
API & Zabcon                           September 31, 2011

Introduction API Zabcon Conclusion
Background | Introduction | Example

 Show me the data! (Login)
  The next few slides will show the steps needed to show all of the hosts on a
  system.

  The login:
   {
   "auth":null,"method":"user.login",
   "id":0,"jsonrpc":"2.0",
   "params":{"password":"apitest","user":"apitest"}
   }
  Result:
   {
   "jsonrpc":"2.0",
   "result":"ef1118f0c916f8c49d10913c31ba804c",
   "id":0
   }


       Copyright 2011 Andrew Nelson, nelsonab@red-tux.net
API & Zabcon                  September 31, 2011

Introduction API Zabcon Conclusion
Background | Introduction | Example

 Show me the data! (host.get)
  The call:
   {
   "auth":"ef1118f0c916f8c49d10913c31ba804c",
   "method":"host.get","id":3,
   "params":{},"jsonrpc":"2.0"
   }
  Result:
   {
   "jsonrpc":"2.0",
   "result":
     [{"hostid":"10047"},{"hostid":"10064"},
       {"hostid":"10067"}],
   "id":3
   }



       Copyright 2011 Andrew Nelson, nelsonab@red-tux.net
API & Zabcon                  September 31, 2011

Introduction API Zabcon Conclusion
Background | Introduction | Example

 Wait, is that all I get from host.get?
  Let's try again with the parameter “extend output”
   {
   "auth":"ef1118f0c916f8c49d10913c31ba804c","id":4,
   "method":"host.get", "params":{"output":"extend"},
   "jsonrpc":"2.0"
   }




       Copyright 2011 Andrew Nelson, nelsonab@red-tux.net
API & Zabcon                  September 31, 2011

Introduction API Zabcon Conclusion
Background | Introduction | Example

 Holy data Batman, that's a lot!
  Result:
      {"jsonrpc":"2.0",
       "result":
       [{"maintenances":[{"maintenanceid":"0"}],
        "hostid":"10047","proxy_hostid":"0","host":"test","dns":"",
        "useip":"1","ip":"127.0.0.1","port":"10050","status":"0",
        "disable_until":"0","error":"","available":"0",
        "errors_from":"0","lastaccess":"0","inbytes":"0","outbytes":"0",
        "useipmi":"0","ipmi_port":"623","ipmi_authtype":"-1",
        "ipmi_privilege":"2","ipmi_username":"","ipmi_password":"",
        "ipmi_disable_until":"0","ipmi_available":"0",
        "snmp_disable_until":"0","snmp_available":"0",
        "maintenanceid":"0","maintenance_status":"0",
        "maintenance_type":"0","maintenance_from":"0","ipmi_ip":"",
        "ipmi_errors_from":"0","snmp_errors_from":"0","ipmi_error":"",
        "snmp_error":""},
        { Truncated Data for Host 2"}, {Truncated Data for Host3}],
      "id":4}


       Copyright 2011 Andrew Nelson, nelsonab@red-tux.net
API & Zabcon                              September 31, 2011

Introduction API Zabcon Conclusion
Introduction | Example | Simplifying things | More examples | Advanced

 Is there an easier way?
  ●Zabcon is intended to be the “Zabbix Console”
    ● Started in late 2009

    ● Latest version 0.0.332 (released today!)

  ●Website: http://trac.red-tux.net

  ●Written in Ruby

    ● Requires at least 1.8.6

    ● No major issues with 1.9.x, please report them when you find them

  ●Can accept commands from standard input

    ● One person used Zabcon inside a script to import data into Zabbix, using this

      approach they were able to import about 1,000 hots in a matter of minutes.
  ●Users can create their own custom Zabcon commands

  ●Easiest way to install is from Rubygems

      # gem install zabcon
    ● Installation and update of dependencies is managed by Rubygems.

    ● Some dependencies may require a compiler and the Ruby development

      libraries

        Copyright 2011 Andrew Nelson, nelsonab@red-tux.net
API & Zabcon                              September 31, 2011

Introduction API Zabcon Conclusion
Introduction | Example | Simplifying things | More examples | Advanced

 Let's see that get host example with Zabcon
  $ zabcon.rb
  Unable to find a default configuration file
  i386-linux
  Welcome to Zabcon. Build Number: 326
  Use the command 'help' to get help on commands
   -> login http://192.168.166.10 apitest apitest
  http://192.168.166.10 connected
  API Version: 1.3
   +> get host
  Host result set
  +--------+----------+-----+-----------+
  | hostid | host     | dns | ip        |
  +--------+----------+-----+-----------+
  | 10047 | test      |     | 127.0.0.1 |
  | 10064 | Lua 2     |     | 0.0.0.0   |
  | 10067 | new test |      | 127.0.0.1 |
  +--------+----------+-----+-----------+
  3 rows total
   +>
        Copyright 2011 Andrew Nelson, nelsonab@red-tux.net
API & Zabcon                            September 31, 2011

Introduction API Zabcon Conclusion
Introduction | Example | Simplifying things | More examples | Advanced

 That's nice do I really need to log in every time?
  ●Zabcon can load host and user information from a configuration file
  ●Default behavior is to load the config file upon startup

    ● ./zabcon.conf and ~/zabcon.conf are searched in that order

    ● Sample config file: zabcon.conf.default can be found in your system's

      Rubygems directory
             $ gem which zabcon
            /usr/lib/ruby/gems/1.8/gems/zabcon-0.0.332/./zabcon.rb
        ●   Using the above information the sample config file would be found at :
            /usr/lib/ruby/gems/1.8/gems/zabcon-0.0.332/zabcon.conf.default
  ●   Example:

      server=http://192.168.166.10/
      username=apitest
      password=apitest
      #debug=0
      #truncate_length=5000
      #custom_commands=sample_custom_commands

            Copyright 2011 Andrew Nelson, nelsonab@red-tux.net
API & Zabcon                              September 31, 2011

Introduction API Zabcon Conclusion
Introduction | Example | Simplifying things | More examples | Advanced

 Let's try that again, with more information:
  $ zabcon.rb
  i386-linux
  Found valid login credentials, attempting login
  http://192.168.166.10 connected
  API Version: 1.3
  Welcome to Zabcon. Build Number: 326
  Use the command 'help' to get help on commands
   +> get host show=hostid,host,dns,ip,available,status
  Host result set
  +--------+----------+-----+-----------+-----------+--------+
  | hostid | host     | dns | ip        | available | status |
  +--------+----------+-----+-----------+-----------+--------+
  | 10047 | test      |     | 127.0.0.1 | 0         | 0      |
  | 10064 | Lua 2     |     | 0.0.0.0   | 0         | 0      |
  | 10067 | new test |      | 127.0.0.1 | 0         | 0      |
  +--------+----------+-----+-----------+-----------+--------+
  3 rows total
   +>

        Copyright 2011 Andrew Nelson, nelsonab@red-tux.net
API & Zabcon                              September 31, 2011

Introduction API Zabcon Conclusion
Introduction | Example | Simplifying things | More examples | Advanced

 Ok that's cool but what if I want to disable a host from a script?
  $ echo "get host show=hostid,host,dns,ip,status" | zabcon.rb
  hostid,host,dns,ip,status
  10047,test,,127.0.0.1,0
  10064,Lua 2,,0.0.0.0,0
  10067,new test,,127.0.0.1,0

  $ echo "update host hostid=10047 status=1" | zabcon.rb

  $ echo "get host show=hostid,host,dns,ip,status" | zabcon.rb
  hostid,host,dns,ip,status
  10047,test,,127.0.0.1,1
  10064,Lua 2,,0.0.0.0,0
  10067,new test,,127.0.0.1,0




        Copyright 2011 Andrew Nelson, nelsonab@red-tux.net
API & Zabcon                              September 31, 2011

Introduction API Zabcon Conclusion
Introduction | Example | Simplifying things | More examples | Advanced

 Accessing the API directly
  ●Right now, Zabcon does not have a command for every possible API call.
  ●“raw api” allows direct access to the api.




   +> raw api history.get itemids=[22163] time_from=1317367232
  time_to=1317367262 output=extend
  Raw_api result set
  +------------+--------+------------+
  | clock       | itemid | value     |
  +------------+--------+------------+
  | 1317367283 | 22163 | 1317367283 |
  | 1317367343 | 22163 | 1317367343 |
  ...
  | 1317367943 | 22163 | 1317367943 |
  | 1317368003 | 22163 | 1317368003 |
  +------------+--------+------------+
  13 rows total



        Copyright 2011 Andrew Nelson, nelsonab@red-tux.net
API & Zabcon                                 September 31, 2011

Introduction API Zabcon Conclusion
Introduction | Example | Simplifying things | More examples | Advanced

 Custom commands
  ●End users can create their own Zabcon commands to suit their own unique needs
  ●The command “help commands” will be updated with the new commands

  ●Zabcon.conf file determines the location of the custom commands file

  ●Custom commands file is only parsed on Zabcon startup.


      ZabconCommand.add_command "custom" do
        set_method do |params|                                           +> custom
          server.connection.raw_api("user.get",{})                        result set
        end                                                              +--------+
        set_help_tag :none                                               | userid |
        set_flag :print_output                                           +--------+
      end                                                                | 1       |
                                                                         | 2       |
                                                                         +--------+
                                                                         2 rows total




         Copyright 2011 Andrew Nelson, nelsonab@red-tux.net
API & Zabcon                                 September 31, 2011

Introduction API Zabcon Conclusion
Introduction | Example | Simplifying things | More examples | Advanced

 Custom commands
  ●End users can create their own Zabcon commands to suit their own unique needs
  ●The command “help commands” will be updated with the new commands

  ●Zabcon.conf file determines the location of the custom commands file

  ●Custom commands file is only parsed on Zabcon startup.


      ZabconCommand.add_command "custom" do
        set_method do |params|                                           +> custom
          server.connection.raw_api("user.get",{})                        result set
        end                                                              +--------+
        set_help_tag :none                                               | userid |
        set_flag :print_output                                           +--------+
      end                                                                | 1       |
                                                                         | 2       |
                                                                         +--------+
                                                                         2 rows total




         Copyright 2011 Andrew Nelson, nelsonab@red-tux.net
API & Zabcon                           September 31, 2011

Introduction API Zabcon Conclusion
Recap

 Time for me to stop talking
 ●API is JSON-RPC based
   ● Allows for a nearly complete interface for modifying Zabbix

 ●API calls are made to the Web fronend

 ●Zabcon allows you to easilly call the Zabbix API form the command line or scripts

   ● Help from more developers and testers is always appreciated (hint hint)




 Website:
 http://trac.red-tux.net

 Email:
 nelsonab@red-tux.net
 anelson@redhat.com




        Copyright 2011 Andrew Nelson, nelsonab@red-tux.net

More Related Content

What's hot

Perl Memory Use - LPW2013
Perl Memory Use - LPW2013Perl Memory Use - LPW2013
Perl Memory Use - LPW2013
Tim Bunce
 
"Swoole: double troubles in c", Alexandr Vronskiy
"Swoole: double troubles in c", Alexandr Vronskiy"Swoole: double troubles in c", Alexandr Vronskiy
"Swoole: double troubles in c", Alexandr Vronskiy
Fwdays
 
What you need to remember when you upload to CPAN
What you need to remember when you upload to CPANWhat you need to remember when you upload to CPAN
What you need to remember when you upload to CPAN
charsbar
 
How to inspect a RUNNING perl process
How to inspect a RUNNING perl processHow to inspect a RUNNING perl process
How to inspect a RUNNING perl process
Masaaki HIROSE
 
Modern tooling to assist with developing applications on FreeBSD
Modern tooling to assist with developing applications on FreeBSDModern tooling to assist with developing applications on FreeBSD
Modern tooling to assist with developing applications on FreeBSD
Sean Chittenden
 
DBD::Gofer 200809
DBD::Gofer 200809DBD::Gofer 200809
DBD::Gofer 200809
Tim Bunce
 
Perl at SkyCon'12
Perl at SkyCon'12Perl at SkyCon'12
Perl at SkyCon'12
Tim Bunce
 
Devel::NYTProf v5 at YAPC::NA 201406
Devel::NYTProf v5 at YAPC::NA 201406Devel::NYTProf v5 at YAPC::NA 201406
Devel::NYTProf v5 at YAPC::NA 201406
Tim Bunce
 
Jean-Baptiste Favre - How to Monitor Bilions of Miles Shared by 20 Million Us...
Jean-Baptiste Favre - How to Monitor Bilions of Miles Shared by 20 Million Us...Jean-Baptiste Favre - How to Monitor Bilions of Miles Shared by 20 Million Us...
Jean-Baptiste Favre - How to Monitor Bilions of Miles Shared by 20 Million Us...
Zabbix
 
Perl Memory Use 201207 (OUTDATED, see 201209 )
Perl Memory Use 201207 (OUTDATED, see 201209 )Perl Memory Use 201207 (OUTDATED, see 201209 )
Perl Memory Use 201207 (OUTDATED, see 201209 )
Tim Bunce
 
Testing your infrastructure with litmus
Testing your infrastructure with litmusTesting your infrastructure with litmus
Testing your infrastructure with litmus
Bram Vogelaar
 
Rihards Olups - Zabbix at Nokia - Case Study
Rihards Olups - Zabbix at Nokia - Case StudyRihards Olups - Zabbix at Nokia - Case Study
Rihards Olups - Zabbix at Nokia - Case Study
Zabbix
 
No REST for the Wicked: REST and Catalyst
No REST for the Wicked: REST and CatalystNo REST for the Wicked: REST and Catalyst
No REST for the Wicked: REST and Catalyst
Jay Shirley
 
Deploying Plack Web Applications: OSCON 2011
Deploying Plack Web Applications: OSCON 2011Deploying Plack Web Applications: OSCON 2011
Deploying Plack Web Applications: OSCON 2011
Tatsuhiko Miyagawa
 
From SaltStack to Puppet and beyond...
From SaltStack to Puppet and beyond...From SaltStack to Puppet and beyond...
From SaltStack to Puppet and beyond...
Yury Bushmelev
 
Everything as a code
Everything as a codeEverything as a code
Everything as a code
Aleksandr Tarasov
 
Automation with Ansible and Containers
Automation with Ansible and ContainersAutomation with Ansible and Containers
Automation with Ansible and Containers
Rodolfo Carvalho
 
ruxc0n 2012
ruxc0n 2012ruxc0n 2012
ruxc0n 2012
mimeframe
 
Journée DevOps : Des dashboards pour tous avec ElasticSearch, Logstash et Kibana
Journée DevOps : Des dashboards pour tous avec ElasticSearch, Logstash et KibanaJournée DevOps : Des dashboards pour tous avec ElasticSearch, Logstash et Kibana
Journée DevOps : Des dashboards pour tous avec ElasticSearch, Logstash et Kibana
Publicis Sapient Engineering
 
Static Typing in Vault
Static Typing in VaultStatic Typing in Vault
Static Typing in Vault
GlynnForrest
 

What's hot (20)

Perl Memory Use - LPW2013
Perl Memory Use - LPW2013Perl Memory Use - LPW2013
Perl Memory Use - LPW2013
 
"Swoole: double troubles in c", Alexandr Vronskiy
"Swoole: double troubles in c", Alexandr Vronskiy"Swoole: double troubles in c", Alexandr Vronskiy
"Swoole: double troubles in c", Alexandr Vronskiy
 
What you need to remember when you upload to CPAN
What you need to remember when you upload to CPANWhat you need to remember when you upload to CPAN
What you need to remember when you upload to CPAN
 
How to inspect a RUNNING perl process
How to inspect a RUNNING perl processHow to inspect a RUNNING perl process
How to inspect a RUNNING perl process
 
Modern tooling to assist with developing applications on FreeBSD
Modern tooling to assist with developing applications on FreeBSDModern tooling to assist with developing applications on FreeBSD
Modern tooling to assist with developing applications on FreeBSD
 
DBD::Gofer 200809
DBD::Gofer 200809DBD::Gofer 200809
DBD::Gofer 200809
 
Perl at SkyCon'12
Perl at SkyCon'12Perl at SkyCon'12
Perl at SkyCon'12
 
Devel::NYTProf v5 at YAPC::NA 201406
Devel::NYTProf v5 at YAPC::NA 201406Devel::NYTProf v5 at YAPC::NA 201406
Devel::NYTProf v5 at YAPC::NA 201406
 
Jean-Baptiste Favre - How to Monitor Bilions of Miles Shared by 20 Million Us...
Jean-Baptiste Favre - How to Monitor Bilions of Miles Shared by 20 Million Us...Jean-Baptiste Favre - How to Monitor Bilions of Miles Shared by 20 Million Us...
Jean-Baptiste Favre - How to Monitor Bilions of Miles Shared by 20 Million Us...
 
Perl Memory Use 201207 (OUTDATED, see 201209 )
Perl Memory Use 201207 (OUTDATED, see 201209 )Perl Memory Use 201207 (OUTDATED, see 201209 )
Perl Memory Use 201207 (OUTDATED, see 201209 )
 
Testing your infrastructure with litmus
Testing your infrastructure with litmusTesting your infrastructure with litmus
Testing your infrastructure with litmus
 
Rihards Olups - Zabbix at Nokia - Case Study
Rihards Olups - Zabbix at Nokia - Case StudyRihards Olups - Zabbix at Nokia - Case Study
Rihards Olups - Zabbix at Nokia - Case Study
 
No REST for the Wicked: REST and Catalyst
No REST for the Wicked: REST and CatalystNo REST for the Wicked: REST and Catalyst
No REST for the Wicked: REST and Catalyst
 
Deploying Plack Web Applications: OSCON 2011
Deploying Plack Web Applications: OSCON 2011Deploying Plack Web Applications: OSCON 2011
Deploying Plack Web Applications: OSCON 2011
 
From SaltStack to Puppet and beyond...
From SaltStack to Puppet and beyond...From SaltStack to Puppet and beyond...
From SaltStack to Puppet and beyond...
 
Everything as a code
Everything as a codeEverything as a code
Everything as a code
 
Automation with Ansible and Containers
Automation with Ansible and ContainersAutomation with Ansible and Containers
Automation with Ansible and Containers
 
ruxc0n 2012
ruxc0n 2012ruxc0n 2012
ruxc0n 2012
 
Journée DevOps : Des dashboards pour tous avec ElasticSearch, Logstash et Kibana
Journée DevOps : Des dashboards pour tous avec ElasticSearch, Logstash et KibanaJournée DevOps : Des dashboards pour tous avec ElasticSearch, Logstash et Kibana
Journée DevOps : Des dashboards pour tous avec ElasticSearch, Logstash et Kibana
 
Static Typing in Vault
Static Typing in VaultStatic Typing in Vault
Static Typing in Vault
 

Similar to Zabbix Console

Zabbix API at FISL12 by Takanori Suzuki
Zabbix API at FISL12 by Takanori SuzukiZabbix API at FISL12 by Takanori Suzuki
Zabbix API at FISL12 by Takanori Suzuki
takanori suzuki
 
Automating Network Infrastructure : Ansible
Automating Network Infrastructure : AnsibleAutomating Network Infrastructure : Ansible
Automating Network Infrastructure : Ansible
Bangladesh Network Operators Group
 
Integrating Infrastructure as Code into a Continuous Delivery Pipeline | AWS ...
Integrating Infrastructure as Code into a Continuous Delivery Pipeline | AWS ...Integrating Infrastructure as Code into a Continuous Delivery Pipeline | AWS ...
Integrating Infrastructure as Code into a Continuous Delivery Pipeline | AWS ...
Amazon Web Services
 
GeekAustin DevOps
GeekAustin DevOpsGeekAustin DevOps
GeekAustin DevOps
Matt Ray
 
OpenFaaS JeffConf 2017 - Milan
OpenFaaS JeffConf 2017 - MilanOpenFaaS JeffConf 2017 - Milan
OpenFaaS JeffConf 2017 - Milan
Alex Ellis
 
Flask With Server-Sent Event
Flask With Server-Sent EventFlask With Server-Sent Event
Flask With Server-Sent Event
Tencent
 
Ansible & Salt - Vincent Boon
Ansible & Salt - Vincent BoonAnsible & Salt - Vincent Boon
Ansible & Salt - Vincent Boon
MyNOG
 
Rails Presentation (Anton Dmitriyev)
Rails Presentation (Anton Dmitriyev)Rails Presentation (Anton Dmitriyev)
Rails Presentation (Anton Dmitriyev)
True-Vision
 
Serverless in production, an experience report (CoDe-Conf)
Serverless in production, an experience report (CoDe-Conf)Serverless in production, an experience report (CoDe-Conf)
Serverless in production, an experience report (CoDe-Conf)
Yan Cui
 
Running High-Speed Serverless with nuclio
Running High-Speed Serverless with nuclioRunning High-Speed Serverless with nuclio
Running High-Speed Serverless with nuclio
iguazio
 
System insight without Interference
System insight without InterferenceSystem insight without Interference
System insight without Interference
Tony Tam
 
Chef 0.10 Overview
Chef 0.10 OverviewChef 0.10 Overview
Chef 0.10 Overview
Matt Ray
 
How to create a multi tenancy for an interactive data analysis
How to create a multi tenancy for an interactive data analysisHow to create a multi tenancy for an interactive data analysis
How to create a multi tenancy for an interactive data analysis
Tiago Simões
 
Serverless in Production, an experience report (AWS UG South Wales)
Serverless in Production, an experience report (AWS UG South Wales)Serverless in Production, an experience report (AWS UG South Wales)
Serverless in Production, an experience report (AWS UG South Wales)
Yan Cui
 
About Clack
About ClackAbout Clack
About Clack
fukamachi
 
Bare Metal to OpenStack with Razor and Chef
Bare Metal to OpenStack with Razor and ChefBare Metal to OpenStack with Razor and Chef
Bare Metal to OpenStack with Razor and Chef
Matt Ray
 
Serverless in production, an experience report (FullStack 2018)
Serverless in production, an experience report (FullStack 2018)Serverless in production, an experience report (FullStack 2018)
Serverless in production, an experience report (FullStack 2018)
Yan Cui
 
HOW TO DEAL WITH BLOCKING CODE WITHIN ASYNCIO EVENT LOOP
HOW TO DEAL WITH BLOCKING CODE WITHIN ASYNCIO EVENT LOOPHOW TO DEAL WITH BLOCKING CODE WITHIN ASYNCIO EVENT LOOP
HOW TO DEAL WITH BLOCKING CODE WITHIN ASYNCIO EVENT LOOP
Mykola Novik
 
AWS Lambda from the trenches
AWS Lambda from the trenchesAWS Lambda from the trenches
AWS Lambda from the trenches
Yan Cui
 
Performance Tuning Your Puppet Infrastructure - PuppetConf 2014
Performance Tuning Your Puppet Infrastructure - PuppetConf 2014Performance Tuning Your Puppet Infrastructure - PuppetConf 2014
Performance Tuning Your Puppet Infrastructure - PuppetConf 2014
Puppet
 

Similar to Zabbix Console (20)

Zabbix API at FISL12 by Takanori Suzuki
Zabbix API at FISL12 by Takanori SuzukiZabbix API at FISL12 by Takanori Suzuki
Zabbix API at FISL12 by Takanori Suzuki
 
Automating Network Infrastructure : Ansible
Automating Network Infrastructure : AnsibleAutomating Network Infrastructure : Ansible
Automating Network Infrastructure : Ansible
 
Integrating Infrastructure as Code into a Continuous Delivery Pipeline | AWS ...
Integrating Infrastructure as Code into a Continuous Delivery Pipeline | AWS ...Integrating Infrastructure as Code into a Continuous Delivery Pipeline | AWS ...
Integrating Infrastructure as Code into a Continuous Delivery Pipeline | AWS ...
 
GeekAustin DevOps
GeekAustin DevOpsGeekAustin DevOps
GeekAustin DevOps
 
OpenFaaS JeffConf 2017 - Milan
OpenFaaS JeffConf 2017 - MilanOpenFaaS JeffConf 2017 - Milan
OpenFaaS JeffConf 2017 - Milan
 
Flask With Server-Sent Event
Flask With Server-Sent EventFlask With Server-Sent Event
Flask With Server-Sent Event
 
Ansible & Salt - Vincent Boon
Ansible & Salt - Vincent BoonAnsible & Salt - Vincent Boon
Ansible & Salt - Vincent Boon
 
Rails Presentation (Anton Dmitriyev)
Rails Presentation (Anton Dmitriyev)Rails Presentation (Anton Dmitriyev)
Rails Presentation (Anton Dmitriyev)
 
Serverless in production, an experience report (CoDe-Conf)
Serverless in production, an experience report (CoDe-Conf)Serverless in production, an experience report (CoDe-Conf)
Serverless in production, an experience report (CoDe-Conf)
 
Running High-Speed Serverless with nuclio
Running High-Speed Serverless with nuclioRunning High-Speed Serverless with nuclio
Running High-Speed Serverless with nuclio
 
System insight without Interference
System insight without InterferenceSystem insight without Interference
System insight without Interference
 
Chef 0.10 Overview
Chef 0.10 OverviewChef 0.10 Overview
Chef 0.10 Overview
 
How to create a multi tenancy for an interactive data analysis
How to create a multi tenancy for an interactive data analysisHow to create a multi tenancy for an interactive data analysis
How to create a multi tenancy for an interactive data analysis
 
Serverless in Production, an experience report (AWS UG South Wales)
Serverless in Production, an experience report (AWS UG South Wales)Serverless in Production, an experience report (AWS UG South Wales)
Serverless in Production, an experience report (AWS UG South Wales)
 
About Clack
About ClackAbout Clack
About Clack
 
Bare Metal to OpenStack with Razor and Chef
Bare Metal to OpenStack with Razor and ChefBare Metal to OpenStack with Razor and Chef
Bare Metal to OpenStack with Razor and Chef
 
Serverless in production, an experience report (FullStack 2018)
Serverless in production, an experience report (FullStack 2018)Serverless in production, an experience report (FullStack 2018)
Serverless in production, an experience report (FullStack 2018)
 
HOW TO DEAL WITH BLOCKING CODE WITHIN ASYNCIO EVENT LOOP
HOW TO DEAL WITH BLOCKING CODE WITHIN ASYNCIO EVENT LOOPHOW TO DEAL WITH BLOCKING CODE WITHIN ASYNCIO EVENT LOOP
HOW TO DEAL WITH BLOCKING CODE WITHIN ASYNCIO EVENT LOOP
 
AWS Lambda from the trenches
AWS Lambda from the trenchesAWS Lambda from the trenches
AWS Lambda from the trenches
 
Performance Tuning Your Puppet Infrastructure - PuppetConf 2014
Performance Tuning Your Puppet Infrastructure - PuppetConf 2014Performance Tuning Your Puppet Infrastructure - PuppetConf 2014
Performance Tuning Your Puppet Infrastructure - PuppetConf 2014
 

More from Ricardo Santos

Portaria Inquerito Civil 5861/2013
Portaria Inquerito Civil 5861/2013Portaria Inquerito Civil 5861/2013
Portaria Inquerito Civil 5861/2013
Ricardo Santos
 
Representação ao MP sobre a descida de Ônibus na Pista Sul da Imigrantes
Representação ao MP sobre a descida de Ônibus na Pista Sul da ImigrantesRepresentação ao MP sobre a descida de Ônibus na Pista Sul da Imigrantes
Representação ao MP sobre a descida de Ônibus na Pista Sul da Imigrantes
Ricardo Santos
 
Carta enviada ao Governador pela UUFSAI
Carta enviada ao Governador pela UUFSAICarta enviada ao Governador pela UUFSAI
Carta enviada ao Governador pela UUFSAI
Ricardo Santos
 
Apresentação da ARTESP em 27/08 na ALESP
Apresentação da ARTESP em 27/08 na ALESPApresentação da ARTESP em 27/08 na ALESP
Apresentação da ARTESP em 27/08 na ALESP
Ricardo Santos
 
Requerimento de Informações à Secretaria de Transportes
Requerimento de Informações à Secretaria de TransportesRequerimento de Informações à Secretaria de Transportes
Requerimento de Informações à Secretaria de Transportes
Ricardo Santos
 
ATA da Reunião com a ARTESP no dia 12/07/2013
ATA da Reunião com a ARTESP no dia 12/07/2013ATA da Reunião com a ARTESP no dia 12/07/2013
ATA da Reunião com a ARTESP no dia 12/07/2013
Ricardo Santos
 
ATA da Reunião da AFREBAS com na Prefeitura de Santos
ATA da Reunião da AFREBAS com na Prefeitura de SantosATA da Reunião da AFREBAS com na Prefeitura de Santos
ATA da Reunião da AFREBAS com na Prefeitura de Santos
Ricardo Santos
 
Comunicado da AFREBAS aos seus Usuários sobre as Manifestações
Comunicado da AFREBAS aos seus Usuários sobre as ManifestaçõesComunicado da AFREBAS aos seus Usuários sobre as Manifestações
Comunicado da AFREBAS aos seus Usuários sobre as Manifestações
Ricardo Santos
 
Aplicabilidade de alternativas que promovam a melhoria contínua do tráfego de...
Aplicabilidade de alternativas que promovam a melhoria contínua do tráfego de...Aplicabilidade de alternativas que promovam a melhoria contínua do tráfego de...
Aplicabilidade de alternativas que promovam a melhoria contínua do tráfego de...
Ricardo Santos
 
Laudo sobre a descida de fretados pela Imigrantes
Laudo sobre a descida de fretados pela ImigrantesLaudo sobre a descida de fretados pela Imigrantes
Laudo sobre a descida de fretados pela Imigrantes
Ricardo Santos
 
Using Zabbix API from Drupal
Using Zabbix API from DrupalUsing Zabbix API from Drupal
Using Zabbix API from Drupal
Ricardo Santos
 
The hidden power of network maps on Zabbix
The hidden power of network maps on ZabbixThe hidden power of network maps on Zabbix
The hidden power of network maps on Zabbix
Ricardo Santos
 
Zabbix Performance Tuning
Zabbix Performance TuningZabbix Performance Tuning
Zabbix Performance Tuning
Ricardo Santos
 
Zabbix over the Internet
Zabbix over the InternetZabbix over the Internet
Zabbix over the Internet
Ricardo Santos
 
Zabbix by Alexei Vladishev - FISL12 - 2011
Zabbix by Alexei Vladishev - FISL12 - 2011Zabbix by Alexei Vladishev - FISL12 - 2011
Zabbix by Alexei Vladishev - FISL12 - 2011
Ricardo Santos
 

More from Ricardo Santos (15)

Portaria Inquerito Civil 5861/2013
Portaria Inquerito Civil 5861/2013Portaria Inquerito Civil 5861/2013
Portaria Inquerito Civil 5861/2013
 
Representação ao MP sobre a descida de Ônibus na Pista Sul da Imigrantes
Representação ao MP sobre a descida de Ônibus na Pista Sul da ImigrantesRepresentação ao MP sobre a descida de Ônibus na Pista Sul da Imigrantes
Representação ao MP sobre a descida de Ônibus na Pista Sul da Imigrantes
 
Carta enviada ao Governador pela UUFSAI
Carta enviada ao Governador pela UUFSAICarta enviada ao Governador pela UUFSAI
Carta enviada ao Governador pela UUFSAI
 
Apresentação da ARTESP em 27/08 na ALESP
Apresentação da ARTESP em 27/08 na ALESPApresentação da ARTESP em 27/08 na ALESP
Apresentação da ARTESP em 27/08 na ALESP
 
Requerimento de Informações à Secretaria de Transportes
Requerimento de Informações à Secretaria de TransportesRequerimento de Informações à Secretaria de Transportes
Requerimento de Informações à Secretaria de Transportes
 
ATA da Reunião com a ARTESP no dia 12/07/2013
ATA da Reunião com a ARTESP no dia 12/07/2013ATA da Reunião com a ARTESP no dia 12/07/2013
ATA da Reunião com a ARTESP no dia 12/07/2013
 
ATA da Reunião da AFREBAS com na Prefeitura de Santos
ATA da Reunião da AFREBAS com na Prefeitura de SantosATA da Reunião da AFREBAS com na Prefeitura de Santos
ATA da Reunião da AFREBAS com na Prefeitura de Santos
 
Comunicado da AFREBAS aos seus Usuários sobre as Manifestações
Comunicado da AFREBAS aos seus Usuários sobre as ManifestaçõesComunicado da AFREBAS aos seus Usuários sobre as Manifestações
Comunicado da AFREBAS aos seus Usuários sobre as Manifestações
 
Aplicabilidade de alternativas que promovam a melhoria contínua do tráfego de...
Aplicabilidade de alternativas que promovam a melhoria contínua do tráfego de...Aplicabilidade de alternativas que promovam a melhoria contínua do tráfego de...
Aplicabilidade de alternativas que promovam a melhoria contínua do tráfego de...
 
Laudo sobre a descida de fretados pela Imigrantes
Laudo sobre a descida de fretados pela ImigrantesLaudo sobre a descida de fretados pela Imigrantes
Laudo sobre a descida de fretados pela Imigrantes
 
Using Zabbix API from Drupal
Using Zabbix API from DrupalUsing Zabbix API from Drupal
Using Zabbix API from Drupal
 
The hidden power of network maps on Zabbix
The hidden power of network maps on ZabbixThe hidden power of network maps on Zabbix
The hidden power of network maps on Zabbix
 
Zabbix Performance Tuning
Zabbix Performance TuningZabbix Performance Tuning
Zabbix Performance Tuning
 
Zabbix over the Internet
Zabbix over the InternetZabbix over the Internet
Zabbix over the Internet
 
Zabbix by Alexei Vladishev - FISL12 - 2011
Zabbix by Alexei Vladishev - FISL12 - 2011Zabbix by Alexei Vladishev - FISL12 - 2011
Zabbix by Alexei Vladishev - FISL12 - 2011
 

Recently uploaded

Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Safe Software
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Speck&Tech
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
danishmna97
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
Alpen-Adria-Universität
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
innovationoecd
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
Matthew Sinclair
 
OpenID AuthZEN Interop Read Out - Authorization
OpenID AuthZEN Interop Read Out - AuthorizationOpenID AuthZEN Interop Read Out - Authorization
OpenID AuthZEN Interop Read Out - Authorization
David Brossard
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
Daiki Mogmet Ito
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
panagenda
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
Matthew Sinclair
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
Kumud Singh
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
Quotidiano Piemontese
 
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
Edge AI and Vision Alliance
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
Pixlogix Infotech
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems S.M.S.A.
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
shyamraj55
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
Octavian Nadolu
 
UI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentationUI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentation
Wouter Lemaire
 
AI-Powered Food Delivery Transforming App Development in Saudi Arabia.pdf
AI-Powered Food Delivery Transforming App Development in Saudi Arabia.pdfAI-Powered Food Delivery Transforming App Development in Saudi Arabia.pdf
AI-Powered Food Delivery Transforming App Development in Saudi Arabia.pdf
Techgropse Pvt.Ltd.
 

Recently uploaded (20)

Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
 
OpenID AuthZEN Interop Read Out - Authorization
OpenID AuthZEN Interop Read Out - AuthorizationOpenID AuthZEN Interop Read Out - Authorization
OpenID AuthZEN Interop Read Out - Authorization
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
 
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
 
UI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentationUI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentation
 
AI-Powered Food Delivery Transforming App Development in Saudi Arabia.pdf
AI-Powered Food Delivery Transforming App Development in Saudi Arabia.pdfAI-Powered Food Delivery Transforming App Development in Saudi Arabia.pdf
AI-Powered Food Delivery Transforming App Development in Saudi Arabia.pdf
 

Zabbix Console

  • 1. September 31, 2011 Introduction API Zabcon Conclusion The Zabbix API and Zabcon “The Zabbix Console” Copyright 2011 Andrew Nelson, nelsonab@red-tux.net
  • 2. API & Zabcon September 31, 2011 Introduction API Zabcon Conclusion Your presenter Andrew Nelson ●RHCE, Zabbix Certified Specialist ●Active in the Zabbix community for approximately 7 years ●Nelsonab in the Zabbix forums. ●Creator of Zabcon, the Zabbix console. http://trac.red-tux.net ●Red Hat Consultant Copyright 2011 Andrew Nelson, nelsonab@red-tux.net
  • 3. API & Zabcon September 31, 2011 Introduction API Zabcon Conclusion Background | Introduction | Example ●Introduced in Zabbix 1.8.0 ●Based on JSON-RPC v 2.0 over HTTP ●Not RESTful ●Provides a somewhat raw interface to the internal data structures ●API calls are made to the Frontend, not the Zabbix server process ●API calls mimic Frontend activities Copyright 2011 Andrew Nelson, nelsonab@red-tux.net
  • 4. API & Zabcon September 31, 2011 Introduction API Zabcon Conclusion Background | Introduction | Example Sounds interesting what do I need to know? ●URL used to access the api: <Server URL>/api_jsonrpc.php Example: http://myserver.example.com/zabbix/api_jsonrpc.php ●A valid Zabbix user is required for all API calls ● Often referred to as the “API User” ● Must be a member of a User group which has the API Access permission enabled ● API Users are Zabbix users with the ability to perform API calls ●The latest documentation is online: http://www.zabbix.com/documentation/1.8/api ●The forum is a great resource. Copyright 2011 Andrew Nelson, nelsonab@red-tux.net
  • 5. API & Zabcon September 31, 2011 Introduction API Zabcon Conclusion Background | Introduction | Example My API User is configured, now what? Use of a Zabbix API library can make things easier ● ● Not required, the brave use Curl and Wget. ●API calls are divided into namespaces ● Namespace.call ● user.get, host.get etc ●Every API function requires a valid session ID. ● Except user.login, which is used to generate the session ID. ●Basic API Call/Layout: { "jsonrpc":"2.0", "method":”Function”, "params":{ “Name”:”Value” }, "auth":”SessionID”, "id":<Incrementing Number> } ●Order is not important, content is Copyright 2011 Andrew Nelson, nelsonab@red-tux.net
  • 6. API & Zabcon September 31, 2011 Introduction API Zabcon Conclusion Background | Introduction | Example Show me the data! (Login) The next few slides will show the steps needed to show all of the hosts on a system. The login: { "auth":null,"method":"user.login", "id":0,"jsonrpc":"2.0", "params":{"password":"apitest","user":"apitest"} } Result: { "jsonrpc":"2.0", "result":"ef1118f0c916f8c49d10913c31ba804c", "id":0 } Copyright 2011 Andrew Nelson, nelsonab@red-tux.net
  • 7. API & Zabcon September 31, 2011 Introduction API Zabcon Conclusion Background | Introduction | Example Show me the data! (host.get) The call: { "auth":"ef1118f0c916f8c49d10913c31ba804c", "method":"host.get","id":3, "params":{},"jsonrpc":"2.0" } Result: { "jsonrpc":"2.0", "result": [{"hostid":"10047"},{"hostid":"10064"}, {"hostid":"10067"}], "id":3 } Copyright 2011 Andrew Nelson, nelsonab@red-tux.net
  • 8. API & Zabcon September 31, 2011 Introduction API Zabcon Conclusion Background | Introduction | Example Wait, is that all I get from host.get? Let's try again with the parameter “extend output” { "auth":"ef1118f0c916f8c49d10913c31ba804c","id":4, "method":"host.get", "params":{"output":"extend"}, "jsonrpc":"2.0" } Copyright 2011 Andrew Nelson, nelsonab@red-tux.net
  • 9. API & Zabcon September 31, 2011 Introduction API Zabcon Conclusion Background | Introduction | Example Holy data Batman, that's a lot! Result: {"jsonrpc":"2.0", "result": [{"maintenances":[{"maintenanceid":"0"}], "hostid":"10047","proxy_hostid":"0","host":"test","dns":"", "useip":"1","ip":"127.0.0.1","port":"10050","status":"0", "disable_until":"0","error":"","available":"0", "errors_from":"0","lastaccess":"0","inbytes":"0","outbytes":"0", "useipmi":"0","ipmi_port":"623","ipmi_authtype":"-1", "ipmi_privilege":"2","ipmi_username":"","ipmi_password":"", "ipmi_disable_until":"0","ipmi_available":"0", "snmp_disable_until":"0","snmp_available":"0", "maintenanceid":"0","maintenance_status":"0", "maintenance_type":"0","maintenance_from":"0","ipmi_ip":"", "ipmi_errors_from":"0","snmp_errors_from":"0","ipmi_error":"", "snmp_error":""}, { Truncated Data for Host 2"}, {Truncated Data for Host3}], "id":4} Copyright 2011 Andrew Nelson, nelsonab@red-tux.net
  • 10. API & Zabcon September 31, 2011 Introduction API Zabcon Conclusion Introduction | Example | Simplifying things | More examples | Advanced Is there an easier way? ●Zabcon is intended to be the “Zabbix Console” ● Started in late 2009 ● Latest version 0.0.332 (released today!) ●Website: http://trac.red-tux.net ●Written in Ruby ● Requires at least 1.8.6 ● No major issues with 1.9.x, please report them when you find them ●Can accept commands from standard input ● One person used Zabcon inside a script to import data into Zabbix, using this approach they were able to import about 1,000 hots in a matter of minutes. ●Users can create their own custom Zabcon commands ●Easiest way to install is from Rubygems # gem install zabcon ● Installation and update of dependencies is managed by Rubygems. ● Some dependencies may require a compiler and the Ruby development libraries Copyright 2011 Andrew Nelson, nelsonab@red-tux.net
  • 11. API & Zabcon September 31, 2011 Introduction API Zabcon Conclusion Introduction | Example | Simplifying things | More examples | Advanced Let's see that get host example with Zabcon $ zabcon.rb Unable to find a default configuration file i386-linux Welcome to Zabcon. Build Number: 326 Use the command 'help' to get help on commands -> login http://192.168.166.10 apitest apitest http://192.168.166.10 connected API Version: 1.3 +> get host Host result set +--------+----------+-----+-----------+ | hostid | host | dns | ip | +--------+----------+-----+-----------+ | 10047 | test | | 127.0.0.1 | | 10064 | Lua 2 | | 0.0.0.0 | | 10067 | new test | | 127.0.0.1 | +--------+----------+-----+-----------+ 3 rows total +> Copyright 2011 Andrew Nelson, nelsonab@red-tux.net
  • 12. API & Zabcon September 31, 2011 Introduction API Zabcon Conclusion Introduction | Example | Simplifying things | More examples | Advanced That's nice do I really need to log in every time? ●Zabcon can load host and user information from a configuration file ●Default behavior is to load the config file upon startup ● ./zabcon.conf and ~/zabcon.conf are searched in that order ● Sample config file: zabcon.conf.default can be found in your system's Rubygems directory $ gem which zabcon /usr/lib/ruby/gems/1.8/gems/zabcon-0.0.332/./zabcon.rb ● Using the above information the sample config file would be found at : /usr/lib/ruby/gems/1.8/gems/zabcon-0.0.332/zabcon.conf.default ● Example: server=http://192.168.166.10/ username=apitest password=apitest #debug=0 #truncate_length=5000 #custom_commands=sample_custom_commands Copyright 2011 Andrew Nelson, nelsonab@red-tux.net
  • 13. API & Zabcon September 31, 2011 Introduction API Zabcon Conclusion Introduction | Example | Simplifying things | More examples | Advanced Let's try that again, with more information: $ zabcon.rb i386-linux Found valid login credentials, attempting login http://192.168.166.10 connected API Version: 1.3 Welcome to Zabcon. Build Number: 326 Use the command 'help' to get help on commands +> get host show=hostid,host,dns,ip,available,status Host result set +--------+----------+-----+-----------+-----------+--------+ | hostid | host | dns | ip | available | status | +--------+----------+-----+-----------+-----------+--------+ | 10047 | test | | 127.0.0.1 | 0 | 0 | | 10064 | Lua 2 | | 0.0.0.0 | 0 | 0 | | 10067 | new test | | 127.0.0.1 | 0 | 0 | +--------+----------+-----+-----------+-----------+--------+ 3 rows total +> Copyright 2011 Andrew Nelson, nelsonab@red-tux.net
  • 14. API & Zabcon September 31, 2011 Introduction API Zabcon Conclusion Introduction | Example | Simplifying things | More examples | Advanced Ok that's cool but what if I want to disable a host from a script? $ echo "get host show=hostid,host,dns,ip,status" | zabcon.rb hostid,host,dns,ip,status 10047,test,,127.0.0.1,0 10064,Lua 2,,0.0.0.0,0 10067,new test,,127.0.0.1,0 $ echo "update host hostid=10047 status=1" | zabcon.rb $ echo "get host show=hostid,host,dns,ip,status" | zabcon.rb hostid,host,dns,ip,status 10047,test,,127.0.0.1,1 10064,Lua 2,,0.0.0.0,0 10067,new test,,127.0.0.1,0 Copyright 2011 Andrew Nelson, nelsonab@red-tux.net
  • 15. API & Zabcon September 31, 2011 Introduction API Zabcon Conclusion Introduction | Example | Simplifying things | More examples | Advanced Accessing the API directly ●Right now, Zabcon does not have a command for every possible API call. ●“raw api” allows direct access to the api. +> raw api history.get itemids=[22163] time_from=1317367232 time_to=1317367262 output=extend Raw_api result set +------------+--------+------------+ | clock | itemid | value | +------------+--------+------------+ | 1317367283 | 22163 | 1317367283 | | 1317367343 | 22163 | 1317367343 | ... | 1317367943 | 22163 | 1317367943 | | 1317368003 | 22163 | 1317368003 | +------------+--------+------------+ 13 rows total Copyright 2011 Andrew Nelson, nelsonab@red-tux.net
  • 16. API & Zabcon September 31, 2011 Introduction API Zabcon Conclusion Introduction | Example | Simplifying things | More examples | Advanced Custom commands ●End users can create their own Zabcon commands to suit their own unique needs ●The command “help commands” will be updated with the new commands ●Zabcon.conf file determines the location of the custom commands file ●Custom commands file is only parsed on Zabcon startup. ZabconCommand.add_command "custom" do set_method do |params| +> custom server.connection.raw_api("user.get",{}) result set end +--------+ set_help_tag :none | userid | set_flag :print_output +--------+ end | 1 | | 2 | +--------+ 2 rows total Copyright 2011 Andrew Nelson, nelsonab@red-tux.net
  • 17. API & Zabcon September 31, 2011 Introduction API Zabcon Conclusion Introduction | Example | Simplifying things | More examples | Advanced Custom commands ●End users can create their own Zabcon commands to suit their own unique needs ●The command “help commands” will be updated with the new commands ●Zabcon.conf file determines the location of the custom commands file ●Custom commands file is only parsed on Zabcon startup. ZabconCommand.add_command "custom" do set_method do |params| +> custom server.connection.raw_api("user.get",{}) result set end +--------+ set_help_tag :none | userid | set_flag :print_output +--------+ end | 1 | | 2 | +--------+ 2 rows total Copyright 2011 Andrew Nelson, nelsonab@red-tux.net
  • 18. API & Zabcon September 31, 2011 Introduction API Zabcon Conclusion Recap Time for me to stop talking ●API is JSON-RPC based ● Allows for a nearly complete interface for modifying Zabbix ●API calls are made to the Web fronend ●Zabcon allows you to easilly call the Zabbix API form the command line or scripts ● Help from more developers and testers is always appreciated (hint hint) Website: http://trac.red-tux.net Email: nelsonab@red-tux.net anelson@redhat.com Copyright 2011 Andrew Nelson, nelsonab@red-tux.net