Ability to disable URL or host monitoring.
This commit is contained in:
parent
ffb860a979
commit
a5bb0bbe3b
2 changed files with 4 additions and 4 deletions
|
@ -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.
|
||||||
|
|
4
main.py
4
main.py
|
@ -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):
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue