zabbix-api 0.1.0

Zabbix API client
Documentation

Zabbix API

This is a partial implementation of the Zabbix API client, created specifically for my pet project, wszl. Due to the extensive nature of the Zabbix API, I have been unable to allocate sufficient time to complete the implementation.

Getting started

Add dependencies:

[dependencies]
reqwest = { version = "0.11.23", features = ["blocking", "json"] }
zabbix-api = "0.1.0"

Then use:

use reqwest::blocking::Client;
use crate::client::v6::ZabbixApiV6Client;
use crate::client::ZabbixApiClient;

fn main() {
  let http_client = Client::new();

  let client = ZabbixApiV6Client::new(http_client, "http://localhost:3080/api_jsonrpc.php");
    
  match client.get_auth_session("Admin", "zabbix") {
    Ok(session) => println!("session: {session}"),
    Err(e) => {
        error!("error: {}", e);
        panic!("unexpected error")
    }
  }
}

API Methods

  • Get API info
  • Authentication
  • RAW API Call
  • Search
    • Host Group
    • Hosts
    • Items
    • Triggers
    • Web-scenarios
  • Create
    • Host Group
    • Host
    • Item
    • Trigger
    • Web-scenario

TODO

  • Add examples
  • Use enums for Zabbix types (trigger type, value type, etc.)

Limitations

  • API support: v6