Zabcon features
Zabcon is a commandline tool to access Zabbix API. This page describes it's features. See command description for actual commands and default configuration file for available configuration options.
General features
Interactive and non-interactive mode
Zabcon can be run in interactive or non-interactive mode. It automatically detects which mode is used and formats it's output accordingly.
Example output in interactive mode:
+--------+---------+---------------+-------+ | userid | name | surname | alias | +--------+---------+---------------+-------+ | 1 | Zabbix | Administrator | Admin | | 2 | Default | User | guest | +--------+---------+---------------+-------+
Example output in non-interactive mode:
userid,name,surname,alias 1,Zabbix,Administrator,Admin 2,Default,User,guest
Configuration file
It is possible to use a configuration file. It allows to set default parameters, including server and access details for API. If they are set, Zabcon will attempt to automatically log into the API upon startup. Configuration file to be used can be passed with "-l" flag. Zabcon searches ./zabcon.conf and ~/zabcon.conf as the default configuration file locations automatically. If a file is found in one of these, it is automatically used. Automatic configuration file loading can be skipped by passing "--no-config" flag.
Command history
Zabcon has command history. It works like in most shells and utilities, just use up-arrow to recall and edit previous commands.
Debug mode
Zabcon allows to change debug level. Default debug level is 0 and can be changed by running:
set env debug=n
where "n" is desired debuglevel. Exact JSON that is being sent to the API and received from it can be seen starting with debuglevel 4. Default debuglevel can also be set in the configuration file.
Storing access token
Starting with revision 357, Zabcon supports storing access token and re-using it for further sessions. If configuration file is available and has "server" variable set, Zabcon will try to reuse this access token for subsequent sessions (runs). If that fails, normal access information will be used (if available). By default access token is saved in ~/zabcon.session. This location can be changed in the configuration file.
Executing "logout" will remove session file. Session saving can be disabled by specifying in the configuration file:
session_file=
or launching Zabcon with "--no-session" parameter.