Ad Widget

Collapse

Can we create/edit items, hosts, triggers, etc, using CLI from Zabbix server?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • zayalaksme
    Junior Member
    • Jun 2018
    • 1

    #1

    Can we create/edit items, hosts, triggers, etc, using CLI from Zabbix server?

    Instead of gui I want to use cli for creating/editing hosts, items, triggers, etc. Can you please help me on this. Atleast i need show commands to know the configured parameters.
  • kernbug
    Senior Member
    • Feb 2013
    • 330

    #2
    Originally posted by zayalaksme
    Instead of gui I want to use cli for creating/editing hosts, items, triggers, etc. Can you please help me on this. Atleast i need show commands to know the configured parameters.
    Hi,

    No CLI interface, use Zabbix API (JSON) with any programming language: https://www.zabbix.com/documentation/3.4/manual/api
    To check Zabbix Server configuration look at /etc/zabbix/zabbix_server.conf.

    Comment

    • kloczek
      Senior Member
      • Jun 2006
      • 1771

      #3
      And other advice: instead creating create/edit items, hosts, triggers, etc just use templates and create anything you want in templates.
      http://uk.linkedin.com/pub/tomasz-k%...zko/6/940/430/
      https://kloczek.wordpress.com/
      zapish - Zabbix API SHell binding https://github.com/kloczek/zapish
      My zabbix templates https://github.com/kloczek/zabbix-templates

      Comment

      • kmstrube81
        Junior Member
        • May 2018
        • 11

        #4
        Originally posted by zayalaksme
        Instead of gui I want to use cli for creating/editing hosts, items, triggers, etc. Can you please help me on this. Atleast i need show commands to know the configured parameters.
        As kern was saying you can use the API and cURL to use as a defacto CLI or use PHP etc to access the API

        An example cURL command would be- curl -H "Content-Type: application/json" -X POST -d '{your zabbix api call}' http://your.zabbix.server/api_jsonrpc.php

        Comment

        Working...