Giter Site home page Giter Site logo

zabbix-bash-completion's Introduction

Zabbix Bash Completion

Bash completion for Zabbix commands

To try this out, source the files. For example:

$ . zabbix_get-completion; . zabbix-utils-completion
$ zabbix_get -<tab><tab>

For zabbix_get, item key completion is available. Available item keys are hardcoded. If the currently completed key ends with an opening square bracket, space is not appended to allow adding positional parameters. For example:

$ zabbix_get -k system.u<tab><tab>
system.uname      system.uptime     system.users.num

For zabbix_agentd, item key completion is available. If the currently completed key ends with an opening square bracket, space is not appended to allow adding positional parameters. Available item keys are read from the agent binary that is specified. For example:

$ zabbix_agentd -t system.u<tab><tab>
system.uname      system.uptime     system.users.num

For all daemons, runtime options are completed. For log level changing:

  • PID list is completed by the parent PID from the configuration file, if supplied. If not supplied, all processes on the system that match the currently completed processes are listed
  • Process name completion uses a hardcoded process list. For processes that have a space in the name, backspace-escaped space is supported. Doublequoting the parameters is not supported. For processes where more than one process is possible, trailing space is not added to allow specifying process number. Process number is completed from the output of 'ps'. For example:
    $ zabbix_agentd -R log_level_increase=<tab><tab>
    active\ checks  collector       listener

    $ zabbix_server -R log_level_increase=poller,<tab><tab>
    poller,1  poller,2  poller,3  poller,4  poller,5

For all completions, parameters are supported via space. Specifying them right away or via an equal sign (like -pvalue or --param=value) is not supported.

Installing

Simple testing can be done by sourcing the files. Completion for get and sender depends on zabbix-utils-completion. Completion for agentd, server and proxy depends on zabbix-daemons-completion.

To make Zabbix command completion available permanently, place all the files in /etc/bash_completion.d/ and start a new shell session.

Requirements

  • awk
  • ip
  • bash-completion

Troubleshooting

  • _get_comp_words_by_ref: command not found

    Package bash-completion must be installed

zabbix-bash-completion's People

Contributors

richlv avatar jangaraj avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.