Crates.io | zabbix-api |
lib.rs | zabbix-api |
version | 0.3.1 |
source | src |
created_at | 2024-01-18 16:19:19.714717 |
updated_at | 2024-09-12 13:23:10.858176 |
description | Zabbix API client |
homepage | https://github.com/lebe-dev/zabbix-api-rs |
repository | https://github.com/lebe-dev/zabbix-api-rs |
max_upload_size | |
id | 1104321 |
size | 77,208 |
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 cover 100% functionality.
Add dependencies in your Cargo.toml
:
[dependencies]
zabbix-api = "0.3.1"
Then use:
use reqwest::blocking::ClientBuilder;
use zabbix_api::client::v6::ZabbixApiV6Client;
use zabbix_api::client::ZabbixApiClient;
fn main() {
let http_client = ClientBuilder::new()
.danger_accept_invalid_certs(false) // Set true if you're using self-signed certificates.
.build().unwrap();
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) => {
eprintln!("error: {}", e);
panic!("unexpected error")
}
}
}
0.2.2
0.2.3