diff --git a/README.md b/README.md index 93d432c..f71adca 100644 --- a/README.md +++ b/README.md @@ -5,8 +5,8 @@ Both CPU/RAM monitoring and URL monitoring can be set on their own monitoring pe **Configuration options:** -- **hostMonitoringPeriod** - the delay in between the CPU and RAM usage being probed (defined in seconds). -- **urlMonitoringPeriod** - the delay in between monitoring all of the URLs (defined in seconds). +- **hostMonitoringPeriod** - the delay in between the CPU and RAM usage being probed (defined in seconds). 0 to disable. +- **urlMonitoringPeriod** - the delay in between monitoring all of the URLs (defined in seconds). 0 to disable. - **urls** - the list of URLs to monitor (e.g. ["url1", "url2"]). - **urlTimeout** - the delay before considering a URL to have timed out. - **maxWorkers** - the amount of threads to use when pulling URL resources. Do not set above the maximum number of threads on the host. diff --git a/main.py b/main.py index 8d036d7..d3c2982 100755 --- a/main.py +++ b/main.py @@ -97,7 +97,7 @@ def monitorHost(stop_event): nonPOSIXCPUStarted = False - while not (stop_event.is_set()): + while not (stop_event.is_set()) and (config.hostMonitoringPeriod > 0): while not (stop_event.is_set()) and (time.strftime("%H:%M:%S") >= config.hostMonitorStartTime and time.strftime("%H:%M:%S") <= config.hostMonitorEndTime): @@ -130,7 +130,7 @@ def monitorHost(stop_event): def monitorUrls(stop_event): - while not (stop_event.is_set()): + while not (stop_event.is_set()) and (config.urlMonitoringPeriod > 0): while not (stop_event.is_set()) and (time.strftime("%H:%M:%S") >= config.urlMonitorStartTime and time.strftime("%H:%M:%S") <= config.urlMonitorEndTime):