zabbixlaunch/src/main.rs

25 lines
581 B
Rust
Raw Normal View History

2021-09-09 00:50:28 +02:00
pub mod config;
mod padcontrol;
mod zabbix;
2021-09-05 20:30:24 +02:00
2021-09-09 00:50:28 +02:00
use std::borrow::Borrow;
2021-09-05 20:30:24 +02:00
2021-09-09 00:50:28 +02:00
use config::Config;
2021-09-05 20:30:24 +02:00
2021-09-09 00:50:28 +02:00
fn main() {
let matches = config::argparse();
let configfile= matches.value_of("config").unwrap_or("config.json").to_owned();
2021-09-05 20:30:24 +02:00
2021-09-09 00:50:28 +02:00
// init and clear the launchpad
let (mut canvas, mut poller) = padcontrol::initpad();
let mut cfg = Config::new();
cfg.load(&configfile);
2021-09-05 20:30:24 +02:00
2021-09-09 00:50:28 +02:00
padcontrol::input(&mut canvas, &mut poller);
2021-09-05 20:30:24 +02:00
2021-09-09 00:50:28 +02:00
// fetch zabbix informations
zabbix::get_zabbix_authtoken(&mut cfg);
zabbix::get_zabbix_problems(&mut cfg);
cfg.save(&configfile);
2021-09-05 20:30:24 +02:00
}