• Stars
    star
    205
  • Rank 191,264 (Top 4 %)
  • Language
    Python
  • License
    GNU General Publi...
  • Created about 10 years ago
  • Updated about 1 month ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Command-line interface for Zabbix

Zabbix-cli

About

Zabbix-cli is a command line interface for performing common administrative tasks tasks in Zabbix monitoring system via the Zabbix API.

The zabbix-cli code is written in Python and distributed under the GNU General Public License v3. It has been developed and tested by University Center for Information Technology at the University of Oslo, Norway.

The project home page is on GitHub. Please report any issues or improvements there.

The manual is available on-line at https://unioslo.github.io/zabbix-cli/manual.html.

Install

There are versioned deb and rpm releases available on the GitHub releases page.

You could also install directly from GitHub with pip:

pip install git+https://github.com/unioslo/zabbix-cli.git@master

Getting started

Configuration

Zabbix-cli need a config file. This can be created with the zabbix-cli-init command.

zabbix-cli-init --zabbix-url https://zabbix.example.com/

Zabbix-cli will look for config files in the following order. Any later files will override the former:

  1. /usr/share/zabbix-cli/zabbix-cli.conf
  2. /etc/zabbix-cli/zabbix-cli.conf
  3. ~/.zabbix-cli/zabbix-cli.conf
  4. File specified with -c/--config parameter
  5. /etc/zabbix-cli/zabbix-cli.fixed.conf
  6. /usr/share/zabbix-cli/zabbix-cli.fixed.conf

By running the config module you will get the current config or the default config:

python -m zabbix_cli.config show
python -m zabbix_cli.config defaults

If you run into problems it is useful to enable logging and set the DEBUG level for logging:

[logging]
logging = ON
log_level = DEBUG
log_file = /path/to/log/zabbix-cli.log

Authentication

By default you will be asked for a username and password when running zabbix-cli.

Alternatively you could store your username and password in the file ~/.zabbix-cli_auth. The content of this file will need to be on the USERNAME::PASSWORD format.

A third alternative is using the environment variables, ZABBIX_USERNAME and ZABBIX_PASSWORD.

You need to secure this authentication file and need to be aware that other processes on the same computer will be able to view your environment variables. Use these features at your own risk.

Zabbix-cli will store a session token if you configure use_auth_token_file = ON. This way you don't need to provide your credentials each time you run zabbix-cli. This token file should also be secured properly.

Running zabbix-cli

You may run zabbix-cli as a shell/REPL by simply running zabbix-cli.

A single command could be run by using the -C/--command parameter like zabbix-cli -C "show_host host.example.com".

Alternatively you could run multiple commands if you provide a file, with the -f parameter, with one command per line in the file.

Get more help and information by running zabbix-cli --help and zabbix-cli -C "help".

More Repositories

1

socker

A wrapper for secure running of Docker containers on Slurm
Python
26
star
2

harborapi

Python async client for the Harbor REST API v2.0.
Python
26
star
3

tsd-api-client

Command line client for the TSD HTTP API
Python
14
star
4

cerebrum

RDBMS framework for IdM and IAM systems
Python
11
star
5

certsign

A tiny ACME (Let's Encrypt) Python 2 & 3 client library with minimal dependencies.
Python
10
star
6

ipproxy

Proxy to zero the last octet of the ip-address from Google Analytics client requests to /collect and then pass them along to Analytics using the Google Analytics Measurement Protocol. Mainly useful if you prefer to do ip-address anonymization yourself (e.g. to conform with local legal requirements).
JavaScript
9
star
7

nivlheim

A system for collecting key information from all your servers and presenting it through an easy-to-use web GUI with search and browse functions. The previous generation of this system is used in production at the University of Oslo, Norway.
Go
9
star
8

flytrap

Detect and trap IP scanners
C
8
star
9

mreg

Python
7
star
10

harbor-cli

Harbor CLI
Python
7
star
11

vscode-tsd-sync

VS Code Extension - Sync workspace files into TSD
TypeScript
5
star
12

tsdfx

File transfer utility
C
4
star
13

mreg-cli

Command Line Interface for Mreg
Python
2
star
14

guix-uio

Guix channel for packages used by UiO
Scheme
2
star
15

zabbix-auto-config

Python
2
star
16

pybofh

bofh, short for "brukerorganisering for hvermannsen", is a Cerebrum administration tool
Python
2
star
17

norwegian-synonyms

A short list of Norwegian synonyms that is used for search functionality on https://uio.no
1
star
18

prace-containers

1
star
19

unioslo.github.io

Website explaining UiO's GitHub presence
CSS
1
star
20

jbofh

Java version of bofh (BrukerOrganisering for Hvermansen), Cerebrum front-end
Java
1
star
21

tsd-api-docs

documentation for the HTTP API
TeX
1
star
22

kroppskart

TypeScript
1
star
23

3D-processing-scripts

Collection of scripts for working with 3D data and processing applications such as GOM/ZEISS, metashape, clound compare and blender
Python
1
star