-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
11e7b48
commit 274d60b
Showing
6 changed files
with
50 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[package] | ||
name = "ilagent" | ||
version = "0.3.0" | ||
version = "0.3.5" | ||
authors = ["Chris Froehlingsdorf <[email protected]>"] | ||
edition = "2018" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,9 +25,9 @@ fn main() -> () { | |
|
||
let matches = App::new("iLert Agent") | ||
|
||
.version("0.3.0") | ||
.version("0.3.5") | ||
.author("iLert GmbH. <[email protected]>") | ||
.about("The iLert Agent 🦀 📦 is a program that lets you easily integrate your monitoring system with iLert.") | ||
.about("The iLert Agent 🦀 📦 lets you easily integrate your on premise system with iLert.") | ||
|
||
.arg(Arg::with_name("COMMAND") | ||
.help("The actual command that should be executed.") | ||
|
@@ -150,6 +150,20 @@ fn main() -> () { | |
.takes_value(true) | ||
) | ||
|
||
.arg(Arg::with_name("mqtt_username") | ||
.long("mqtt_username") | ||
.value_name("MQTT_USERNAME") | ||
.help("If provided under daemon command, sets mqtt client credential username (expects mqtt_password to be set as well)") | ||
.takes_value(true) | ||
) | ||
|
||
.arg(Arg::with_name("mqtt_password") | ||
.long("mqtt_password") | ||
.value_name("MQTT_PASSWORD") | ||
.help("If provided under daemon command, sets mqtt client credential password (only works with mqtt_username set)") | ||
.takes_value(true) | ||
) | ||
|
||
.arg(Arg::with_name("mqtt_event_topic") | ||
.short("e") | ||
.long("mqtt_event_topic") | ||
|
@@ -284,6 +298,15 @@ fn main() -> () { | |
config.mqtt_event_topic = Some(mqtt_event_topic.to_string()); | ||
config.mqtt_heartbeat_topic = Some(mqtt_heartbeat_topic.to_string()); | ||
|
||
if matches.is_present("mqtt_username") { | ||
config.mqtt_username = Some(matches.value_of("mqtt_username").expect("failed to parse mqtt_username").to_string()); | ||
|
||
if matches.is_present("mqtt_password") { | ||
config.mqtt_password = Some(matches.value_of("mqtt_password").expect("failed to parse mqtt_password").to_string()); | ||
info!("mqtt credentials set"); | ||
} | ||
} | ||
|
||
if matches.is_present("mqtt_filter_key") { | ||
config.mqtt_filter_key = Some(matches.value_of("mqtt_filter_key").expect("failed to parse mqtt mapping key: mqtt_filter_key").to_string()); | ||
info!("Filter key is present: {:?} will be required in event payloads", config.mqtt_filter_key); | ||
|