Zabbix now has a CLI tool!

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

    Zabbix now has a CLI tool!

    Sorry for the cross-post, but since this is a few tool for use with 1.7 I felt it best to post this here too.

    After some deliberation and discussion with Richlv I've decided to name the CLI tool Zabcon.

    Since the tool was announced a fair amount of progress has been made. It is now possible to add, edit, update and delete a user a user. Show items, hosts, and host groups. Work is being done to allow for adding and deleting of hosts and items. It will also be possible to edit existing items in the near future.

    And if all that is not enough, it is possible to pipe your commands into the tool from within a shell script!

    Attached is a screen shot giving you all an idea of where we are so far.

    Please head over the the site I have setup to for development and take a look. I also encourage you to download Zabcon and provide some feedback. Zabcon has been tested to work under both Linux and Windows.

    A Trac site has been setup to support the development efforts, on the main page there are also instructions for downloading from the subversion repository.
    http://trac.red-tux.net
    Attached Files
    RHCE, author of zbxapi
    Ansible, the missing piece (Zabconf 2017): https://www.youtube.com/watch?v=R5T9NidjjDE
    Zabbix and SNMP on Linux (Zabconf 2015): https://www.youtube.com/watch?v=98PEHpLFVHM


    #2
    Originally posted by nelsonab View Post
    And if all that is not enough, it is possible to pipe your commands into the tool from within a shell script!
    This is all very interesting and exciting!

    Pipe commands into the tool from within a script. What about this scenario?
    A trigger fires, the Action calls a script, the script calls on Zabcon to enable or disable an item. [I'm thinking here about Switch ports, when the ifOperStatus changes, to auto enable/disable the port].

    Looking forward to giving it a whirl! And many thanks to you for your fine efforts nelsonab.

    BR/MrKen
    Disclaimer: All of the above is pure speculation.

    Comment


      #3
      Soon that will be quite possible :-)

      One thing to note, if you're going to use it within a script you'll need to login to the server first. The easiest way to accomplish this is to setup a conf file, and then issue the command "load config" first.

      example:
      Code:
      echo -e load config\\n get user | ./zabcon
      x86_64-linux
      Welcome to the Zabbix CLI Tool.
      Use the command 'help' to get help on commands
      http://localhost connected
      User result set
      +--------+----------+
      | userid | alias    |
      +--------+----------+
      | 40     | "a=b"    |
      | 1      | Admin    |
      | 2      | guest    |
      | 3      | nelsonab |
      | 4      | apitest  |
      +--------+----------+
      5 rows total
      RHCE, author of zbxapi
      Ansible, the missing piece (Zabconf 2017): https://www.youtube.com/watch?v=R5T9NidjjDE
      Zabbix and SNMP on Linux (Zabconf 2015): https://www.youtube.com/watch?v=98PEHpLFVHM

      Comment


        #4
        Great tool! The release notes for Zabbix 1.7.1 has a reference to this thread.
        Alexei Vladishev
        Creator of Zabbix, Product manager
        New York | Tokyo | Riga
        My Twitter

        Comment


          #5
          I think all the community thanks you for your efforts nelsonab.
          Missed that tool for a long time!

          Congrats

          Comment


            #6
            A quick little update for folks, we just had our 100th commit and now we're up to three active developers.

            Some recent changes in no particular order, host.add, import from xml file, command line start options basic trigger manipulation, and improved output handling.

            Expect to see a lot more neath things from Zabcon over the next few weeks!
            RHCE, author of zbxapi
            Ansible, the missing piece (Zabconf 2017): https://www.youtube.com/watch?v=R5T9NidjjDE
            Zabbix and SNMP on Linux (Zabconf 2015): https://www.youtube.com/watch?v=98PEHpLFVHM

            Comment


              #7
              two developers. and one pedantic fiddler.
              Zabbix 3.0 Network Monitoring book
              Zabbix tips and inspiration (blog)

              Comment


                #8
                Hi!
                Can you help me?

                I cant import configuration.
                [[email protected] .zabbix-cli]# zabbix-cli --command "import_configuration zbx-linux-envmon.xml"

                Dry run: ON
                These files would be imported with dry run: OFF

                [Done]: Total files Imported [0] / Not imported [0]

                ################################################## ###########
                Welcome to the Zabbix command-line interface (v.1.6.0)
                ################################################## ###########
                Type help or \? to list commands.


                Zabbix 3.0.7

                [[email protected] .zabbix-cli]# cat zabbix-cli.conf | grep -v ";" | grep -v "^$"
                [zabbix_api]
                zabbix_api_url=http://localhost/zabbix
                [zabbix_config]
                default_hostgroup=All-hosts
                default_admin_usergroup=Zabbix-root
                default_create_user_usergroup=All-users
                default_notification_users_usergroup=All-notification-users
                include_timestamp_export_filename=ON
                use_colors=ON
                use_auth_token_file=OFF
                [logging]
                logging=OFF
                log_level=DEBUG
                log_file=/root/.zabbix-cli/zabbix-cli.log

                Comment

                Announcement

                Collapse
                No announcement yet.
                Working...
                X