Skip to main content

Zabbix data retrieval

Project description

Zabgrab

Command line tool for Zabbix data retrieval.

Installation

Zabgrab can be installed using your favourite Python package manager, e.g. pip:

$ pip install zabgrab

This should automatically install the latest version of Zabgrab and its dependencies. There should then be a zabgrab command available in your terminal or console.

Zabgrab can be updated later by appending the --upgrade option to the pip install command above. The current version can be checked with zabgrab --version.

Usage

A common use for Zabgrab is to retrieve a timeseries between a start and end time from a remote server. This can be done with e.g.

$ zabgrab -o server.host="http://zabbix.example.org/" -o server.api_token="xyz" --itemid 123 0 --from "1 hour ago" --to "now"

The -o flags set configuration options. At least server.host and server.api_token are required if Zabgrab cannot find a local user configuration file (see below). The --itemid option tells Zabgrab to retrieve the Zabbix item; it requires two values, the Zabbix item ID and the history type (see below). The --from and --to options specify the dates between which to retrieve data, and support natural language queries as well as standard date formats.

The data can be output as text to the terminal by specifying --print. It can also be saved to file by specifying --output followed by a path. The following extensions are supported:

  • .mat: MATLAB mat
  • .txt (or anything else): tab separated values

Type zabgrab --help for full usage details.

History types

Zabbix has various internal data types. The correct data type must be specified in calls to the API via Zabgrab. The Zabbix API documentation lists the available data types. Most timeseries are either "0" (numerical float) or "3" (numeric unsigned).

Configuration

Zabgrab supports configuration files to define common options such as the Zabbix server and API key. It can also be used to specify templates, which are groups of items with an associated name that can be retrieved via Zabgrab using the --template (or -t) option.

The configuration file is stored in a file called zabgrab.conf in a directory called zabgrab in the operating system specific user configuration directory. For example, on Linux this file should be located at ~/.config/zabgrab/zabgrab.conf and on Windows at C:\Users\<user>\AppData\Roaming\zabgrab\zabgrab.conf.

The location of the configuration file can be overridden using the environment variable ZABGRAB_CONFIG.

The configuration is expected to be in TOML format.

Credits

Sean Leavey sean.leavey@stfc.ac.uk

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

zabgrab-0.1.2.tar.gz (24.6 kB view details)

Uploaded Source

Built Distribution

zabgrab-0.1.2-py3-none-any.whl (22.0 kB view details)

Uploaded Python 3

File details

Details for the file zabgrab-0.1.2.tar.gz.

File metadata

  • Download URL: zabgrab-0.1.2.tar.gz
  • Upload date:
  • Size: 24.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for zabgrab-0.1.2.tar.gz
Algorithm Hash digest
SHA256 64214920d11dcf57dbec930cc45498ffa285f8744cbf80daf2fb80c10a035679
MD5 6c0619b0c5ffd855839a29257c1d5494
BLAKE2b-256 e3211cd59dab1ac6a4f44b761f075a58065fe5c4d0360281c05cb658fece7e5c

See more details on using hashes here.

File details

Details for the file zabgrab-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: zabgrab-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 22.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for zabgrab-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 bd0f89d132332be26ac404994c5c12167f79bd15866126e7888a123519d91df2
MD5 8a76bd6360f7fb16b9a3e4d010327d57
BLAKE2b-256 fd558251aea588f2e9530ee48240b1a801554b27ef2a823f30efca154fc3a480

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page