diff --git a/prometheus_hardware_exporter/__main__.py b/prometheus_hardware_exporter/__main__.py index 5056e96..0fb43cc 100644 --- a/prometheus_hardware_exporter/__main__.py +++ b/prometheus_hardware_exporter/__main__.py @@ -18,6 +18,7 @@ ) from .config import ( DEFAULT_CONFIG, + DEFAULT_IPMI_SEL_INTERVAL, DEFAULT_REDFISH_CLIENT_MAX_RETRY, DEFAULT_REDFISH_CLIENT_TIMEOUT, DEFAULT_REDFISH_DISCOVER_CACHE_TTL, @@ -70,7 +71,7 @@ def parse_command_line() -> argparse.Namespace: parser.add_argument( "--ipmi-sel-interval", help="The duration for how many seconds to collect SEL records", - default=300, + default=DEFAULT_IPMI_SEL_INTERVAL, type=int, ) parser.add_argument( diff --git a/prometheus_hardware_exporter/config.py b/prometheus_hardware_exporter/config.py index 50b72f0..2db1f6f 100644 --- a/prometheus_hardware_exporter/config.py +++ b/prometheus_hardware_exporter/config.py @@ -11,6 +11,7 @@ DEFAULT_CONFIG = os.path.join(os.environ.get("SNAP_DATA", "./"), "config.yaml") +DEFAULT_IPMI_SEL_INTERVAL = 86400 DEFAULT_REDFISH_CLIENT_TIMEOUT = 3 DEFAULT_REDFISH_CLIENT_MAX_RETRY = 1 DEFAULT_REDFISH_DISCOVER_CACHE_TTL = 86400 @@ -25,7 +26,7 @@ class Config(BaseModel): level: str = "DEBUG" enable_collectors: List[str] = [] - ipmi_sel_interval: int = 300 + ipmi_sel_interval: int = DEFAULT_IPMI_SEL_INTERVAL redfish_host: str = "127.0.0.1" redfish_username: str = ""