Most effective way for operating in Zabbix Server
Switch branches/tags
Nothing to show
Clone or download
kovetskiy Merge pull request #14 from akitsul/feature-add_message_to_acknowledge
add mandatory (zabbix 3.4.2) parameter message in acknowledge function.
Latest commit aad375f Dec 7, 2017
Permalink
Failed to load latest commit information.
.gitignore operating on latest data, session feature Jun 25, 2016
Makefile make: add build section Jun 27, 2016
config.go operating on latest data, session feature Jun 25, 2016
docs.go fix docopt short since: -e -> -s. Dec 7, 2017
function.go add latest data columns into triggers table Jul 19, 2016
handle_latest_data.go fix ranging errors channel Sep 22, 2016
handle_triggers.go show hostname in triggers Oct 31, 2017
handle_users_groups.go fix confirm message while removing user from group Nov 3, 2016
history.go add history clock zero check Jul 21, 2016
host.go operating on latest data, session feature Jun 25, 2016
httptest.go fix log messages, add comments & async requests Sep 20, 2016
item.go list web scenarios as well as web items Sep 20, 2016
item_type.go list web scenarios as well as web items Sep 20, 2016
license.markdown add documentation and man page Jun 27, 2016
log.go operating on users groups Jun 27, 2016
main.go operating on users groups Jun 27, 2016
man.1 fix docs misspell about flag -k Mar 27, 2017
man.markdown fix docs misspell about flag -k Mar 27, 2017
readme.markdown fix docs misspell about flag -k Mar 27, 2017
responses.go list web scenarios as well as web items Sep 20, 2016
search.go operating on latest data, session feature Jun 25, 2016
severity.go initial implementation Jun 23, 2016
spinner.go operating on users groups Jun 27, 2016
trigger.go Show '<missing>' if trigger has no hosts Oct 31, 2017
users.go operating on users groups Jun 27, 2016
zabbix.go add mandatory (zabbix 3.4.2) parameter message in acknowledge function. Dec 6, 2017

readme.markdown

zabbixctl

zabbixctl is tool for working with zabbix server api using command line interface, it provides effective way for operating on statuses of triggers, hosts latest data and groups of users.

dashboard

Installation

go get github.com/kovetskiy/zabbixctl

afterwards executable will be placed as $GOPATH/bin/zabbixctl

Configuration

zabbixctl must be configurated before using, configuration file should be placed in ~/.config/zabbixctl.conf and must be written using following syntax:

[server]
  address  = "zabbix.local"
  username = "admin"
  password = "password"

[session]
  path = "~/.cache/zabbixctl.session"

zabbixctl will authorize in 'zabbix.local' server using given user credentials and save a zabbix session to a file ~/.cache/zabbixctl.session and at second run will use saved session instead of new authorization, by the way zabbix sessions have a ttl that by default equals to 15 minutes, so if saved zabbix session is outdated, zabbixctl will repeat authorization and rewrite the session file.

Usage

-T --triggers

Search on zabbix triggers statuses. Triggers could be filtered using / argument, for example, search and acknowledge all triggers in a problem state and match the word 'cache':

  zabbixctl -Tp /cache
-y --only-nack

Show only not acknowledged triggers.

-x --severity

Specify minimum trigger severity. Once for information, twice for warning, three for disaster, four for high, five for disaster.

-p --problem

Show triggers that have a problem state.

-r --recent

Show triggers that have recently been in a problem state.

-s --since

Show triggers that have changed their state after the given time, default: 7 days ago

-u --until

Show triggers that have changed their state before the given time.

-m --maintenance

Show hosts in maintenance.

-i --sort

Show triggers sorted by specified fields, default: lastchange,priority.

-o --order

Show triggers in specified order, default: DESC.

-n --limit

Show specified amount of triggers.

-k --acknowledge

Acknowledge all retrieved triggers.

-f --noconfirm

Do not prompt acknowledge confirmation dialog.

-L --latest-data

Search and show latest data for specified host(s). Hosts can be searched using wildcard character '*'. Latest data can be filtered using / argument, for example retrieve latest data for database nodes and search information about replication:

zabbixctl -L dbnode* /replication
-g --graph

Show links on graph pages.

-G --groups

Search and operate on configuration of users groups.

-l --list

Show list users in specified users group.

-a --add

Add specified to specified users group.

-r --remove

Remove specified from speicifed users group.

-f --noconfirm

Do not prompt confirmation dialog.

-w --stacked | -b --normal

Returns single link which points to the stacked or normal graph for matched items.

Examples

Listing triggers in a problem state

zabbixctlp -Tp

Listing triggers that have recenty been in a problem state

zabbixctlp -Tr

Listing and filtering triggers that contain a word mysql

zabbixctlp -T /mysql

Listing and acknowledging triggers that severity level is DISASTER

zabbixctl -T -xxxxx -k

Listing latest data for db nodes and filtering for information about replication lag

zabbixctl -L dbnode* /lag

Opening stacked graph for CPU quote use of selected containers

zabbixctl -L 'container-*' /cpu quota --stacked

Listing users groups that starts with 'HTTP_'

zabbixctl -G HTTP_*

Listing users groups that contain user admin

zabbixctl -G /admin

Adding user admin to groups that contain user guest

zabbixctl -G /guest -a admin

License

MIT.