Ability to disable URL or host monitoring.

This commit is contained in:
Thomas Williams 2024-07-06 14:51:35 +01:00
parent ffb860a979
commit a5bb0bbe3b
Signed by: thomas
GPG key ID: EB8F975CF60BCBFF
2 changed files with 4 additions and 4 deletions

View file

@ -5,8 +5,8 @@ Both CPU/RAM monitoring and URL monitoring can be set on their own monitoring pe
**Configuration options:** **Configuration options:**
- **hostMonitoringPeriod** - the delay in between the CPU and RAM usage being probed (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). - **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"]). - **urls** - the list of URLs to monitor (e.g. ["url1", "url2"]).
- **urlTimeout** - the delay before considering a URL to have timed out. - **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. - **maxWorkers** - the amount of threads to use when pulling URL resources. Do not set above the maximum number of threads on the host.

View file

@ -97,7 +97,7 @@ def monitorHost(stop_event):
nonPOSIXCPUStarted = False 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): 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): 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): while not (stop_event.is_set()) and (time.strftime("%H:%M:%S") >= config.urlMonitorStartTime and time.strftime("%H:%M:%S") <= config.urlMonitorEndTime):