wiki:zbx_api/zabcon/commands

Zabcon Commands

Basic Commands

  • <> required parameter
  • () optional parameter

The following commands do not require that a user be logged in.

command description
help Shows some basic help information
info Meant to show some basic information about the current connection. As of r45 it only shows a basic variable dump.
history Shows the current command history
set env debug=<num> Sets debug message level
set lines <num> sets the number of lines before pause
load config (config_file) This will load the configuration file and log into the server described in the configuration file.
set var <name=val> (name2=val) Adds the names given to the local variables list
show var (name) (name2) Shows all variables or only the ones given
unset var <name> (name2) unsets the variables given
exit / quit leave the CLI tool
login <server> <username> <password> logs into a Zabbix server using the given credentials.

Commands requiring server login

command description
get user Retrieves user information from the server
add user
delete user
get host Retrieves host information from the server
add host
get item Retrieves item information from the server
add item
raw api Forms an API call from passed method and its parameters
raw json Sends a raw JSON string to Zabbix API without any syntax check. Variable $auth can be used to supply authentication token

Example uses of commands

 +> get host
Host result set
+--------+---------------+
| hostid | host          |
+--------+---------------+
| 10017  | Zabbix Server |
| 10048  | netscreen     |
+--------+---------------+
2 rows total
 +> set var hostid=10017 type=active
hostid : 10017
type : active
 +> add item description="Some item we're monitoring" key="my.key"
Item result set
+--------+----------------------------+--------+
| itemid | description                | key_   |
+--------+----------------------------+--------+
| 22191  | Some item we're monitoring | my.key |
+--------+----------------------------+--------+
1 rows total
 +>