-
Notifications
You must be signed in to change notification settings - Fork 474
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add logic to process check-sql config file
- limited to windows TESTS: local manual in Windows, validation integration in Linux too Change-Id: Ib54d568c1749db37c1ebed62440434ad946a436c
- Loading branch information
Showing
9 changed files
with
175 additions
and
19 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
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 |
---|---|---|
@@ -1,10 +1,26 @@ | ||
// Copyright (C) 2023 Checkmk GmbH - License: GNU General Public License v2 | ||
// This file is part of Checkmk (https://checkmk.com). It is subject to the terms and | ||
// conditions defined in the file COPYING, which is part of this source code package. | ||
|
||
use lazy_static::lazy_static; | ||
use std::path::{Path, PathBuf}; | ||
pub mod log { | ||
use flexi_logger::{Cleanup, Criterion, Naming}; | ||
pub const FILE_MAX_SIZE: Criterion = Criterion::Size(100000); | ||
pub const FILE_NAMING: Naming = Naming::Numbers; | ||
pub const FILE_CLEANUP: Cleanup = Cleanup::KeepLogFiles(5); | ||
} | ||
|
||
pub mod environment { | ||
pub const CONFIG_NAME: &str = "check-sql.yml"; | ||
pub const CONFIG_DIR_ENV_VAR: &str = "MK_CONFDIR"; | ||
} | ||
|
||
lazy_static! { | ||
pub static ref DEFAULT_CONFIG_FILE: PathBuf = | ||
Path::new(&get_env_value(environment::CONFIG_DIR_ENV_VAR, ".")) | ||
.join(environment::CONFIG_NAME); | ||
} | ||
|
||
fn get_env_value(var: &str, on_lack: &str) -> String { | ||
std::env::var(var).unwrap_or(on_lack.to_string()) | ||
} |
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
// Copyright (C) 2023 Checkmk GmbH - License: GNU General Public License v2 | ||
// This file is part of Checkmk (https://checkmk.com). It is subject to the terms and | ||
// conditions defined in the file COPYING, which is part of this source code package. | ||
|
||
pub mod tools; |
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