MKP 2.3.4. Fixed agent crash if opcache_get_status is disabled by server settings

This commit is contained in:
2023-11-26 13:06:12 +01:00
parent 82333a2ebc
commit 1fbeae93a1
4 changed files with 10 additions and 1 deletions

View File

@@ -35,6 +35,9 @@ def check_nextcloud_database(params, section):
yield Metric("nc_database_size", size)
state = getStateLower(levels, opcache_hit_rate)
summary = f"PHP OPCache hit rate: {render.percent(opcache_hit_rate)}"
if opcache_hit_rate == 0:
state = State.UNKNOWN
summary = f"PHP OPCache hit rate: 0% - please check if opcache_get_status is enabled"
details = f"\nDatabase type: {type}\nDatabase version: {version}\nDatabase size: {render.bytes(size)}"
yield(Result(state=state, summary=summary, details=details))