Crates.io | zbx_sender |
lib.rs | zbx_sender |
version | 0.4.1 |
source | src |
created_at | 2018-04-13 18:51:50.679306 |
updated_at | 2022-07-05 06:35:55.873183 |
description | Implementation of Zabbix Sender Client. |
homepage | https://github.com/ava57r/zbx-sender-rs |
repository | https://github.com/ava57r/zbx-sender-rs |
max_upload_size | |
id | 60480 |
size | 124,598 |
Modern Rust implementation of Zabbix Sender Client. Working with Zabbix 2.0.8 and 2.1.7+ versions.
Easy to use:
extern crate zbx_sender;
use zbx_sender::{Response, Result, Sender};
use std::env;
fn send_one_value(command: &str) -> Result<Response> {
let sender = Sender::new(command.to_owned(), 10051);
sender.send(("host1", "key1", "value"))
}
fn main() {
let command = match env::args().nth(1) {
Some(cmd) => cmd,
None => {
let name = env::args().nth(0).unwrap();
panic!("Usage: {} [command]", name)
}
};
match send_one_value(&command) {
Ok(response) => println!("{:?} is success {} ", response, response.success()),
Err(e) => println!("Error {}", e),
}
}
See examples/sender.rs